xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ roadmap_search_history(char, char *);
void search_menu_search_history(void) {
  roadmap_search_history('A', "Recent searches");
}


x86 assembly (clang, -O0):
<search_menu_search_history>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
lea    0xee0(%rip),%rsi
call   1030 <roadmap_search_history@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_menu_search_history>:
lea    0xee9(%rip),%rsi
mov    $0x41,%edi
jmp    1030 <roadmap_search_history@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Recent searches\00"
define void @search_menu_search_history() {
%1 = call i32 @roadmap_search_history(i8 signext 65, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Recent searches\00"
define void @search_menu_search_history() {
%1 = tail call i32 @roadmap_search_history(i8 signext 65, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void linet_network_dummy() {}


x86 assembly (clang, -O0):
<linet_network_dummy>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linet_network_dummy>:
ret

LLVM IR (-O0):
define void @linet_network_dummy() {
ret void
}

LLVM IR (-O2):
define void @linet_network_dummy() {
ret void
}
void FF_DestroySemaphore(void *pSemaphore) { pSemaphore = 0; }


x86 assembly (clang, -O0):
<FF_DestroySemaphore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FF_DestroySemaphore>:
ret

LLVM IR (-O0):
define void @FF_DestroySemaphore(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @FF_DestroySemaphore(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_new() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_new"
         "\n");
}


x86 assembly (clang, -O0):
<pa_iochannel_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_iochannel_new>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_iochannel_new\0A\00"
define i32 @pa_iochannel_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_iochannel_new\00"
define i32 @pa_iochannel_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void mailer() { ; }


x86 assembly (clang, -O0):
<mailer>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mailer>:
ret

LLVM IR (-O0):
define void @mailer() {
ret void
}

LLVM IR (-O2):
define void @mailer() {
ret void
}
/* Variables and functions */
int round(double);
int getNumClauses(int numBools) { return round(4.267 * numBools); }


x86 assembly (clang, -O0):
<getNumClauses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed8(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumClauses>:
cvtsi2sd %edi,%xmm0
mulsd  0xee4(%rip),%xmm0
jmp    1030 <round@plt>

LLVM IR (-O0):
define i32 @getNumClauses(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 4.267000e+00, %4
%6 = call i32 @round(double %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @getNumClauses(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 4.267000e+00
%4 = tail call i32 @round(double %3)
ret i32 %4
}
char HttpStatus_isClientError(int code) { return (code >= 400 && code < 500); }


x86 assembly (clang, -O0):
<HttpStatus_isClientError>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x190,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <HttpStatus_isClientError+0x26>
cmpl   $0x1f4,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HttpStatus_isClientError>:
add    $0xfffffe70,%edi
cmp    $0x64,%edi
setb   %al
ret

LLVM IR (-O0):
define signext i8 @HttpStatus_isClientError(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 400
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 500
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @HttpStatus_isClientError(i32 %0) {
%2 = add i32 %0, -400
%3 = icmp ult i32 %2, 100
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
void *malloc_or_fail(size_t size) {
  void *p;
  if ((p = (void *)malloc(size)) == NULL) {
    fprintf(stderr, "Error allocating memory (errno: %d).\n", errno);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<malloc_or_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117b <malloc_or_fail+0x4b>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_fail>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <malloc_or_fail+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Error allocating memory (errno: %d).\0A\00"
@errno = global i32 0
define i8* @malloc_or_fail(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* @errno
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Error allocating memory (errno: %d).\0A\00"
@errno = global i32 0
define i8* @malloc_or_fail(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %2 to i8*
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_fill_poly() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_fill_poly>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_fill_poly>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_fill_poly() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_fill_poly() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void tlwr1043nd_init(void) {}


x86 assembly (clang, -O0):
<tlwr1043nd_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlwr1043nd_init>:
ret

LLVM IR (-O0):
define void @tlwr1043nd_init() {
ret void
}

LLVM IR (-O2):
define void @tlwr1043nd_init() {
ret void
}
int main(void) {
  extern _Alignas(4) int x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_20uint32_mem(unsigned int *val) {
  return ((*val) & (0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20uint32_mem>:
testb  $0x20,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_20uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_20uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void EVP_DigestInit_ex(void) {}


x86 assembly (clang, -O0):
<EVP_DigestInit_ex>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_DigestInit_ex>:
ret

LLVM IR (-O0):
define void @EVP_DigestInit_ex() {
ret void
}

LLVM IR (-O2):
define void @EVP_DigestInit_ex() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t strtoint(char *s) {
  uint32_t dec = 0;
  for (; *s && *s != '\n'; dec = dec * 10 + (*s++ - '0'))
    ;
  return dec;
}


x86 assembly (clang, -O0):
<strtoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1134 <strtoint+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <strtoint+0x44>
jmp    116c <strtoint+0x6c>
jmp    1149 <strtoint+0x49>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strtoint+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoint>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
test   %ecx,%ecx
je     112b <strtoint+0x2b>
cmp    $0xa,%cl
je     112b <strtoint+0x2b>
lea    (%rax,%rax,4),%eax
add    $0x1,%rdi
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
jmp    1110 <strtoint+0x10>
ret

LLVM IR (-O0):
define i32 @strtoint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %26
16: ; preds = %14
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = mul nsw i32 %18, 10
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
%22 = load i8, i8* %20
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 48
%25 = add nsw i32 %19, %24
store i32 %25, i32* %3
br label %4
26: ; preds = %14
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @strtoint(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %9, %6 ]
%4 = phi i32 [ 0, %1 ], [ %11, %6 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %12
i8 10, label %12
]
6: ; preds = %2
%7 = sext i8 %5 to i32
%8 = mul nsw i32 %4, 10
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = add i32 %8, -48
%11 = add i32 %10, %7
br label %2
12: ; preds = %2, %2
ret i32 %4
}
int execute_clone() { return 0; }


x86 assembly (clang, -O0):
<execute_clone>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_clone>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @execute_clone() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_clone() {
ret i32 0
}
/* Variables and functions */
int is_stringB_in_stringA(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char str_a[20] = "abcdefghj28";
  char str_b[10] = "defgh";
  printf("%d", is_stringB_in_stringA(str_a, str_b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x2a(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x22(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x2a(%rbp),%rsi
call   1040 <is_stringB_in_stringA@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
movabs $0x6867666564,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <is_stringB_in_stringA@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str_a = [20 x i8] c"abcdefghj28\00\00\00\00\00\00\00\00\00"
@__const.main.str_b = [10 x i8] c"defgh\00\00\00\00\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [20 x i8]* %2 to i8*
%5 = bitcast [10 x i8]* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call i32 @is_stringB_in_stringA(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str_a = [20 x i8] c"abcdefghj28\00\00\00\00\00\00\00\00\00"
@__const.main.str_b = [10 x i8] c"defgh\00\00\00\00\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @is_stringB_in_stringA(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ pow(int, int);
float sqrt(scalar_t__);
int distance(int p1, int q1, int p2, int q2) {
  float ar;
  ar = sqrt(pow((p2 - p1), 2) + pow((q2 - q1), 2));
  return ar;
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
sub    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%edi
sub    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %esi,%r14d
sub    %edi,%edx
mov    %edx,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbp
sub    %r14d,%ebx
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    %rax,%rbp
mov    %rbp,%rdi
call   1040 <sqrt@plt>
cvttss2si %xmm0,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = call i64 @pow(i32 %12, i32 2)
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = sub nsw i32 %14, %15
%17 = call i64 @pow(i32 %16, i32 2)
%18 = add nsw i64 %13, %17
%19 = call float @sqrt(i64 %18)
store float %19, float* %9
%20 = load float, float* %9
%21 = fptosi float %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %0
%6 = tail call i64 @pow(i32 %5, i32 2)
%7 = sub nsw i32 %3, %1
%8 = tail call i64 @pow(i32 %7, i32 2)
%9 = add nsw i64 %8, %6
%10 = tail call float @sqrt(i64 %9)
%11 = fptosi float %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ print_config_registers();
int /*<<< orphan*/ tag_enable(int);
void tag_dump_config(void) {
  tag_enable(1);
  print_config_registers();
  tag_enable(0);
}


x86 assembly (clang, -O0):
<tag_dump_config>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <tag_enable@plt>
mov    $0x0,%al
call   1040 <print_config_registers@plt>
xor    %edi,%edi
call   1030 <tag_enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_dump_config>:
push   %rax
mov    $0x1,%edi
call   1030 <tag_enable@plt>
xor    %eax,%eax
call   1040 <print_config_registers@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <tag_enable@plt>

LLVM IR (-O0):
define void @tag_dump_config() {
%1 = call i32 @tag_enable(i32 1)
%2 = call i32 (...) @print_config_registers()
%3 = call i32 @tag_enable(i32 0)
ret void
}

LLVM IR (-O2):
define void @tag_dump_config() {
%1 = tail call i32 @tag_enable(i32 1)
%2 = tail call i32 (...) @print_config_registers()
%3 = tail call i32 @tag_enable(i32 0)
ret void
}
int test_imm_8Bint16_reg(short val) {
  return ((val) & (0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Bint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x8b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Bint16_reg>:
test   $0x8b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Bint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 139
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_8Bint16_reg(i16 signext %0) {
%2 = and i16 %0, 139
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int clk_ratechange_before(unsigned long newrate, void *privdata) {
  printk("[%s] :%s\n", __func__, privdata);
  return 0;
}


x86 assembly (clang, -O0):
<clk_ratechange_before>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <printk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clk_ratechange_before>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
xor    %eax,%eax
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"[%s] :%s\0A\00"
@__func__.clk_ratechange_before = [22 x i8] c"clk_ratechange_before\00"
define i32 @clk_ratechange_before(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.clk_ratechange_before, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"[%s] :%s\0A\00"
@__func__.clk_ratechange_before = [22 x i8] c"clk_ratechange_before\00"
define i32 @clk_ratechange_before(i64 %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.clk_ratechange_before, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned short);
void disasm_uint16(char *dst, unsigned short v) { sprintf(dst, "%04X", v); }


x86 assembly (clang, -O0):
<disasm_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
movzwl -0xa(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_uint16>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%04X\00"
define void @disasm_uint16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = load i16, i16* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%04X\00"
define void @disasm_uint16(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 zeroext %1)
ret void
}
unsigned int round_half_down_div(unsigned int a, unsigned int b) {
  return (((b) != 0) ? ((a) + (b / 2) - 1) / (b) : 0);
}


x86 assembly (clang, -O0):
<round_half_down_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <round_half_down_div+0x2f>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1139 <round_half_down_div+0x39>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <round_half_down_div+0x39>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_half_down_div>:
test   %esi,%esi
je     1112 <round_half_down_div+0x12>
mov    %esi,%eax
shr    %eax
add    %edi,%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %esi
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @round_half_down_div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = udiv i32 %9, 2
%11 = add i32 %8, %10
%12 = sub i32 %11, 1
%13 = load i32, i32* %4
%14 = udiv i32 %12, %13
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %7
%17 = phi i32 [ %14, %7 ], [ 0, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @round_half_down_div(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = lshr i32 %1, 1
%6 = add i32 %0, -1
%7 = add i32 %6, %5
%8 = udiv i32 %7, %1
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
int g(int x) { return x + 3; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0x3(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3
ret i32 %4
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int n = 211314;
  char v[20];
  itoa(n, v);
  printf("%s\n", v);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x33972,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    $0x33972,%edi
mov    %rbx,%rsi
call   1040 <itoa@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 0, i32* %1
store i32 211314, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = call i32 @itoa(i32 %4, i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 211314, i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ setState(int);
__attribute__((constructor)) void myInit3() { setState(4); }


x86 assembly (clang, -O0):
<myInit3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <setState@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myInit3>:
mov    $0x4,%edi
jmp    1030 <setState@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit3, i8* null }]
define void @myInit3() {
%1 = call i32 @setState(i32 4)
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit3, i8* null }]
define void @myInit3() {
%1 = tail call i32 @setState(i32 4)
ret void
}
void MOT32(void *msg_buf) {}


x86 assembly (clang, -O0):
<MOT32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOT32>:
ret

LLVM IR (-O0):
define void @MOT32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @MOT32(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void *Z_TagMalloc(size_t, int /*<<< orphan*/);
void *Z_Malloc(size_t size) { return Z_TagMalloc(size, 0); }


x86 assembly (clang, -O0):
<Z_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <Z_TagMalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Z_Malloc>:
xor    %esi,%esi
jmp    1030 <Z_TagMalloc@plt>

LLVM IR (-O0):
define i8* @Z_Malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @Z_TagMalloc(i64 %3, i32 0)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Z_Malloc(i64 %0) {
%2 = tail call i8* @Z_TagMalloc(i64 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ nrf_802154_ack_pending_bit_set(int);
void nrf_802154_auto_pending_bit_set(bool enabled) {
  nrf_802154_ack_pending_bit_set(enabled);
}


x86 assembly (clang, -O0):
<nrf_802154_auto_pending_bit_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <nrf_802154_ack_pending_bit_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_802154_auto_pending_bit_set>:
jmp    1030 <nrf_802154_ack_pending_bit_set@plt>

LLVM IR (-O0):
define void @nrf_802154_auto_pending_bit_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nrf_802154_ack_pending_bit_set(i32 %3)
ret void
}

LLVM IR (-O2):
define void @nrf_802154_auto_pending_bit_set(i32 %0) {
%2 = tail call i32 @nrf_802154_ack_pending_bit_set(i32 %0)
ret void
}
/* Variables and functions */
int GET32(scalar_t__);
int /*<<< orphan*/ PUT32(int, int);
void pwm_set(unsigned int duty_cycle) {
  PUT32((0x2020C000 + 0x14), duty_cycle);
  PUT32((0x2020C000 + 0), GET32((0x2020C000 + 0)) | 1);
}


x86 assembly (clang, -O0):
<pwm_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2020c014,%edi
call   1030 <PUT32@plt>
mov    $0x2020c000,%edi
call   1040 <GET32@plt>
mov    %eax,%esi
or     $0x1,%esi
mov    $0x2020c000,%edi
call   1030 <PUT32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_set>:
push   %rax
mov    %edi,%esi
mov    $0x2020c014,%edi
call   1030 <PUT32@plt>
mov    $0x2020c000,%edi
call   1040 <GET32@plt>
or     $0x1,%eax
mov    $0x2020c000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @pwm_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @PUT32(i32 539017236, i32 %3)
%5 = call i32 @GET32(i64 539017216)
%6 = or i32 %5, 1
%7 = call i32 @PUT32(i32 539017216, i32 %6)
ret void
}

LLVM IR (-O2):
define void @pwm_set(i32 %0) {
%2 = tail call i32 @PUT32(i32 539017236, i32 %0)
%3 = tail call i32 @GET32(i64 539017216)
%4 = or i32 %3, 1
%5 = tail call i32 @PUT32(i32 539017216, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
FILE *open_file(char *fn) {
  FILE *fp = fopen(fn, "r");
  if (fp == NULL) {
    perror("File open failed!");
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <open_file+0x37>
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113a <open_file+0x1a>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec1(%rip),%rdi
call   1040 <perror@plt>
jmp    1135 <open_file+0x15>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"File open failed!\00"
define i32* @open_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32*, i32** %3
ret i32* %11
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"File open failed!\00"
define noalias i32* @open_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32* %2
}
void fd33(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  a:
    goto a;
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd33>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd33+0x7>

x86 assembly (clang, -O2):
<fd33>:
jmp    1100 <fd33>

LLVM IR (-O0):
define void @fd33(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; preds = %8
br label %8
9: ; No predecessors!
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %12, %9
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; preds = %18
br label %18
19: ; No predecessors!
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %22, %19
br label %22
23: ; preds = %23
br label %23
24: ; No predecessors!
%25 = load i32, i32* %2
%26 = zext i32 %25 to i64
br label %27
27: ; preds = %27, %24
br label %27
28: ; No predecessors!
%29 = load i32, i32* %2
%30 = zext i32 %29 to i64
br label %31
31: ; preds = %31, %28
br label %31
32: ; preds = %32
br label %32
33: ; No predecessors!
%34 = load i32, i32* %2
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %36, %33
br label %36
37: ; preds = %37
br label %37
38: ; No predecessors!
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
br label %41
41: ; preds = %41, %38
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd33(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int eval_expr_0(char **);
char *suppr_spaces(char *);
int eval_expr(char *str) {
  str = suppr_spaces(str);
  if (str[0] == '\0')
    return (0);
  return (eval_expr_0(&str));
}


x86 assembly (clang, -O0):
<eval_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <suppr_spaces@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1155 <eval_expr+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1161 <eval_expr+0x41>
lea    -0x10(%rbp),%rdi
call   1030 <eval_expr_0@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_expr>:
push   %rax
call   1040 <suppr_spaces@plt>
mov    %rax,(%rsp)
cmpb   $0x0,(%rax)
je     1139 <eval_expr+0x19>
mov    %rsp,%rdi
call   1030 <eval_expr_0@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eval_expr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i8* @suppr_spaces(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %14
12: ; preds = %1
%13 = call i32 @eval_expr_0(i8** %3)
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @eval_expr(i8* %0) {
%2 = alloca i8*
%3 = tail call i8* @suppr_spaces(i8* %0)
store i8* %3, i8** %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @eval_expr_0(i8** %2)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
float __ocml_log1p_f32(float);
float log1pf(float x) { return __ocml_log1p_f32(x); }


x86 assembly (clang, -O0):
<log1pf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_log1p_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pf>:
jmp    1030 <__ocml_log1p_f32@plt>

LLVM IR (-O0):
define float @log1pf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__ocml_log1p_f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @log1pf(float %0) {
%2 = tail call float @__ocml_log1p_f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", sizeof(unsigned long));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
int cmp_util(unsigned int A, unsigned int B) {
  if (A == B)
    return 0;
  if (A < B)
    return 1;
  return 2;
}


x86 assembly (clang, -O0):
<cmp_util>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <cmp_util+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1141 <cmp_util+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    113a <cmp_util+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <cmp_util+0x41>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_util>:
cmp    %esi,%edi
mov    $0x2,%ecx
sbb    $0x0,%ecx
xor    %eax,%eax
cmp    %esi,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_util(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp ult i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %16
15: ; preds = %10
store i32 2, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @cmp_util(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp ult i32 %0, %1
%5 = select i1 %4, i32 1, i32 2
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
int __attribute__((unused)) tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c = 'a' + c - 'A';
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1127 <tolower+0x27>
cmpl   $0x5a,-0x4(%rbp)
jg     1127 <tolower+0x27>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 97, %9
%11 = sub nsw i32 %10, 65
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %5, %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
long __attribute__((no, noclone)) foo(long a) { return a + 5; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x5,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x5(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 5
ret i64 %4
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = add nsw i64 %0, 5
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int tgetent(char *bp, char *name) { return (!strcmp(name, "ansi")); }


x86 assembly (clang, -O0):
<tgetent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgetent>:
push   %rax
mov    %rsi,%rdi
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ansi\00"
define i32 @tgetent(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"ansi\00"
define i32 @tgetent(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, int);
void *Reallocate(void *p, int size) {
  void *r = realloc(p, size);
  if (!r)
    abort();
  return r;
}


x86 assembly (clang, -O0):
<Reallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <Reallocate+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reallocate>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <Reallocate+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @Reallocate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @Reallocate(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
double floating_point_message1_signal1_encode(double value) {
  return (double)(value);
}


x86 assembly (clang, -O0):
<floating_point_message1_signal1_encode>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floating_point_message1_signal1_encode>:
ret

LLVM IR (-O0):
define double @floating_point_message1_signal1_encode(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @floating_point_message1_signal1_encode(double returned %0) {
ret double %0
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_LESS_THAN_int32_t(int32_t const k1, int32_t const k2) {
  return k1 < k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_LESS_THAN_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_LESS_THAN_int32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int32_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_LESS_THAN_int32_t(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void rte_prefetch2(volatile void *p) {
  asm volatile("prefetcht2 %[p]" : [p] "+m"(*(volatile char *)p));
}


x86 assembly (clang, -O0):
<rte_prefetch2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
prefetcht2 (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_prefetch2>:
prefetcht2 (%rdi)
ret

LLVM IR (-O0):
define void @rte_prefetch2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @rte_prefetch2(i8* %0) {
tail call void asm sideeffect "prefetcht2 $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
int is_valid_operational_value(int value) { return value != -1; }


x86 assembly (clang, -O0):
<is_valid_operational_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_operational_value>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @is_valid_operational_value(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_valid_operational_value(i32 %0) {
%2 = icmp ne i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
void test_2_segf() { int x = *(int *)0x1234; }


x86 assembly (clang, -O0):
<test_2_segf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_2_segf>:
ret

LLVM IR (-O0):
define void @test_2_segf() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 4660 to i32*)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @test_2_segf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_print(char *);
void game_process_connection_failed() {
  console_print("\nFailed to connect!\n");
}


x86 assembly (clang, -O0):
<game_process_connection_failed>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <console_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_process_connection_failed>:
lea    0xee9(%rip),%rdi
jmp    1030 <console_print@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0AFailed to connect!\0A\00"
define void @game_process_connection_failed() {
%1 = call i32 @console_print(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0AFailed to connect!\0A\00"
define void @game_process_connection_failed() {
%1 = tail call i32 @console_print(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}