xunge/DecIR huggingface dataset:
/* Type definitions */
typedef size_t uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t sequential_search(int32_t *a, uint32_t n, int32_t x) {
  uint32_t k;
  k = 0;
  while (a[k] < x) {
    k++;
  }
  if (a[k] == x) {
    return k;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<sequential_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jge    113f <sequential_search+0x3f>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <sequential_search+0x18>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jne    1162 <sequential_search+0x62>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <sequential_search+0x6a>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequential_search>:
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
add    $0x1,%rcx
cmp    %rdx,0x8(%rdi,%rax,8)
jl     1110 <sequential_search+0x10>
mov    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @sequential_search(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64* %0, i64** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 0, i64* %8
br label %9
9: ; preds = %16, %3
%10 = load i64*, i64** %5
%11 = load i64, i64* %8
%12 = getelementptr inbounds i64, i64* %10, i64 %11
%13 = load i64, i64* %12
%14 = load i64, i64* %7
%15 = icmp slt i64 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %9
%17 = load i64, i64* %8
%18 = add i64 %17, 1
store i64 %18, i64* %8
br label %9
19: ; preds = %9
%20 = load i64*, i64** %5
%21 = load i64, i64* %8
%22 = getelementptr inbounds i64, i64* %20, i64 %21
%23 = load i64, i64* %22
%24 = load i64, i64* %7
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = load i64, i64* %8
store i64 %27, i64* %4
br label %29
28: ; preds = %19
store i64 -1, i64* %4
br label %29
29: ; preds = %28, %26
%30 = load i64, i64* %4
ret i64 %30
}

LLVM IR (-O2):
define i64 @sequential_search(i64* nocapture %0, i64 %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ 0, %3 ], [ %9, %4 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = icmp slt i64 %7, %2
%9 = add i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = icmp eq i64 %7, %2
%12 = select i1 %11, i64 %5, i64 -1
ret i64 %12
}
const char *ConvertPUState(char state) {
  switch (state) {
  case 1:
    return "Off";
  case 2:
    return "On";
  case 3:
    return "Dimming";
  }
  return "Unknown";
}


x86 assembly (clang, -O0):
<ConvertPUState>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     1141 <ConvertPUState+0x41>
jmp    111f <ConvertPUState+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1151 <ConvertPUState+0x51>
jmp    1130 <ConvertPUState+0x30>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     1161 <ConvertPUState+0x61>
jmp    1171 <ConvertPUState+0x71>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <ConvertPUState+0x7c>
lea    0xeac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <ConvertPUState+0x7c>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <ConvertPUState+0x7c>
lea    0xe97(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertPUState>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     111a <ConvertPUState+0x1a>
movslq %edi,%rax
lea    0xf06(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xeee(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Off\00"
@.str.1 = [3 x i8] c"On\00"
@.str.2 = [8 x i8] c"Dimming\00"
@.str.3 = [8 x i8] c"Unknown\00"
define i8* @ConvertPUState(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"Off\00"
@.str.1 = [3 x i8] c"On\00"
@.str.2 = [8 x i8] c"Dimming\00"
@.str.3 = [8 x i8] c"Unknown\00"
@reltable.ConvertPUState = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.ConvertPUState to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.ConvertPUState to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.ConvertPUState to i64)) to i32)]
define i8* @ConvertPUState(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -1
%4 = icmp ult i32 %3, 3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.ConvertPUState to i8*), i64 %7)
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %8, %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  for (int i = 0; i < 10; i++) {
    printf("#\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"#\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [2 x i8] c"#\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned int pack_to_align(unsigned int, unsigned int);
void align_sz(unsigned *psz, unsigned align) {
  if (align > *psz)
    *psz = pack_to_align(*psz, align);
}


x86 assembly (clang, -O0):
<align_sz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jbe    1144 <align_sz+0x34>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <pack_to_align@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_sz>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
cmp    %esi,%edi
jae    1121 <align_sz+0x11>
call   1030 <pack_to_align@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @align_sz(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 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = icmp ugt i32 %5, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32, i32* %4
%13 = call i32 @pack_to_align(i32 %11, i32 %12)
%14 = load i32*, i32** %3
store i32 %13, i32* %14
br label %15
15: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @align_sz(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp ult i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @pack_to_align(i32 %3, i32 %1)
store i32 %6, i32* %0
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gfx_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<gfx_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @gfx_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear(int *);
int /*<<< orphan*/ set(int *, int);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b, c;
  a = 0;
  b = 1;
  c = 3;
  a = b + c;
  b = 3;
  c = 5;
  clear(&a);
  set(&a, 11);
  clear(&a);
  set(&a, 12);
  clear(&a);
  set(&a, 13);
  test_assert(a == 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <clear@plt>
lea    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1050 <set@plt>
lea    -0x8(%rbp),%rdi
call   1040 <clear@plt>
lea    -0x8(%rbp),%rdi
mov    $0xc,%esi
call   1050 <set@plt>
lea    -0x8(%rbp),%rdi
call   1040 <clear@plt>
lea    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1050 <set@plt>
cmpl   $0xd,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <clear@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1050 <set@plt>
mov    %rbx,%rdi
call   1040 <clear@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1050 <set@plt>
mov    %rbx,%rdi
call   1040 <clear@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1050 <set@plt>
xor    %edi,%edi
cmpl   $0xd,0xc(%rsp)
sete   %dil
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 3, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%8 = call i32 @clear(i32* %2)
%9 = call i32 @set(i32* %2, i32 11)
%10 = call i32 @clear(i32* %2)
%11 = call i32 @set(i32* %2, i32 12)
%12 = call i32 @clear(i32* %2)
%13 = call i32 @set(i32* %2, i32 13)
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 13
%16 = zext i1 %15 to i32
%17 = call i32 @test_assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = call i32 @clear(i32* %1)
%4 = call i32 @set(i32* %1, i32 11)
%5 = call i32 @clear(i32* %1)
%6 = call i32 @set(i32* %1, i32 12)
%7 = call i32 @clear(i32* %1)
%8 = call i32 @set(i32* %1, i32 13)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 13
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}
/* Type definitions */
struct switchtec_ioctl_pff_port {
  int dummy;
};
struct switchtec_ioctl_flash_part_info {
  int dummy;
};
struct switchtec_ioctl_flash_info {
  int dummy;
};
struct switchtec_ioctl_event_summary {
  int dummy;
};
struct switchtec_ioctl_event_ctl {
  int dummy;
};

/* Variables and functions */
void main(void) {
  struct switchtec_ioctl_flash_info flash_info;
  struct switchtec_ioctl_flash_part_info flash_part_info;
  struct switchtec_ioctl_event_summary event_summary;
  struct switchtec_ioctl_event_ctl event_ctl;
  struct switchtec_ioctl_pff_port pff_port;
}


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

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

LLVM IR (-O0):
%struct.switchtec_ioctl_flash_info = type { i32 }
%struct.switchtec_ioctl_flash_part_info = type { i32 }
%struct.switchtec_ioctl_event_summary = type { i32 }
%struct.switchtec_ioctl_event_ctl = type { i32 }
%struct.switchtec_ioctl_pff_port = type { i32 }
define void @main() {
%1 = alloca %struct.switchtec_ioctl_flash_info
%2 = alloca %struct.switchtec_ioctl_flash_part_info
%3 = alloca %struct.switchtec_ioctl_event_summary
%4 = alloca %struct.switchtec_ioctl_event_ctl
%5 = alloca %struct.switchtec_ioctl_pff_port
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
double log(double);
double tosReal_ln(double x) { return log(x); }


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

x86 assembly (clang, -O2):
<tosReal_ln>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @tosReal_ln(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
/* Type definitions */
struct stack_st_OPENSSL_STRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_value(int /*<<< orphan*/ const *, int);
char *sk_OPENSSL_STRING_value(const struct stack_st_OPENSSL_STRING *sk,
                              int idx) {
  return (char *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_STRING_value>:
jmp    1030 <OPENSSL_sk_value@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i8* @sk_OPENSSL_STRING_value(%struct.stack_st_OPENSSL_STRING* %0, i32 %1) {
%3 = alloca %struct.stack_st_OPENSSL_STRING*
%4 = alloca i32
store %struct.stack_st_OPENSSL_STRING* %0, %struct.stack_st_OPENSSL_STRING** %3
store i32 %1, i32* %4
%5 = load %struct.stack_st_OPENSSL_STRING*, %struct.stack_st_OPENSSL_STRING** %3
%6 = bitcast %struct.stack_st_OPENSSL_STRING* %5 to i32*
%7 = load i32, i32* %4
%8 = call i64 @OPENSSL_sk_value(i32* %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_STRING = type { i32 }
define i8* @sk_OPENSSL_STRING_value(%struct.stack_st_OPENSSL_STRING* %0, i32 %1) {
%3 = getelementptr %struct.stack_st_OPENSSL_STRING, %struct.stack_st_OPENSSL_STRING* %0, i64 0, i32 0
%4 = tail call i64 @OPENSSL_sk_value(i32* %3, i32 %1)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ critical();
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void *other(void *x) {
  pthread_mutex_t *mutex = (pthread_mutex_t *)x;
  pthread_mutex_lock(mutex);
  critical();
  pthread_mutex_unlock(mutex);
  return NULL;
}


x86 assembly (clang, -O0):
<other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    $0x0,%al
call   1030 <critical@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<other>:
push   %rbx
mov    %rdi,%rbx
call   1050 <pthread_mutex_lock@plt>
xor    %eax,%eax
call   1030 <critical@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @other(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @pthread_mutex_lock(i32* %6)
%8 = call i32 (...) @critical()
%9 = load i32*, i32** %3
%10 = call i32 @pthread_mutex_unlock(i32* %9)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @other(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_lock(i32* %2)
%4 = tail call i32 (...) @critical()
%5 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret i8* null
}
/* Variables and functions */
int sqrt(int);
double LSKeyframeAnimationFunctionEaseInCirc(double t, double b, double c,
                                             double d) {
  return -c * (sqrt(1 - (t /= d) * t) - 1) + b;
}


x86 assembly (clang, -O0):
<LSKeyframeAnimationFunctionEaseInCirc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe78(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  -0x28(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSKeyframeAnimationFunctionEaseInCirc>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm0
movsd  0xed0(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @LSKeyframeAnimationFunctionEaseInCirc(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = fneg double %9
%11 = load double, double* %8
%12 = load double, double* %5
%13 = fdiv double %12, %11
store double %13, double* %5
%14 = load double, double* %5
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double 1.000000e+00)
%17 = fptosi double %16 to i32
%18 = call i32 @sqrt(i32 %17)
%19 = sub nsw i32 %18, 1
%20 = sitofp i32 %19 to double
%21 = load double, double* %6
%22 = call double @llvm.fmuladd.f64(double %10, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @LSKeyframeAnimationFunctionEaseInCirc(double %0, double %1, double %2, double %3) {
%5 = fneg double %2
%6 = fdiv double %0, %3
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
%9 = fptosi double %8 to i32
%10 = tail call i32 @sqrt(i32 %9)
%11 = add nsw i32 %10, -1
%12 = sitofp i32 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %5, double %12, double %1)
ret double %13
}
int test_imm_07int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x07 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_07int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_07int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 458752
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *, int *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[], char *envp[]) {
  int nsecs;
  if (argc == 1) {
    return 0;
  }
  atoi(argv[1], &nsecs, 10);
  sleep(nsecs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1150 <main+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1175 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0xa,%edx
call   1030 <atoi@plt>
mov    -0x1c(%rbp),%edi
call   1040 <sleep@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
je     1146 <main+0x26>
push   %rax
mov    0x8(%rsi),%rdi
lea    0x4(%rsp),%rsi
mov    $0xa,%edx
call   1030 <atoi@plt>
mov    0x4(%rsp),%edi
call   1040 <sleep@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp eq i32 %0, 1
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9, i32* %4, i32 10)
%11 = load i32, i32* %4
%12 = call i32 @sleep(i32 %11)
br label %13
13: ; preds = %3, %7
ret i32 0
}
/* Variables and functions */
scalar_t__ __fabs(double);
long double __fabsl(long double x) { return ((long double)__fabs((double)x)); }


x86 assembly (clang, -O0):
<__fabsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <__fabs@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fabsl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <__fabs@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__fabsl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @__fabs(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @__fabsl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @__fabs(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
void ble_rsp_hardware_spi_config(
    const struct ble_msg_hardware_spi_config_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_hardware_spi_config_rsp_t = type opaque
define void @ble_rsp_hardware_spi_config(%struct.ble_msg_hardware_spi_config_rsp_t* %0) {
%2 = alloca %struct.ble_msg_hardware_spi_config_rsp_t*
store %struct.ble_msg_hardware_spi_config_rsp_t* %0, %struct.ble_msg_hardware_spi_config_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_hardware_spi_config_rsp_t = type opaque
define void @ble_rsp_hardware_spi_config(%struct.ble_msg_hardware_spi_config_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ registerSigWinChCatcher();
int /*<<< orphan*/ updateConsoleSize();
void setOutput() {
  registerSigWinChCatcher();
  updateConsoleSize();
}


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

x86 assembly (clang, -O2):
<setOutput>:
push   %rax
xor    %eax,%eax
call   1030 <registerSigWinChCatcher@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <updateConsoleSize@plt>

LLVM IR (-O0):
define void @setOutput() {
%1 = call i32 (...) @registerSigWinChCatcher()
%2 = call i32 (...) @updateConsoleSize()
ret void
}

LLVM IR (-O2):
define void @setOutput() {
%1 = tail call i32 (...) @registerSigWinChCatcher()
%2 = tail call i32 (...) @updateConsoleSize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int i;
  for (i = 0; i < 10; i++)
    printf("Hello, world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
char callocZeroesGood() {
  char *buf = calloc(2, 2);
  char result = buf[3];
  if (buf[1] == 0) {
    free(buf);
  }
  return result;
}


x86 assembly (clang, -O0):
<callocZeroesGood>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%esi
mov    %esi,%edi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    115c <callocZeroesGood+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callocZeroesGood>:
push   %rax
mov    $0x2,%edi
mov    $0x2,%esi
call   1040 <calloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @callocZeroesGood() {
%1 = tail call dereferenceable_or_null(4) i8* @calloc(i32 2, i32 2)
%2 = tail call i32 @free(i8* %1)
ret i8 0
}
/* Variables and functions */
char *GlobalEntity_GetIndex(char const *);
int GlobalEntity_GetCounter(const char *pGlobalName) {
  return GlobalEntity_GetCounter(GlobalEntity_GetIndex(pGlobalName));
}


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

x86 assembly (clang, -O2):
<GlobalEntity_GetCounter>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <GlobalEntity_GetIndex@plt>
mov    %rax,%rdi
jmp    1120 <GlobalEntity_GetCounter+0x10>

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

LLVM IR (-O2):
define i32 @GlobalEntity_GetCounter(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = tail call i8* @GlobalEntity_GetIndex(i8* %3)
br label %2
}
int ft_nbrlen(int n) {
  int x;
  while (n / 10) {
    n /= 10;
    x++;
  }
  return (x + 1);
}


x86 assembly (clang, -O0):
<ft_nbrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1137 <ft_nbrlen+0x37>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1107 <ft_nbrlen+0x7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrlen>:
lea    0x9(%rdi),%ecx
cmp    $0x13,%ecx
jb     1135 <ft_nbrlen+0x35>
nopl   0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <ft_nbrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_nbrlen(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ undef, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ undef, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *pname) {
  printf("Usage: %s [-V[n]] file.ys\n", pname);
  printf("   -V[n]  Generate memory initialization in Verilog format (n-way "
         "blocking)\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s [-V[n]] file.ys\0A\00"
@.str.1 = [77 x i8] c" -V[n] Generate memory initialization in Verilog format (n-way blocking)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s [-V[n]] file.ys\0A\00"
@str = [76 x i8] c" -V[n] Generate memory initialization in Verilog format (n-way blocking)\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: cp src target\n"
                  "       cp src1 ... srcN directory\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"usage: cp src target\0A cp src1 ... srcN directory\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"usage: cp src target\0A cp src1 ... srcN directory\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int getLength(int *list) {
  int i = 2;
  while (list[i])
    i++;
  return i - 2;
}


x86 assembly (clang, -O0):
<getLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     112f <getLength+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getLength+0xf>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLength>:
add    $0x8,%rdi
mov    $0xffffffff,%eax
nopl   0x0(%rax)
add    $0x1,%eax
cmpl   $0x0,(%rdi)
lea    0x4(%rdi),%rdi
jne    1110 <getLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @getLength(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 2, %1 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nsw i32 %9, -2
ret i32 %10
}
/* Variables and functions */
float sqrt(float);
float hypot(float a, float b, float c) { return sqrt(a * a + b * b + c * c); }


x86 assembly (clang, -O0):
<hypot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypot>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jb     1134 <hypot+0x24>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
ret
movaps %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @hypot(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = load float, float* %6
%14 = load float, float* %6
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
%16 = call float @sqrt(float %15)
ret float %16
}

LLVM IR (-O2):
define float @hypot(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call float @sqrt(float %6)
ret float %7
}
/* Variables and functions */
int getch();
int hudMenuFinish() { return getch(); }


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

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

LLVM IR (-O0):
define i32 @hudMenuFinish() {
%1 = call i32 (...) @getch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @hudMenuFinish() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
void gensc() {}


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

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

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

LLVM IR (-O2):
define void @gensc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
void vectorAverageFreeVectorArray(float *averageArray) { free(averageArray); }


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

x86 assembly (clang, -O2):
<vectorAverageFreeVectorArray>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @vectorAverageFreeVectorArray(float* nocapture %0) {
%2 = tail call i32 @free(float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Barrier2();
int /*<<< orphan*/ __VERIFIER_error();
void *thr1(void *arg) {
  Barrier2();
  {
    if (!(0)) {
    ERROR:
      __VERIFIER_error();
      (void)0;
    }
  };
  return 0;
}


x86 assembly (clang, -O0):
<thr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Barrier2@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr1>:
push   %rax
xor    %eax,%eax
call   1030 <Barrier2@plt>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thr1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @Barrier2()
br label %4
4: ; preds = %1
%5 = call i32 (...) @__VERIFIER_error()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thr1(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @Barrier2()
%3 = tail call i32 (...) @__VERIFIER_error()
ret i8* null
}
int fib(int a) {
  if (a == 1 || a == 2)
    return 1;
  else
    return fib(a - 1) + fib(a - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     112f <fib+0x1f>
cmpl   $0x2,-0x8(%rbp)
jne    113b <fib+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    115e <fib+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1144 <fib+0x34>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <fib@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fib+0x20>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @fib(i32 %5)
%9 = add nsw i32 %6, -2
%10 = add nsw i32 %8, %7
%11 = add i32 %6, -3
%12 = icmp ult i32 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i32 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 1, %1 ], [ %14, %13 ]
ret i32 %16
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void wm16(uint8_t a[2], uint16_t x) {
  a[0] = x >> 8;
  a[1] = x >> 0;
}


x86 assembly (clang, -O0):
<wm16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wm16>:
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,(%rdi)
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @wm16(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 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = ashr i32 %9, 0
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @wm16(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %4
ret void
}
int I_NoAppServicesLobbyUserIsOwner(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @I_NoAppServicesLobbyUserIsOwner() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void help(void) {
  puts("usage: [Port No.]");
  exit(1);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"usage: [Port No.]\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"usage: [Port No.]\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int mkstemp(char *const);
int /*<<< orphan*/ mkstempx(int /*<<< orphan*/ *);
int mkstemp2(char *const filenameBuffer) {
  if (0)
    mkstempx(NULL);
  return mkstemp(filenameBuffer);
}


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

x86 assembly (clang, -O2):
<mkstemp2>:
jmp    1030 <mkstemp@plt>

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

LLVM IR (-O2):
define i32 @mkstemp2(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
ret i32 %2
}