xunge/DecIR huggingface dataset:
int NPG(int param[]) {
  return (param[0] + 1) * (param[1] + 1) * (param[2] + 1) * param[3] *
         param[4] * param[5];
}


x86 assembly (clang, -O0):
<NPG>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
imul   0xc(%rcx),%eax
mov    -0x8(%rbp),%rcx
imul   0x10(%rcx),%eax
mov    -0x8(%rbp),%rcx
imul   0x14(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NPG>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
add    $0x1,%eax
add    $0x1,%ecx
imul   %eax,%ecx
mov    0x8(%rdi),%eax
add    $0x1,%eax
imul   %ecx,%eax
imul   0xc(%rdi),%eax
imul   0x10(%rdi),%eax
imul   0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @NPG(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
%16 = mul nsw i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = mul nsw i32 %16, %19
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 4
%23 = load i32, i32* %22
%24 = mul nsw i32 %20, %23
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 5
%27 = load i32, i32* %26
%28 = mul nsw i32 %24, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @NPG(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
%7 = mul nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = mul nsw i32 %11, %13
%15 = getelementptr inbounds i32, i32* %0, i64 4
%16 = load i32, i32* %15
%17 = mul nsw i32 %14, %16
%18 = getelementptr inbounds i32, i32* %0, i64 5
%19 = load i32, i32* %18
%20 = mul nsw i32 %17, %19
ret i32 %20
}
void RTMemAllocVarTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemAllocVarTag() {
ret void
}
/* Variables and functions */
float atof(char const *);
float SV_ReadVersionRequest(const char *version) {
  float usableversion = atof(version);
  switch ((int)usableversion) {
  case 1:
    break;
  default:
    usableversion = 0;
    break;
  }
  return usableversion;
}


x86 assembly (clang, -O0):
<SV_ReadVersionRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
sub    $0x1,%eax
jne    1142 <SV_ReadVersionRequest+0x32>
jmp    113d <SV_ReadVersionRequest+0x2d>
jmp    114a <SV_ReadVersionRequest+0x3a>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_ReadVersionRequest>:
push   %rax
call   1030 <atof@plt>
cvttss2si %xmm0,%eax
cmp    $0x1,%eax
je     1122 <SV_ReadVersionRequest+0x12>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SV_ReadVersionRequest(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call float @atof(i8* %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fptosi float %6 to i32
switch i32 %7, label %9 [
i32 1, label %8
]
8: ; preds = %1
br label %10
9: ; preds = %1
store float 0.000000e+00, float* %3
br label %10
10: ; preds = %9, %8
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @SV_ReadVersionRequest(i8* nocapture %0) {
%2 = tail call float @atof(i8* %0)
%3 = fptosi float %2 to i32
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, float %2, float 0.000000e+00
ret float %5
}
void foo739() {}


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

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

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

LLVM IR (-O2):
define void @foo739() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ not_prune_multiple4(int *);
void call_not_prune_multiple4_Good() {
  int m[2] = {0, 4};
  not_prune_multiple4(m);
}


x86 assembly (clang, -O0):
<call_not_prune_multiple4_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <not_prune_multiple4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_not_prune_multiple4_Good>:
push   %rax
movabs $0x400000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <not_prune_multiple4@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.call_not_prune_multiple4_Good.m = [2 x i32] [i32 0, i32 4]
define void @call_not_prune_multiple4_Good() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @not_prune_multiple4(i32* %3)
ret void
}

LLVM IR (-O2):
define void @call_not_prune_multiple4_Good() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 17179869184, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @not_prune_multiple4(i32* %3)
ret void
}
void k(const int *p) {
  int *kp = p;
  (void)kp;
}


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

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

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

LLVM IR (-O2):
define void @k(i32* nocapture %0) {
ret void
}
int resta(int a, int b) { return (a - b); }


x86 assembly (clang, -O0):
<resta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<resta>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @resta(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @resta(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xa2() {
  Assert_real((isodigit(162) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              815, ("isodigit should be 0 for 0xa2"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xa2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa2,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x32f,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xa2>:
push   %rax
mov    $0xa2,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x32f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa2\00"
define void @t_isodigit_0xa2() {
%1 = call i64 @isodigit(i32 162)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 815, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa2\00"
define void @t_isodigit_0xa2() {
%1 = tail call i64 @isodigit(i32 162)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 815, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int lame_set_stream_binary_mode(FILE *const fp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lame_set_stream_binary_mode(i32* nocapture readnone %0) {
ret i32 0
}
__attribute__((no, noclone)) int f2(void *a, int b, int c, long d[], int *e) {
  asm volatile("" : : "r"(a), "r"(b), "r"(c), "r"(d), "r"(e) : "memory");
  return 1;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f2(i8* %0, i32 %1, i32 %2, i64* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64*
%10 = alloca i32*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i64* %3, i64** %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i64*, i64** %9
%15 = load i32*, i32** %10
ret i32 1
}

LLVM IR (-O2):
define i32 @f2(i8* %0, i32 %1, i32 %2, i64* %3, i32* %4) {
tail call void asm sideeffect "", "r,r,r,r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1, i32 %2, i64* %3, i32* %4)
ret i32 1
}
int getSum(int BITree[], int index) {
  int sum = 0;
  index = index + 1;
  while (index > 0) {
    sum += BITree[index];
    index -= index & (-index);
  }
  return sum;
}


x86 assembly (clang, -O0):
<getSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114d <getSum+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
sub    -0xc(%rbp),%eax
and    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <getSum+0x1b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSum>:
test   %esi,%esi
js     111f <getSum+0x1f>
add    $0x1,%esi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %esi,%ecx
add    (%rdi,%rcx,4),%eax
lea    -0x1(%rsi),%ecx
and    %esi,%ecx
mov    %ecx,%esi
jne    1110 <getSum+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getSum(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = add nuw nsw i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %12, %6 ], [ 0, %4 ]
%8 = phi i32 [ %14, %6 ], [ %5, %4 ]
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, %7
%13 = add nsw i32 %8, -1
%14 = and i32 %13, %8
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ mill_choose_otherwise();
void go_select_otherwise() { mill_choose_otherwise(); }


x86 assembly (clang, -O0):
<go_select_otherwise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mill_choose_otherwise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<go_select_otherwise>:
xor    %eax,%eax
jmp    1030 <mill_choose_otherwise@plt>

LLVM IR (-O0):
define void @go_select_otherwise() {
%1 = call i32 (...) @mill_choose_otherwise()
ret void
}

LLVM IR (-O2):
define void @go_select_otherwise() {
%1 = tail call i32 (...) @mill_choose_otherwise()
ret void
}
/* Variables and functions */
int GPTLerror(char *);
int get_cpustamp(long *usr, long *sys) {
  return GPTLerror("get_cpustamp: times() not available\n");
}


x86 assembly (clang, -O0):
<get_cpustamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <GPTLerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"get_cpustamp: times() not available\0A\00"
define i32 @get_cpustamp(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = call i32 @GPTLerror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 %5
}

LLVM IR (-O2):
@.str = [37 x i8] c"get_cpustamp: times() not available\0A\00"
define i32 @get_cpustamp(i64* nocapture readnone %0, i64* nocapture readnone %1) {
%3 = tail call i32 @GPTLerror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myfunc() { printf("Process B was receive the signal !\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Process B was receive the signal !\0A\00"
define void @myfunc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Process B was receive the signal !\00"
define void @myfunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
int foo() {
  int i, j;
  int diff = 0;
  for (i = 0; i < 40; i++) {
    for (j = 0; j < 40; j++) {
      diff += j;
    }
  }
  return diff;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x28,-0x4(%rbp)
jge    1157 <foo+0x57>
movl   $0x0,-0x8(%rbp)
cmpl   $0x28,-0x8(%rbp)
jge    1144 <foo+0x44>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <foo+0x23>
jmp    1149 <foo+0x49>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <foo+0x12>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x79e0,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
store i32 0, i32* %1
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 40
br i1 %6, label %7, label %22
7: ; preds = %4
store i32 0, i32* %2
br label %8
8: ; preds = %15, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 40
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
br label %15
15: ; preds = %11
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %8
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
br label %4
22: ; preds = %4
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 31200
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
scalar_t__ little_endianess();
uint32_t htonl_util(uint32_t input) {
  if (little_endianess()) {
    return htonl(input);
  } else {
    return input;
  }
}


x86 assembly (clang, -O0):
<htonl_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <little_endianess@plt>
cmp    $0x0,%rax
je     114c <htonl_util+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <htonl_util+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonl_util>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <little_endianess@plt>
test   %rax,%rax
je     1137 <htonl_util+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @htonl_util(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @little_endianess()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @htonl(i32 %7)
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @htonl_util(i32 %0) {
%2 = tail call i64 (...) @little_endianess()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @htonl(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
int strtype(const char *s, int (*func)(int c)) {
  int return_num = 0;
  for (; *s != '\0'; s++) {
    if ((return_num = func((unsigned char)*s)) == 0)
      break;
  }
  return return_num;
}


x86 assembly (clang, -O0):
<strtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <strtype+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%edi
call   *%rax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    1145 <strtype+0x45>
jmp    115b <strtype+0x5b>
jmp    114a <strtype+0x4a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1117 <strtype+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtype>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%cl
xor    %r14d,%r14d
test   %cl,%cl
je     1138 <strtype+0x38>
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x1,%rbp
nopw   0x0(%rax,%rax,1)
movzbl %cl,%edi
call   *%rbx
test   %eax,%eax
je     1138 <strtype+0x38>
movzbl 0x0(%rbp),%ecx
add    $0x1,%rbp
test   %cl,%cl
jne    1120 <strtype+0x20>
mov    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strtype(i8* %0, i32 (i32)* %1) {
%3 = alloca i8*
%4 = alloca i32 (i32)*
%5 = alloca i32
store i8* %0, i8** %3
store i32 (i32)* %1, i32 (i32)** %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %6
%12 = load i32 (i32)*, i32 (i32)** %4
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = call i32 %12(i32 %15)
store i32 %16, i32* %5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
br label %23
19: ; preds = %11
br label %20
20: ; preds = %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %6
23: ; preds = %18, %6
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @strtype(i8* nocapture %0, i32 (i32)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %8
5: ; preds = %8
%6 = load i8, i8* %14
%7 = icmp eq i8 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %14, %5 ], [ %0, %2 ]
%11 = zext i8 %9 to i32
%12 = tail call i32 %1(i32 %11)
%13 = icmp eq i32 %12, 0
%14 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %13, label %15, label %5
15: ; preds = %5, %8, %2
%16 = phi i32 [ 0, %2 ], [ 0, %8 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ displays_example_name_before_it_block(char const *);
void Displayer_display_example_name(const char *example) {
  displays_example_name_before_it_block(example);
}


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

x86 assembly (clang, -O2):
<Displayer_display_example_name>:
jmp    1030 <displays_example_name_before_it_block@plt>

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

LLVM IR (-O2):
define void @Displayer_display_example_name(i8* %0) {
%2 = tail call i32 @displays_example_name_before_it_block(i8* %0)
ret void
}
void icache_enable(void) { return; }


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

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

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

LLVM IR (-O2):
define void @icache_enable() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *getFileExtension(char *pathname) {
  char *fname = strrchr(pathname, '.');
  if (fname)
    return fname + 1;
  return "";
}


x86 assembly (clang, -O0):
<getFileExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <getFileExtension+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <getFileExtension+0x45>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileExtension>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xed7(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @getFileExtension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %13
12: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @getFileExtension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
void at91sama5d3xek_devices_detect_hw(void) {}


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

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

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

LLVM IR (-O2):
define void @at91sama5d3xek_devices_detect_hw() {
ret void
}
__attribute__((noreturn)) void __stack_chk_fail(void) {
  asm volatile("cli\nhlt");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<__stack_chk_fail>:
push   %rbp
mov    %rsp,%rbp
cli
hlt
jmp    1106 <__stack_chk_fail+0x6>

x86 assembly (clang, -O2):
<__stack_chk_fail>:
cli
hlt
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1110 <__stack_chk_fail+0x10>

LLVM IR (-O0):
define void @__stack_chk_fail() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @__stack_chk_fail() {
tail call void asm sideeffect "cli\0Ahlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int foo(int);
int bar(int barparam) { return foo(barparam); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int ssize_t;

/* Variables and functions */
bool sancus_get_u8zd(ssize_t v, uint8_t *out) {
  if ((v >= 0) && (v <= 0xff)) {
    if (out != NULL)
      *out = (uint8_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u8zd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1144 <sancus_get_u8zd+0x44>
cmpl   $0xff,-0x8(%rbp)
jg     1144 <sancus_get_u8zd+0x44>
cmpq   $0x0,-0x10(%rbp)
je     1138 <sancus_get_u8zd+0x38>
movslq -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114b <sancus_get_u8zd+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u8zd>:
xor    %eax,%eax
cmp    $0xff,%edi
ja     1119 <sancus_get_u8zd+0x19>
mov    $0x1,%eax
test   %rsi,%rsi
je     1119 <sancus_get_u8zd+0x19>
mov    %edi,%ecx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define i32 @sancus_get_u8zd(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64*
store i32 %0, i32* %4
store i64* %1, i64** %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 255
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i64*, i64** %5
%13 = icmp ne i64* %12, null
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = load i64*, i64** %5
store i64 %16, i64* %17
br label %18
18: ; preds = %14, %11
store i32 1, i32* %3
br label %20
19: ; preds = %8, %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @sancus_get_u8zd(i32 %0, i64* writeonly %1) {
%3 = icmp ult i32 %0, 256
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = zext i32 %0 to i64
store i64 %7, i64* %1
br label %8
8: ; preds = %2, %4, %6
%9 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ swab(unsigned char *, unsigned char *, int);
void uyvy2yuy2(unsigned char *src, unsigned char *dest, int NumPixels) {
  swab(src, dest, NumPixels << 1);
}


x86 assembly (clang, -O0):
<uyvy2yuy2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
call   1030 <swab@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uyvy2yuy2>:
add    %edx,%edx
jmp    1030 <swab@plt>

LLVM IR (-O0):
define void @uyvy2yuy2(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = shl i32 %9, 1
%11 = call i32 @swab(i8* %7, i8* %8, i32 %10)
ret void
}

LLVM IR (-O2):
define void @uyvy2yuy2(i8* %0, i8* %1, i32 %2) {
%4 = shl i32 %2, 1
%5 = tail call i32 @swab(i8* %0, i8* %1, i32 %4)
ret void
}
int accel_x() {}


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

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

LLVM IR (-O0):
define i32 @accel_x() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @accel_x() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ recv(int, char *, int, int /*<<< orphan*/);
void print_recv(int fd) {
  char buf[128];
  while (recv(fd, buf, 128, 0) > 0) {
    printf("%s", buf);
  }
  close(fd);
  return;
}


x86 assembly (clang, -O0):
<print_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x0,%rax
jle    1176 <print_recv+0x46>
lea    -0x90(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    113e <print_recv+0xe>
mov    -0x4(%rbp),%edi
call   1050 <close@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_recv>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jle    1181 <print_recv+0x51>
lea    0xea8(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
jg     1160 <print_recv+0x30>
mov    %ebp,%edi
call   1050 <close@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print_recv(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %2
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = call i64 @recv(i32 %5, i8* %6, i32 128, i32 0)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %4
12: ; preds = %4
%13 = load i32, i32* %2
%14 = call i32 @close(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_recv(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i64 @recv(i32 %0, i8* %3, i32 128, i32 0)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%8 = call i64 @recv(i32 %0, i8* %3, i32 128, i32 0)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %1
%11 = call i32 @close(i32 %0)
ret void
}
int mocked_int_function1() {
  ;
  return -1;
}


x86 assembly (clang, -O0):
<mocked_int_function1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mocked_int_function1>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @mocked_int_function1() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @mocked_int_function1() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo();
int main() {
  if (foo() != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(void) {
  printf("Usage: sd [-p PORT] FILE\n\n");
  printf("PORT - device TCP listening port. default: %d\n", 8207);
  printf("FILE - storage daemon file\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x200f,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x200f,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: sd [-p PORT] FILE\0A\0A\00"
@.str.1 = [47 x i8] c"PORT - device TCP listening port. default: %d\0A\00"
@.str.2 = [28 x i8] c"FILE - storage daemon file\0A\00"
define void @usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 8207)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str.1 = [47 x i8] c"PORT - device TCP listening port. default: %d\0A\00"
@str = [26 x i8] c"Usage: sd [-p PORT] FILE\0A\00"
@str.3 = [27 x i8] c"FILE - storage daemon file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 8207)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ GPIOPinTypeGPIOOutput(int, int);
int /*<<< orphan*/ SysCtlPeripheralEnable(int);
void LCD_init_gpio(void) {
  SysCtlPeripheralEnable(0x20000001);
  GPIOPinTypeGPIOOutput(0x40004000, (0x00000001 | 0x00000002 | 0x00000010 |
                                     0x00000004 | 0x00000008));
}


x86 assembly (clang, -O0):
<LCD_init_gpio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20000001,%edi
call   1030 <SysCtlPeripheralEnable@plt>
mov    $0x40004000,%edi
mov    $0x1f,%esi
call   1040 <GPIOPinTypeGPIOOutput@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_init_gpio>:
push   %rax
mov    $0x20000001,%edi
call   1030 <SysCtlPeripheralEnable@plt>
mov    $0x40004000,%edi
mov    $0x1f,%esi
pop    %rax
jmp    1040 <GPIOPinTypeGPIOOutput@plt>

LLVM IR (-O0):
define void @LCD_init_gpio() {
%1 = call i32 @SysCtlPeripheralEnable(i32 536870913)
%2 = call i32 @GPIOPinTypeGPIOOutput(i32 1073758208, i32 31)
ret void
}

LLVM IR (-O2):
define void @LCD_init_gpio() {
%1 = tail call i32 @SysCtlPeripheralEnable(i32 536870913)
%2 = tail call i32 @GPIOPinTypeGPIOOutput(i32 1073758208, i32 31)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_doc_begin(char *title) {
  printf("<head><title>%s</title></head>\n", title);
  printf(
      "<h1>%s</h1>\n<img "
      "src=\"http://www.hypermail.org/images/stripe.bottom.gif alt=\"\"><br>",
      title);
}


x86 assembly (clang, -O0):
<print_doc_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_doc_begin>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"<head><title>%s</title></head>\0A\00"
@.str.1 = [84 x i8] c"<h1>%s</h1>\0A<img src=\22http://www.hypermail.org/images/stripe.bottom.gif alt=\22\22><br>\00"
define void @print_doc_begin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"<head><title>%s</title></head>\0A\00"
@.str.1 = [84 x i8] c"<h1>%s</h1>\0A<img src=\22http://www.hypermail.org/images/stripe.bottom.gif alt=\22\22><br>\00"
define void @print_doc_begin(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double __datn2d(double, double);
double intr_wrap_024(double p1, double p2) { return __datn2d(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_024>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__datn2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_024>:
jmp    1030 <__datn2d@plt>

LLVM IR (-O0):
define double @intr_wrap_024(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__datn2d(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @intr_wrap_024(double %0, double %1) {
%3 = tail call double @__datn2d(double %0, double %1)
ret double %3
}
int run_length(char *p, char c) {
  int i = 0;
  char d;
  while ((d = p[i++]) == c) {
  }
  return i - 1;
}


x86 assembly (clang, -O0):
<run_length>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <run_length+0x41>
jmp    1115 <run_length+0x15>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
lea    0x1(%rdi),%rcx
cmp    %sil,(%rdi)
mov    %rcx,%rdi
je     1110 <run_length+0x10>
ret

LLVM IR (-O0):
define i32 @run_length(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %7
7: ; preds = %18, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
store i8 %13, i8* %6
%14 = sext i8 %13 to i32
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %7
br label %7
19: ; preds = %7
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @run_length(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %5, %3 ], [ 0, %2 ]
%5 = add nuw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %1
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
hystopn(telno, flds, dev) char *telno, *flds[];
struct Devices *dev;
{
  return hysopn(telno, flds, dev, 1);
}


x86 assembly (clang, -O0):
<hystopn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <hysopn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hystopn>:
mov    $0x1,%ecx
xor    %eax,%eax
jmp    1030 <hysopn@plt>

LLVM IR (-O0):
%struct.Devices = type opaque
define i32 @hystopn(i8* %0, i8** %1, %struct.Devices* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca %struct.Devices*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store %struct.Devices* %2, %struct.Devices** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load %struct.Devices*, %struct.Devices** %6
%10 = call i32 (i8*, i8**, %struct.Devices*, i32, ...) bitcast (i32 (...)* @hysopn to i32 (i8*, i8**, %struct.Devices*, i32, ...)*)(i8* %7, i8** %8, %struct.Devices* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.Devices = type opaque
define i32 @hystopn(i8* %0, i8** %1, %struct.Devices* %2) {
%4 = tail call i32 (i8*, i8**, %struct.Devices*, i32, ...) bitcast (i32 (...)* @hysopn to i32 (i8*, i8**, %struct.Devices*, i32, ...)*)(i8* %0, i8** %1, %struct.Devices* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void sh_pwd() {
  char *cwd = getcwd(NULL, 0);
  printf("%s\n", cwd);
  free(cwd);
}


x86 assembly (clang, -O0):
<sh_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_pwd>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @sh_pwd() {
%1 = alloca i8*
%2 = call i8* @getcwd(i32* null, i32 0)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @sh_pwd() {
%1 = tail call i8* @getcwd(i32* null, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wl_mktree_sub(unsigned int, int /*<<< orphan*/);
void wl_mktree(void) {
  unsigned testcode = 102;
  wl_mktree_sub(testcode, 0);
}


x86 assembly (clang, -O0):
<wl_mktree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x66,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <wl_mktree_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_mktree>:
mov    $0x66,%edi
xor    %esi,%esi
jmp    1030 <wl_mktree_sub@plt>

LLVM IR (-O0):
define void @wl_mktree() {
%1 = alloca i32
store i32 102, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @wl_mktree_sub(i32 %2, i32 0)
ret void
}

LLVM IR (-O2):
define void @wl_mktree() {
%1 = tail call i32 @wl_mktree_sub(i32 102, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void test1(void (*callback)(const char *)) {
  printf("TEST\n");
  fflush(stdout);
  callback("TEST2");
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xeb9(%rip),%rdi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rax
pop    %rbx
jmp    *%rax

LLVM IR (-O0):
@.str = [6 x i8] c"TEST\0A\00"
@stdout = global i32 0
@.str.1 = [6 x i8] c"TEST2\00"
define void @test1(void (i8*)* %0) {
%2 = alloca void (i8*)*
store void (i8*)* %0, void (i8*)** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = load void (i8*)*, void (i8*)** %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [6 x i8] c"TEST2\00"
@str = [5 x i8] c"TEST\00"
define void @test1(void (i8*)* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
tail call void %0(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
long sysconf(int /*<<< orphan*/);
long get_clock_ticks() { return sysconf(_SC_CLK_TCK); }


x86 assembly (clang, -O0):
<get_clock_ticks>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_clock_ticks>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_CLK_TCK = global i32 0
define i64 @get_clock_ticks() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_CLK_TCK = global i32 0
define i64 @get_clock_ticks() {
%1 = load i32, i32* @_SC_CLK_TCK
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}