xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("请输入一个数字:");
  scanf("%d", &num);
  (num % 2 == 0) ? printf("偶数") : printf("奇数");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xed0(%rip),%rax
lea    0xed0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B0\E5\AD\97:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"\E5\81\B6\E6\95\B0\00"
@.str.3 = [7 x i8] c"\E5\A5\87\E6\95\B0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B0\E5\AD\97:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"\E5\81\B6\E6\95\B0\00"
@.str.3 = [7 x i8] c"\E5\A5\87\E6\95\B0\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", foo(5));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int libmesh_C_isnan_float(float a) {
  printf("libmesh_C_isnan_float is deprecated and should not be used!\n");
  return (a != a);
}


x86 assembly (clang, -O0):
<libmesh_C_isnan_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libmesh_C_isnan_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
movss  0x4(%rsp),%xmm0
ucomiss %xmm0,%xmm0
setp   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"libmesh_C_isnan_float is deprecated and should not be used!\0A\00"
define i32 @libmesh_C_isnan_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fcmp une float %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@str = [60 x i8] c"libmesh_C_isnan_float is deprecated and should not be used!\00"
define i32 @libmesh_C_isnan_float(float %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%3 = fcmp uno float %0, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void usage(FILE *out) {
  fprintf(out, "gpio-watch: usage: gpio-watch [-l logfile] [-s script_dir] [-e "
               "default_edge] [-dv] pin[:edge] [...]\n");
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [101 x i8] c"gpio-watch: usage: gpio-watch [-l logfile] [-s script_dir] [-e default_edge] [-dv] pin[:edge] [...]\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [101 x i8] c"gpio-watch: usage: gpio-watch [-l logfile] [-s script_dir] [-e default_edge] [-dv] pin[:edge] [...]\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0), i64 100, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int rom_present(char *);
int ega_standalone_available(void) {
  return rom_present(L"roms/video/ega/ibm_6277356_ega_card_u44_27128.bin");
}


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

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

LLVM IR (-O0):
@.str = [50 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 103, i32 97, i32 47, i32 105, i32 98, i32 109, i32 95, i32 54, i32 50, i32 55, i32 55, i32 51, i32 53, i32 54, i32 95, i32 101, i32 103, i32 97, i32 95, i32 99, i32 97, i32 114, i32 100, i32 95, i32 117, i32 52, i32 52, i32 95, i32 50, i32 55, i32 49, i32 50, i32 56, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @ega_standalone_available() {
%1 = call i32 @rom_present(i8* bitcast ([50 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [50 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 103, i32 97, i32 47, i32 105, i32 98, i32 109, i32 95, i32 54, i32 50, i32 55, i32 55, i32 51, i32 53, i32 54, i32 95, i32 101, i32 103, i32 97, i32 95, i32 99, i32 97, i32 114, i32 100, i32 95, i32 117, i32 52, i32 52, i32 95, i32 50, i32 55, i32 49, i32 50, i32 56, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @ega_standalone_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([50 x i32]* @.str to i8*))
ret i32 %1
}
int linear(int a[], int s, int e, int num) {
  if (s > e)
    return -1;
  if (a[s] == num)
    return s;
  else
    linear(a, s + 1, e, num);
}


x86 assembly (clang, -O0):
<linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    113d <linear+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <linear+0x61>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jne    115c <linear+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <linear+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <linear@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear>:
mov    $0xffffffff,%eax
cmp    %edx,%esi
jg     113a <linear+0x3a>
movslq %esi,%rax
add    $0x1,%edx
lea    (%rdi,%rax,4),%rdi
xor    %r8d,%r8d
mov    %esi,%eax
nopl   0x0(%rax,%rax,1)
cmp    %ecx,(%rdi)
je     1134 <linear+0x34>
add    $0x1,%eax
add    $0x4,%rdi
mov    $0x1,%r8b
cmp    %eax,%edx
jne    1120 <linear+0x20>
jmp    113a <linear+0x3a>
test   $0x1,%r8b
je     113a <linear+0x3a>
ret

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

LLVM IR (-O2):
define i32 @linear(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, %2
br i1 %5, label %25, label %6
6: ; preds = %4
%7 = sext i32 %1 to i64
%8 = add i32 %2, 1
br label %9
9: ; preds = %6, %16
%10 = phi i64 [ %7, %6 ], [ %17, %16 ]
%11 = phi i1 [ false, %6 ], [ true, %16 ]
%12 = phi i32 [ undef, %6 ], [ %18, %16 ]
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, %3
br i1 %15, label %21, label %16
16: ; preds = %9
%17 = add nsw i64 %10, 1
%18 = select i1 %11, i32 %12, i32 undef
%19 = trunc i64 %17 to i32
%20 = icmp eq i32 %8, %19
br i1 %20, label %23, label %9
21: ; preds = %9
%22 = trunc i64 %10 to i32
br i1 %11, label %23, label %25
23: ; preds = %16, %21
%24 = phi i32 [ %12, %21 ], [ %18, %16 ]
br label %25
25: ; preds = %4, %21, %23
%26 = phi i32 [ %24, %23 ], [ %22, %21 ], [ -1, %4 ]
ret i32 %26
}
/* Variables and functions */
unsigned long cris_swapnwbrlz(unsigned long);
extern unsigned long __ffs(unsigned long word) {
  return cris_swapnwbrlz(~word);
}


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

x86 assembly (clang, -O2):
<__ffs>:
not    %rdi
jmp    1030 <cris_swapnwbrlz@plt>

LLVM IR (-O0):
define i64 @__ffs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 @cris_swapnwbrlz(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @__ffs(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @cris_swapnwbrlz(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void options_show_license(const char *program) {
  fprintf(stderr,
          "%s e` rilasciato sotto i termini della licenza "
          "MIT allegata\n",
          program);
}


x86 assembly (clang, -O0):
<options_show_license>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_show_license>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"%s e` rilasciato sotto i termini della licenza MIT allegata\0A\00"
define void @options_show_license(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"%s e` rilasciato sotto i termini della licenza MIT allegata\0A\00"
define void @options_show_license(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
bool uc_is_code_point(int c) { return c >= 0 && c <= 0x10ffff; }


x86 assembly (clang, -O0):
<uc_is_code_point>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <uc_is_code_point+0x23>
cmpl   $0x10ffff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc_is_code_point>:
xor    %eax,%eax
cmp    $0x110000,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @uc_is_code_point(i32 %0) {
%2 = icmp ult i32 %0, 1114112
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World \n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double __nv_ceil(double);
double ceil(double __a) { return __nv_ceil(__a); }


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

x86 assembly (clang, -O2):
<ceil>:
jmp    1030 <__nv_ceil@plt>

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

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = tail call double @__nv_ceil(double %0)
ret double %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
size_t append_little_endian_uint32(uint8_t *dst, uint32_t num) {
  dst[0] = num & 0xff;
  dst[1] = (num & (0xff << 8)) >> 8;
  dst[2] = (num & (0xff << 16)) >> 16;
  dst[3] = (num & (0xff << 24)) >> 24;
  return 4;
}


x86 assembly (clang, -O0):
<append_little_endian_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff000000,%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_little_endian_uint32>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
sar    $0x18,%eax
mov    %eax,0xc(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i64 @append_little_endian_uint32(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 = and i32 %5, 255
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32, i32* %4
%15 = and i32 %14, 16711680
%16 = ashr i32 %15, 16
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 2
store i32 %16, i32* %18
%19 = load i32, i32* %4
%20 = and i32 %19, -16777216
%21 = ashr i32 %20, 24
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
ret i64 4
}

LLVM IR (-O2):
define i64 @append_little_endian_uint32(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = ashr i32 %1, 24
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void ts_LOG_default(const char *msg) { fprintf(stdout, "%s", msg); }


x86 assembly (clang, -O0):
<ts_LOG_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_LOG_default>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @ts_LOG_default(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @ts_LOG_default(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  int i;
  i = 1;
  while (i != argc) {
    ft_putstr(argv[i]);
    ft_putchar('\n');
    i++;
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1172 <main+0x52>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
je     115c <main+0x3c>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @ft_putstr(i8* %9)
%11 = tail call i32 @ft_putchar(i8 signext 10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
void _Block_release_object_default(const void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @_Block_release_object_default(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int rand();
int random_value() {
  if (rand() % 10 < 9)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<random_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jge    113c <random_value+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <random_value+0x33>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_value>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
xor    %ecx,%ecx
cmp    $0x9,%eax
setl   %cl
mov    $0x2,%eax
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_value() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 10
%4 = icmp slt i32 %3, 9
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 2, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @random_value() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = icmp slt i32 %2, 9
%4 = select i1 %3, i32 1, i32 2
ret i32 %4
}
void INT_Excep_TMR3_CMIA3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TMR3_CMIA3() {
ret void
}
void fa17(void) {
P0A:
  goto P0A;
  ({
    p01A:
      goto p01A;
      goto a;
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    a:
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa17>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa17+0x4>

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

LLVM IR (-O0):
define void @fa17() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; preds = %10
br label %10
11: ; No predecessors!
br label %12
12: ; preds = %12, %11
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa17() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int f475(int *);
int f476(int *p) { return f475(p); }


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

x86 assembly (clang, -O2):
<f476>:
jmp    1030 <f475@plt>

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

LLVM IR (-O2):
define i32 @f476(i32* %0) {
%2 = tail call i32 @f475(i32* %0)
ret i32 %2
}
/* Variables and functions */
size_t b64_size(size_t bloblen) { return 1 + (bloblen + 3 - 1) / 3 * 4; }


x86 assembly (clang, -O0):
<b64_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
sub    $0x1,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_size>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @b64_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3
%5 = sub i64 %4, 1
%6 = udiv i64 %5, 3
%7 = mul i64 %6, 4
%8 = add i64 1, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @b64_size(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
%5 = or i64 %4, 1
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ *readdir(int /*<<< orphan*/ *);
int NiveauxNombre() {
  int nb = -2;
  DIR *rep = opendir("niveaux/");
  while ((readdir(rep)) != NULL)
    nb++;
  closedir(rep);
  return nb;
}


x86 assembly (clang, -O0):
<NiveauxNombre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfffffffe,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <readdir@plt>
cmp    $0x0,%rax
je     1170 <NiveauxNombre+0x40>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <NiveauxNombre+0x1f>
mov    -0x10(%rbp),%rdi
call   1040 <closedir@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NiveauxNombre>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <opendir@plt>
mov    %rax,%r14
mov    $0xfffffffd,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <readdir@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1150 <NiveauxNombre+0x20>
mov    %r14,%rdi
call   1040 <closedir@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"niveaux/\00"
define i32 @NiveauxNombre() {
%1 = alloca i32
%2 = alloca i32*
store i32 -2, i32* %1
%3 = call i32* @opendir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32* %3, i32** %2
br label %4
4: ; preds = %8, %0
%5 = load i32*, i32** %2
%6 = call i32* @readdir(i32* %5)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
%12 = load i32*, i32** %2
%13 = call i32 @closedir(i32* %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"niveaux/\00"
define i32 @NiveauxNombre() {
%1 = tail call i32* @opendir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ -2, %0 ], [ %6, %2 ]
%4 = tail call i32* @readdir(i32* %1)
%5 = icmp eq i32* %4, null
%6 = add nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @closedir(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void _Q_stoq(void) {
  printf("Unimplemented %s called, exiting\n", "_Q_stoq");
  exit(-1);
}


x86 assembly (clang, -O0):
<_Q_stoq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_Q_stoq>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef3(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_stoq\00"
define void @_Q_stoq() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Unimplemented %s called, exiting\0A\00"
@.str.1 = [8 x i8] c"_Q_stoq\00"
define void @_Q_stoq() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ b;
};
struct TYPE_5__ {
  TYPE_1__ data;
};
struct TYPE_6__ {
  TYPE_2__ xclient;
};
typedef TYPE_3__ XEvent;

/* Variables and functions */
void *get_XEvent_xclient_data_b(void *_p) {
  return (void *)(((XEvent *)_p)->xclient.data.b);
}


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

x86 assembly (clang, -O2):
<get_XEvent_xclient_data_b>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_6__ = type { %struct.TYPE_5__ }
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i64 }
define i8* @get_XEvent_xclient_data_b(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_6__*
%5 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %5, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @get_XEvent_xclient_data_b(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void bzero(char *p, int n) { memset(p, 0, n); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bzero(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
void alarmHandler(int signal) {}


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

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

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

LLVM IR (-O2):
define void @alarmHandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(char *cmd) { printf("usage: \n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"usage: \00"
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef double uint32_t;

/* Variables and functions */
double get_time();
char *strstr(char *, char *);
double strstr_wrapper(char *data, char *substr) {
  uint32_t t1 = get_time();
  char *c = strstr(data, substr);
  uint32_t t2 = get_time();
  return (t2 - t1) / 1000000.0;
}


x86 assembly (clang, -O0):
<strstr_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_time@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <get_time@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xe95(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr_wrapper>:
push   %rax
xor    %eax,%eax
call   1030 <get_time@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <get_time@plt>
subsd  (%rsp),%xmm0
divsd  0xecf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @strstr_wrapper(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca i8*
%7 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = call double (...) @get_time()
store double %8, double* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i8* @strstr(i8* %9, i8* %10)
store i8* %11, i8** %6
%12 = call double (...) @get_time()
store double %12, double* %7
%13 = load double, double* %7
%14 = load double, double* %5
%15 = fsub double %13, %14
%16 = fdiv double %15, 1.000000e+06
ret double %16
}

LLVM IR (-O2):
define double @strstr_wrapper(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call double (...) @get_time()
%4 = tail call double (...) @get_time()
%5 = fsub double %4, %3
%6 = fdiv double %5, 1.000000e+06
ret double %6
}
/* Variables and functions */
unsigned long luaI_collectgarbage();
void lua_pack(void) {
  static unsigned long block = 50;
  static unsigned long nentity = 0;
  unsigned long recovered = 0;
  if (nentity++ < block)
    return;
  recovered = luaI_collectgarbage();
  block = 2 * (block - recovered);
  nentity -= recovered;
}


x86 assembly (clang, -O0):
<lua_pack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    0x2f11(%rip),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,0x2f03(%rip)
cmp    0x2eec(%rip),%rax
jae    1147 <lua_pack+0x37>
jmp    117d <lua_pack+0x6d>
mov    $0x0,%al
call   1030 <luaI_collectgarbage@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ecf(%rip),%rax
sub    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,0x2ec0(%rip)
mov    -0x8(%rbp),%rcx
mov    0x2ec5(%rip),%rax
sub    %rcx,%rax
mov    %rax,0x2ebb(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_pack>:
push   %rax
mov    0x2f20(%rip),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x2f15(%rip)
cmp    0x2efe(%rip),%rax
jb     114e <lua_pack+0x3e>
xor    %eax,%eax
call   1030 <luaI_collectgarbage@plt>
mov    0x2eee(%rip),%rcx
sub    %rax,%rcx
add    %rcx,%rcx
mov    %rcx,0x2ee1(%rip)
sub    %rax,0x2eea(%rip)
pop    %rax
ret

LLVM IR (-O0):
@lua_pack.block = internal global i64 50
@lua_pack.nentity = internal global i64 0
define void @lua_pack() {
%1 = alloca i64
store i64 0, i64* %1
%2 = load i64, i64* @lua_pack.nentity
%3 = add i64 %2, 1
store i64 %3, i64* @lua_pack.nentity
%4 = load i64, i64* @lua_pack.block
%5 = icmp ult i64 %2, %4
br i1 %5, label %6, label %7
6: ; preds = %0
br label %16
7: ; preds = %0
%8 = call i64 (...) @luaI_collectgarbage()
store i64 %8, i64* %1
%9 = load i64, i64* @lua_pack.block
%10 = load i64, i64* %1
%11 = sub i64 %9, %10
%12 = mul i64 2, %11
store i64 %12, i64* @lua_pack.block
%13 = load i64, i64* %1
%14 = load i64, i64* @lua_pack.nentity
%15 = sub i64 %14, %13
store i64 %15, i64* @lua_pack.nentity
br label %16
16: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@lua_pack.block = internal unnamed_addr global i64 50
@lua_pack.nentity = internal unnamed_addr global i64 0
define void @lua_pack() {
%1 = load i64, i64* @lua_pack.nentity
%2 = add i64 %1, 1
store i64 %2, i64* @lua_pack.nentity
%3 = load i64, i64* @lua_pack.block
%4 = icmp ult i64 %1, %3
br i1 %4, label %12, label %5
5: ; preds = %0
%6 = tail call i64 (...) @luaI_collectgarbage()
%7 = load i64, i64* @lua_pack.block
%8 = sub i64 %7, %6
%9 = shl i64 %8, 1
store i64 %9, i64* @lua_pack.block
%10 = load i64, i64* @lua_pack.nentity
%11 = sub i64 %10, %6
store i64 %11, i64* @lua_pack.nentity
br label %12
12: ; preds = %0, %5
ret void
}
void McASPTxTimeSlotSet(unsigned int baseAddr, unsigned int slotMask) {
  (*((volatile unsigned int *)(baseAddr + (0xB8)))) = slotMask;
}


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

x86 assembly (clang, -O2):
<McASPTxTimeSlotSet>:
add    $0xb8,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @McASPTxTimeSlotSet(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 = add i32 %6, 184
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @McASPTxTimeSlotSet(i32 %0, i32 %1) {
%3 = add i32 %0, 184
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
void INT_Excep_PERIA_INTA210(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA210() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_error();
void *malloc(size_t);
void *ft_malloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (!ptr) {
    ft_error();
    return (NULL);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<ft_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <ft_malloc+0x38>
mov    $0x0,%al
call   1040 <ft_error@plt>
movq   $0x0,-0x8(%rbp)
jmp    1160 <ft_malloc+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <ft_malloc+0x15>
xor    %eax,%eax
call   1040 <ft_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @ft_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @ft_error()
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Variables and functions */
unsigned int xstrtoull(char const *, int);
__attribute__((always_)) unsigned int xstrtou(const char *str, int b) {
  return xstrtoull(str, b);
}


x86 assembly (clang, -O0):
<xstrtou>:
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 <xstrtoull@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrtou>:
jmp    1030 <xstrtoull@plt>

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

LLVM IR (-O2):
define i32 @xstrtou(i8* %0, i32 %1) {
%3 = tail call i32 @xstrtoull(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct string_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ string_list_free(struct string_list *);
void dir_list_free(struct string_list *list) { string_list_free(list); }


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

x86 assembly (clang, -O2):
<dir_list_free>:
jmp    1030 <string_list_free@plt>

LLVM IR (-O0):
%struct.string_list = type { i32 }
define void @dir_list_free(%struct.string_list* %0) {
%2 = alloca %struct.string_list*
store %struct.string_list* %0, %struct.string_list** %2
%3 = load %struct.string_list*, %struct.string_list** %2
%4 = call i32 @string_list_free(%struct.string_list* %3)
ret void
}

LLVM IR (-O2):
%struct.string_list = type { i32 }
define void @dir_list_free(%struct.string_list* %0) {
%2 = tail call i32 @string_list_free(%struct.string_list* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
char *translate_rfxtype_message(unsigned char *buf) {
  static char outbuf[80];
  sprintf(outbuf, "RFXSensorXmitter : Heyu support not configured.");
  return outbuf;
}


x86 assembly (clang, -O0):
<translate_rfxtype_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x2f1d(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f0a(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_rfxtype_message>:
movups 0xf19(%rip),%xmm0
movaps %xmm0,0x2f42(%rip)
movups 0xefb(%rip),%xmm0
movaps %xmm0,0x2f24(%rip)
movups 0xedd(%rip),%xmm0
movaps %xmm0,0x2f06(%rip)
lea    0x2eff(%rip),%rax
ret

LLVM IR (-O0):
@translate_rfxtype_message.outbuf = internal global [80 x i8] zeroinitializer
@.str = [48 x i8] c"RFXSensorXmitter : Heyu support not configured.\00"
define i8* @translate_rfxtype_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @translate_rfxtype_message.outbuf, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @translate_rfxtype_message.outbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@translate_rfxtype_message.outbuf = internal global [80 x i8] zeroinitializer
@.str = [48 x i8] c"RFXSensorXmitter : Heyu support not configured.\00"
define i8* @translate_rfxtype_message(i8* nocapture readnone %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(48) getelementptr inbounds ([80 x i8], [80 x i8]* @translate_rfxtype_message.outbuf, i64 0, i64 0), i8* align 1 dereferenceable(48) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 48, i1 false)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @translate_rfxtype_message.outbuf, i64 0, i64 0)
}
int test_imm_E1int16_reg(short val) {
  return ((val) & (-0xE1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E1int16_reg>:
test   $0xff1f,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E1int16_reg(i16 signext %0) {
%2 = and i16 %0, -225
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned xrop3_168_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_168_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_168_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
void ff_hevc_put_hevc_uni_w_qpel_v4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v4_10_sse4() {
ret void
}