xunge/DecIR huggingface dataset:
extern int gui_ksys_get_window_mouse_coordinates(void) {
  int value;
  __asm__ __volatile__("int $0x40" : "=a"(value) : "a"(37), "b"(1));
  return (value);
}


x86 assembly (clang, -O0):
<gui_ksys_get_window_mouse_coordinates>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
mov    $0x1,%ebx
int    $0x40
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_get_window_mouse_coordinates>:
push   %rbx
mov    $0x25,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gui_ksys_get_window_mouse_coordinates() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gui_ksys_get_window_mouse_coordinates() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ degrees_to_dms_pr(char *, double, int);
void degrees_to_dms(char *lb, double deg) { degrees_to_dms_pr(lb, deg, 2); }


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

x86 assembly (clang, -O2):
<degrees_to_dms>:
mov    $0x2,%esi
jmp    1030 <degrees_to_dms_pr@plt>

LLVM IR (-O0):
define void @degrees_to_dms(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = load double, double* %4
%7 = call i32 @degrees_to_dms_pr(i8* %5, double %6, i32 2)
ret void
}

LLVM IR (-O2):
define void @degrees_to_dms(i8* %0, double %1) {
%3 = tail call i32 @degrees_to_dms_pr(i8* %0, double %1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void to_binary(int n) {
  int r;
  r = n % 2;
  if (n >= 2) {
    to_binary(n / 2);
  }
  putchar('0' + r);
  return;
}


x86 assembly (clang, -O0):
<to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     1155 <to_binary+0x35>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <to_binary@plt>
mov    -0x8(%rbp),%edi
add    $0x30,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_binary>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1131 <to_binary+0x11>
mov    %ebx,%edi
shr    %edi
call   1040 <to_binary@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
and    $0xfffffffe,%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x30,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @to_binary(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 1
tail call void @to_binary(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = srem i32 %0, 2
%7 = add nsw i32 %6, 48
%8 = tail call i32 @putchar(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void testBitWiseNot(int A, int B, int C, int D) {
  printf("Bitwise Not: %d %d %d %d\n", ~A, ~B, ~C, ~D);
}


x86 assembly (clang, -O0):
<testBitWiseNot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
mov    -0x10(%rbp),%r8d
xor    $0xffffffff,%r8d
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBitWiseNot>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
not    %esi
not    %edx
not    %ecx
not    %r8d
lea    0xed7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Bitwise Not: %d %d %d %d\0A\00"
define void @testBitWiseNot(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = xor i32 %9, -1
%11 = load i32, i32* %6
%12 = xor i32 %11, -1
%13 = load i32, i32* %7
%14 = xor i32 %13, -1
%15 = load i32, i32* %8
%16 = xor i32 %15, -1
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12, i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Bitwise Not: %d %d %d %d\0A\00"
define void @testBitWiseNot(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = xor i32 %0, -1
%6 = xor i32 %1, -1
%7 = xor i32 %2, -1
%8 = xor i32 %3, -1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7, i32 %8)
ret void
}
int add(int n, int m) { return n + m; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ hash_searchs(int, char *, int /*<<< orphan*/ **);
void search(int module_model_type, char *index_file_name, wchar_t **querys) {
  if (module_model_type <= 2) {
    hash_searchs(module_model_type, index_file_name, querys);
  } else if (module_model_type == 3) {
  }
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x2,-0x4(%rbp)
jg     1142 <search+0x32>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <hash_searchs@plt>
jmp    1156 <search+0x46>
cmpl   $0x3,-0x4(%rbp)
jne    1151 <search+0x41>
jmp    1151 <search+0x41>
jmp    1156 <search+0x46>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
cmp    $0x2,%edi
jg     111a <search+0xa>
jmp    1030 <hash_searchs@plt>
ret

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

LLVM IR (-O2):
define void @search(i32 %0, i8* %1, i32** %2) {
%4 = icmp slt i32 %0, 3
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @hash_searchs(i32 %0, i8* %1, i32** %2)
br label %7
7: ; preds = %3, %5
ret void
}
int CG_GetSelectedWeapon(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CG_GetSelectedWeapon() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ai_simple_heuristic_free(void *context) { free(context); }


x86 assembly (clang, -O0):
<ai_simple_heuristic_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):
<ai_simple_heuristic_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ai_simple_heuristic_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 @ai_simple_heuristic_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
double round(double d) {
  double ret = d - (long)d;
  if (ret >= 0.5)
    return (long)(d + 0.5);
  if (ret <= -0.5)
    return (long)(d - 0.5);
  return (long)d;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     115a <round+0x5a>
movsd  0xebf(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a2 <round+0xa2>
movsd  0xea6(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1192 <round+0x92>
movsd  -0x10(%rbp),%xmm0
movsd  0xe86(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a2 <round+0xa2>
cvttsd2si -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
ucomisd 0xee6(%rip),%xmm2
jae    1134 <round+0x34>
movsd  0xee4(%rip),%xmm3
ucomisd %xmm2,%xmm3
jb     1149 <round+0x49>
addsd  0xed6(%rip),%xmm0
jmp    113c <round+0x3c>
addsd  0xec4(%rip),%xmm0
cvttsd2si %xmm0,%rax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fptosi double %6 to i64
%8 = sitofp i64 %7 to double
%9 = fsub double %5, %8
store double %9, double* %4
%10 = load double, double* %4
%11 = fcmp oge double %10, 5.000000e-01
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load double, double* %3
%14 = fadd double %13, 5.000000e-01
%15 = fptosi double %14 to i64
%16 = sitofp i64 %15 to double
store double %16, double* %2
br label %29
17: ; preds = %1
%18 = load double, double* %4
%19 = fcmp ole double %18, -5.000000e-01
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load double, double* %3
%22 = fsub double %21, 5.000000e-01
%23 = fptosi double %22 to i64
%24 = sitofp i64 %23 to double
store double %24, double* %2
br label %29
25: ; preds = %17
%26 = load double, double* %3
%27 = fptosi double %26 to i64
%28 = sitofp i64 %27 to double
store double %28, double* %2
br label %29
29: ; preds = %25, %20, %12
%30 = load double, double* %2
ret double %30
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp ult double %4, 5.000000e-01
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = fadd double %0, 5.000000e-01
%8 = fptosi double %7 to i64
%9 = sitofp i64 %8 to double
br label %16
10: ; preds = %1
%11 = fcmp ugt double %4, -5.000000e-01
br i1 %11, label %16, label %12
12: ; preds = %10
%13 = fadd double %0, -5.000000e-01
%14 = fptosi double %13 to i64
%15 = sitofp i64 %14 to double
br label %16
16: ; preds = %10, %12, %6
%17 = phi double [ %9, %6 ], [ %15, %12 ], [ %3, %10 ]
ret double %17
}
/* Variables and functions */
int just_check_status(unsigned char *);
int op_nonce_recv(unsigned char *packet) { return just_check_status(packet); }


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

x86 assembly (clang, -O2):
<op_nonce_recv>:
jmp    1030 <just_check_status@plt>

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

LLVM IR (-O2):
define i32 @op_nonce_recv(i8* %0) {
%2 = tail call i32 @just_check_status(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_ALRM(int /*<<< orphan*/);
int gen_ALRM(void) {
  handle_ALRM(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_ALRM>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_ALRM@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_ALRM>:
push   %rax
xor    %edi,%edi
call   1030 <handle_ALRM@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_ALRM() {
%1 = call i32 @handle_ALRM(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_ALRM() {
%1 = tail call i32 @handle_ALRM(i32 0)
ret i32 0
}
/* Variables and functions */
float floorf(float);
__attribute__((__weak__, __always___)) float softboundmpx_floorf(float x) {
  return floorf(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_floorf>:
jmp    1030 <floorf@plt>

LLVM IR (-O0):
define weak float @softboundmpx_floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.floor.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define weak float @softboundmpx_floorf(float %0) {
%2 = tail call float @llvm.floor.f32(float %0)
ret float %2
}
/* Variables and functions */
int CMSG_SPACE(int);
int inet6_option_space(int nbytes) {
  nbytes += 2;
  return (CMSG_SPACE((nbytes + 7) & ~7));
}


x86 assembly (clang, -O0):
<inet6_option_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x7,%edi
and    $0xfffffff8,%edi
call   1030 <CMSG_SPACE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_option_space>:
add    $0x9,%edi
and    $0xfffffff8,%edi
jmp    1030 <CMSG_SPACE@plt>

LLVM IR (-O0):
define i32 @inet6_option_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 7
%7 = and i32 %6, -8
%8 = call i32 @CMSG_SPACE(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @inet6_option_space(i32 %0) {
%2 = add nsw i32 %0, 9
%3 = and i32 %2, -8
%4 = tail call i32 @CMSG_SPACE(i32 %3)
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
int strlencmp(const void *a, const void *b) {
  char **x = (char **)a;
  char **y = (char **)b;
  int lena = strlen(*x);
  int lenb = strlen(*y);
  if (lena > lenb)
    return 1;
  return lena == lenb ? 0 : -1;
}


x86 assembly (clang, -O0):
<strlencmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jle    1166 <strlencmp+0x56>
movl   $0x1,-0x4(%rbp)
jmp    117b <strlencmp+0x6b>
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlencmp>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rdi),%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    (%rbx),%rdi
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
setne  %cl
neg    %ecx
cmp    %eax,%ebp
mov    $0x1,%eax
cmovle %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strlencmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
store i8** %11, i8*** %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i8**
store i8** %13, i8*** %7
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %8
%17 = load i8**, i8*** %7
%18 = load i8*, i8** %17
%19 = call i32 @strlen(i8* %18)
store i32 %19, i32* %9
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %2
store i32 1, i32* %3
br label %30
24: ; preds = %2
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = icmp eq i32 %25, %26
%28 = zext i1 %27 to i64
%29 = select i1 %27, i32 0, i32 -1
store i32 %29, i32* %3
br label %30
30: ; preds = %24, %23
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @strlencmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = tail call i32 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = tail call i32 @strlen(i8* %7)
%9 = icmp sgt i32 %6, %8
%10 = icmp ne i32 %6, %8
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
/* Variables and functions */
long strtol(char const *, int /*<<< orphan*/ *, int);
long atol(const char *string) { return strtol(string, NULL, 10); }


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

x86 assembly (clang, -O2):
<atol>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @atol(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: muted [-f] [-d]\n"
         "        -f : Do not fork\n"
         "        -d : Debug (implies -f)\n");
}


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

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

LLVM IR (-O0):
@.str = [81 x i8] c"Usage: muted [-f] [-d]\0A -f : Do not fork\0A -d : Debug (implies -f)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [80 x i8] c"Usage: muted [-f] [-d]\0A -f : Do not fork\0A -d : Debug (implies -f)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
ret void
}
void measured_loop(unsigned int n, volatile int *var) {
  int k;
  for (k = 0; k < n; k++) {
    (*var) = 1;
  }
}


x86 assembly (clang, -O0):
<measured_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1136 <measured_loop+0x36>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <measured_loop+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<measured_loop>:
test   %edi,%edi
je     116b <measured_loop+0x6b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jb     1155 <measured_loop+0x55>
and    $0xfffffff8,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x1,(%rsi)
movl   $0x1,(%rsi)
movl   $0x1,(%rsi)
movl   $0x1,(%rsi)
movl   $0x1,(%rsi)
movl   $0x1,(%rsi)
movl   $0x1,(%rsi)
movl   $0x1,(%rsi)
add    $0xfffffff8,%edi
jne    1120 <measured_loop+0x20>
test   %eax,%eax
je     116b <measured_loop+0x6b>
nopl   0x0(%rax)
movl   $0x1,(%rsi)
add    $0xffffffff,%eax
jne    1160 <measured_loop+0x60>
ret

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

LLVM IR (-O2):
define void @measured_loop(i32 %0, i32* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %20, label %4
4: ; preds = %2
%5 = add i32 %0, -1
%6 = and i32 %0, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %14, label %8
8: ; preds = %4
%9 = and i32 %0, -8
br label %10
10: ; preds = %10, %8
%11 = phi i32 [ 0, %8 ], [ %12, %10 ]
store volatile i32 1, i32* %1
store volatile i32 1, i32* %1
store volatile i32 1, i32* %1
store volatile i32 1, i32* %1
store volatile i32 1, i32* %1
store volatile i32 1, i32* %1
store volatile i32 1, i32* %1
store volatile i32 1, i32* %1
%12 = add i32 %11, 8
%13 = icmp eq i32 %12, %9
br i1 %13, label %14, label %10
14: ; preds = %10, %4
%15 = icmp eq i32 %6, 0
br i1 %15, label %20, label %16
16: ; preds = %14, %16
%17 = phi i32 [ %18, %16 ], [ 0, %14 ]
store volatile i32 1, i32* %1
%18 = add i32 %17, 1
%19 = icmp eq i32 %18, %6
br i1 %19, label %20, label %16
20: ; preds = %14, %16, %2
ret void
}
int bin_hex_conv(hex, counter) {
  int binary = 0b0;
  int bin_conv = binary | hex;
  op_code_det(bin_conv, counter);
  return 0;
}


x86 assembly (clang, -O0):
<bin_hex_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <op_code_det@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_hex_conv>:
push   %rax
xor    %eax,%eax
call   1030 <op_code_det@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bin_hex_conv(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = or i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @op_code_det to i32 (i32, i32, ...)*)(i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @bin_hex_conv(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @op_code_det to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret i32 0
}
/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf("Signal %d reçu\n", sig);
  if (sig == SIGCHLD) {
    int retour;
    waitpid(-1, &retour, 0);
  }
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%eax
jne    115c <traitement_signal+0x3c>
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
cmp    %ebx,(%rax)
jne    1151 <traitement_signal+0x31>
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
xor    %edx,%edx
call   1040 <waitpid@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@SIGCHLD = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = load i32, i32* @SIGCHLD
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @waitpid(i32 -1, i32* %3, i32 0)
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@SIGCHLD = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @SIGCHLD
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = bitcast i32* %2 to i8*
%8 = call i32 @waitpid(i32 -1, i32* %2, i32 0)
br label %9
9: ; preds = %6, %1
ret void
}
void outb(unsigned short port, unsigned char data) {
  __asm __volatile("outb %0, %w1" : : "a"(data), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $0, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glRectiv(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void Rectiv(GLint v1[2], GLint v2[2]) { glRectiv(v1, v2); }


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

x86 assembly (clang, -O2):
<Rectiv>:
jmp    1030 <glRectiv@plt>

LLVM IR (-O0):
define void @Rectiv(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 = call i32 @glRectiv(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @Rectiv(i32* %0, i32* %1) {
%3 = tail call i32 @glRectiv(i32* %0, i32* %1)
ret void
}
void printmin(int a, int b) {
  (void)a;
  (void)b;
}


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

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

LLVM IR (-O0):
define void @printmin(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
ret void
}

LLVM IR (-O2):
define void @printmin(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int nvidia_mcp_gpio_set(int, int);
int nvidia_mcp_gpio5_raise(void) { return nvidia_mcp_gpio_set(0x05, 1); }


x86 assembly (clang, -O0):
<nvidia_mcp_gpio5_raise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x1,%esi
call   1030 <nvidia_mcp_gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvidia_mcp_gpio5_raise>:
mov    $0x5,%edi
mov    $0x1,%esi
jmp    1030 <nvidia_mcp_gpio_set@plt>

LLVM IR (-O0):
define i32 @nvidia_mcp_gpio5_raise() {
%1 = call i32 @nvidia_mcp_gpio_set(i32 5, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nvidia_mcp_gpio5_raise() {
%1 = tail call i32 @nvidia_mcp_gpio_set(i32 5, i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ gl2psEndPostScriptLine();
void gl2psPrintPostScriptFinalPrimitive(void) { gl2psEndPostScriptLine(); }


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

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

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

LLVM IR (-O2):
define void @gl2psPrintPostScriptFinalPrimitive() {
%1 = tail call i32 (...) @gl2psEndPostScriptLine()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int ssize_t;

/* Variables and functions */
int __syscall(int /*<<< orphan*/, int, int /*<<< orphan*/, size_t,
              int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int errno;
ssize_t read(int fd, void *buf, size_t count) {
  int ret = __syscall(0, fd, (uint64_t)buf, count, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <__syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    116c <read+0x5c>
xor    %ecx,%ecx
sub    -0x1c(%rbp),%ecx
mov    0x2e82(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <read+0x62>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
xor    %edi,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <__syscall@plt>
test   %eax,%eax
js     1133 <read+0x23>
pop    %rcx
ret
neg    %eax
mov    0x2ea4(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i32
%12 = load i64, i64* %7
%13 = call i32 @__syscall(i32 0, i32 %9, i32 %11, i64 %12, i32 0, i32 0, i32 0)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i32, i32* %8
%18 = sub nsw i32 0, %17
store i32 %18, i32* @errno
store i32 -1, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* %8
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @__syscall(i32 0, i32 %0, i32 %5, i64 %2, i32 0, i32 0, i32 0)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sub nsw i32 0, %6
store i32 %9, i32* @errno
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ -1, %8 ], [ %6, %3 ]
ret i32 %11
}
void main_clock() {
  do {
  } while (!(*(volatile unsigned long *)((void *)0xfffffc00 + 0x68) & 0x01));
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x30) =
      0x01 | (((0) & 7) << 2);
}


x86 assembly (clang, -O0):
<main_clock>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <main_clock+0x9>
jmp    110e <main_clock+0xe>
mov    $0xfffffc00,%eax
mov    0x68(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1109 <main_clock+0x9>
mov    $0xfffffc00,%eax
movq   $0x1,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_clock>:
mov    $0xfffffc30,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,0x38(%rax)
je     1110 <main_clock+0x10>
movq   $0x1,(%rax)
ret

LLVM IR (-O0):
define void @main_clock() {
br label %1
1: ; preds = %2, %0
br label %2
2: ; preds = %1
%3 = load volatile i64, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 104) to i64*)
%4 = and i64 %3, 1
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %1, label %7
7: ; preds = %2
store volatile i64 1, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 48) to i64*)
ret void
}

LLVM IR (-O2):
define void @main_clock() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 4294966376 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
store volatile i64 1, i64* inttoptr (i64 4294966320 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_lock_t;

/* Variables and functions */
void omp_destroy_lock(omp_lock_t *lock) {}


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

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

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

LLVM IR (-O2):
define void @omp_destroy_lock(i32* nocapture %0) {
ret void
}
void test_25_1(short *mem) { __atomic_sub_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_25_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movw   $0x1,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    %ax,%cx
neg    %eax
lock xadd %ax,(%rdx)
sub    %cx,%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_25_1>:
lock subw $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_25_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw sub i16* %5, i16 %6 acq_rel
%8 = sub i16 %7, %6
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test_25_1(i16* nocapture %0) {
%2 = atomicrmw sub i16* %0, i16 1 acq_rel
ret void
}
/* Variables and functions */
char *concat(char const *, char *, char *);
char *HTMLGenSpan(const char *innerHTML) {
  return concat(innerHTML, "<span>", "</span>");
}


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

x86 assembly (clang, -O2):
<HTMLGenSpan>:
lea    0xee9(%rip),%rsi
lea    0xee9(%rip),%rdx
jmp    1030 <concat@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"<span>\00"
@.str.1 = [8 x i8] c"</span>\00"
define i8* @HTMLGenSpan(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @concat(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"<span>\00"
@.str.1 = [8 x i8] c"</span>\00"
define i8* @HTMLGenSpan(i8* %0) {
%2 = tail call i8* @concat(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __be32_to_cpu(uint32_t val) {
  uint32_t c1, c2, c3, c4;
  c1 = (val >> 24) & 0xff;
  c2 = (val >> 16) & 0xff;
  c3 = (val >> 8) & 0xff;
  c4 = val & 0xff;
  return c1 | c2 << 8 | c3 << 16 | c4 << 24;
}


x86 assembly (clang, -O0):
<__be32_to_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__be32_to_cpu>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @__be32_to_cpu(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 24
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = and i32 %16, 255
store i32 %17, i32* %6
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = shl i32 %19, 8
%21 = or i32 %18, %20
%22 = load i32, i32* %5
%23 = shl i32 %22, 16
%24 = or i32 %21, %23
%25 = load i32, i32* %6
%26 = shl i32 %25, 24
%27 = or i32 %24, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @__be32_to_cpu(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void hexdump_addr(unsigned long base) { printf("%08lX: ", base); }


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

x86 assembly (clang, -O2):
<hexdump_addr>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%08lX: \00"
define void @hexdump_addr(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help(void) {
  puts(
      "Example usages:\n\nRunning a simulation:\n    lawn_dart -m 100 -d 42 -c "
      "0.8 -w 2 -M Estes_B6\n\nListing available motors (-l, --list_motors):\n "
      "   lawn_dart -l\n\nGetting this help (-h, --help):\n    lawn_dart -h\n");
}


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

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

LLVM IR (-O0):
@.str = [205 x i8] c"Example usages:\0A\0ARunning a simulation:\0A lawn_dart -m 100 -d 42 -c 0.8 -w 2 -M Estes_B6\0A\0AListing available motors (-l, --list_motors):\0A lawn_dart -l\0A\0AGetting this help (-h, --help):\0A lawn_dart -h\0A\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [205 x i8] c"Example usages:\0A\0ARunning a simulation:\0A lawn_dart -m 100 -d 42 -c 0.8 -w 2 -M Estes_B6\0A\0AListing available motors (-l, --list_motors):\0A lawn_dart -l\0A\0AGetting this help (-h, --help):\0A lawn_dart -h\0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _desaturateAmountSSE(unsigned int *, unsigned int,
                                        unsigned int, unsigned char);
int /*<<< orphan*/ _desaturateFullSSE(unsigned int *, unsigned int,
                                      unsigned int);
void _desaturateSSE(unsigned int *dst, unsigned int w, unsigned int h,
                    unsigned char amount) {
  if (amount == 255) {
    _desaturateFullSSE(dst, w, h);
  } else {
    _desaturateAmountSSE(dst, w, h, amount);
  }
}


x86 assembly (clang, -O0):
<_desaturateSSE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0xff,%eax
jne    115a <_desaturateSSE+0x3a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <_desaturateFullSSE@plt>
jmp    116d <_desaturateSSE+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movzbl -0x11(%rbp),%ecx
call   1040 <_desaturateAmountSSE@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_desaturateSSE>:
cmp    $0xff,%cl
je     112d <_desaturateSSE+0xd>
movzbl %cl,%ecx
jmp    1040 <_desaturateAmountSSE@plt>
jmp    1030 <_desaturateFullSSE@plt>

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

LLVM IR (-O2):
define void @_desaturateSSE(i32* %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = icmp eq i8 %3, -1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @_desaturateFullSSE(i32* %0, i32 %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @_desaturateAmountSSE(i32* %0, i32 %1, i32 %2, i8 zeroext %3)
br label %10
10: ; preds = %8, %6
ret void
}
/* Type definitions */
typedef scalar_t__ fexcept_t;

/* Variables and functions */
int fegetexceptflag(fexcept_t *flagp, int excepts) {
  if (excepts != 0)
    return -1;
  *flagp = 0;
  return 0;
}


x86 assembly (clang, -O0):
<fegetexceptflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1121 <fegetexceptflag+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1133 <fegetexceptflag+0x33>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetexceptflag>:
mov    $0xffffffff,%eax
test   %esi,%esi
je     110a <fegetexceptflag+0xa>
ret
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fegetexceptflag(i64* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %2
store i64 0, i64* %0
br label %5
5: ; preds = %2, %4
%6 = phi i32 [ 0, %4 ], [ -1, %2 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ error_and_exit();
int *malloc(int);
int *malloc_int_line(int dim1) {
  int *line;
  line = malloc(sizeof(int) * dim1);
  if (line == NULL)
    error_and_exit();
  return line;
}


x86 assembly (clang, -O0):
<malloc_int_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <malloc_int_line+0x30>
mov    $0x0,%al
call   1030 <error_and_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_int_line>:
push   %rbx
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1138 <malloc_int_line+0x18>
xor    %eax,%eax
call   1030 <error_and_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @malloc_int_line(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 4, %5
%7 = trunc i64 %6 to i32
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (...) @error_and_exit()
br label %13
13: ; preds = %11, %1
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
define noalias i32* @malloc_int_line(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @error_and_exit()
br label %7
7: ; preds = %5, %1
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ putpwent(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  putpwent(0, 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <putpwent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @putpwent(i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putpwent(i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *);
main() {
  echo("Doing stuff");
  echo("laying on bed");
  echo("Indent is OK");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <echo@plt>
lea    0xee5(%rip),%rdi
call   1030 <echo@plt>
lea    0xee7(%rip),%rdi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Doing stuff\00"
@.str.1 = [14 x i8] c"laying on bed\00"
@.str.2 = [13 x i8] c"Indent is OK\00"
define i32 @main() {
%1 = call i32 @echo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @echo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @echo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Doing stuff\00"
@.str.1 = [14 x i8] c"laying on bed\00"
@.str.2 = [13 x i8] c"Indent is OK\00"
define i32 @main() {
%1 = tail call i32 @echo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @echo(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @echo(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void *, int);
void call_memmove_nonnull(void *p, void *q, int sz) { memmove(p, q, sz); }


x86 assembly (clang, -O0):
<call_memmove_nonnull>:
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
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_memmove_nonnull>:
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @call_memmove_nonnull(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 = call i32 @memmove(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @call_memmove_nonnull(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i32 %2)
ret void
}