xunge/DecIR huggingface dataset:
/* Variables and functions */
int volume_mod_to_gb(int);
int volume_mod_to_gb_ch3(int v) {
  int vol = volume_mod_to_gb(v);
  switch (vol) {
  case 0:
  case 1:
  case 2:
  case 3:
    return 0;
  case 4:
  case 5:
  case 6:
  case 7:
    return 3;
  case 8:
  case 9:
  case 10:
  case 11:
    return 2;
  default:
  case 12:
  case 13:
  case 14:
  case 15:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<volume_mod_to_gb_ch3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <volume_mod_to_gb@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xf,%rax
ja     116f <volume_mod_to_gb_ch3+0x5f>
mov    -0x18(%rbp),%rax
lea    0xebe(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    117b <volume_mod_to_gb_ch3+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    117b <volume_mod_to_gb_ch3+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    117b <volume_mod_to_gb_ch3+0x6b>
jmp    1174 <volume_mod_to_gb_ch3+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volume_mod_to_gb_ch3>:
push   %rax
call   1030 <volume_mod_to_gb@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xb,%ecx
ja     112f <volume_mod_to_gb_ch3+0x1f>
movslq %ecx,%rax
lea    0xed4(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @volume_mod_to_gb_ch3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @volume_mod_to_gb(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
switch i32 %7, label %11 [
i32 0, label %8
i32 1, label %8
i32 2, label %8
i32 3, label %8
i32 4, label %9
i32 5, label %9
i32 6, label %9
i32 7, label %9
i32 8, label %10
i32 9, label %10
i32 10, label %10
i32 11, label %10
i32 12, label %12
i32 13, label %12
i32 14, label %12
i32 15, label %12
]
8: ; preds = %1, %1, %1, %1
store i32 0, i32* %2
br label %13
9: ; preds = %1, %1, %1, %1
store i32 3, i32* %2
br label %13
10: ; preds = %1, %1, %1, %1
store i32 2, i32* %2
br label %13
11: ; preds = %1
br label %12
12: ; preds = %1, %1, %1, %1, %11
store i32 1, i32* %2
br label %13
13: ; preds = %12, %10, %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.volume_mod_to_gb_ch3 = [12 x i32] [i32 0, i32 0, i32 0, i32 0, i32 3, i32 3, i32 3, i32 3, i32 2, i32 2, i32 2, i32 2]
define i32 @volume_mod_to_gb_ch3(i32 %0) {
%2 = tail call i32 @volume_mod_to_gb(i32 %0)
%3 = icmp ult i32 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.volume_mod_to_gb_ch3, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  exit(EXIT_SUCCESS);
}


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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@EXIT_SUCCESS = global i32 0
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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int naive_bt_w(int base, int offset) {
  unsigned char val = offset;
  val &= 15;
  return !!(base & (1 << val));
}


x86 assembly (clang, -O0):
<naive_bt_w>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%eax
movzbl -0x9(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<naive_bt_w>:
mov    %esi,%ecx
mov    %edi,%eax
and    $0xf,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @naive_bt_w(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i32, i32* %3
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = shl i32 1, %14
%16 = and i32 %12, %15
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @naive_bt_w(i32 %0, i32 %1) {
%3 = and i32 %1, 15
%4 = lshr i32 %0, %3
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, unsigned long long const,
                               unsigned long long const);
int values_not_equal_display_error(const unsigned long long left,
                                   const unsigned long long right) {
  const int not_equal = left != right;
  if (!not_equal) {
    print_error("%llx"
                " == "
                "%llx"
                "\n",
                left, right);
  }
  return not_equal;
}


x86 assembly (clang, -O0):
<values_not_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1151 <values_not_equal_display_error+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <print_error@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<values_not_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    %rsi,%rdi
jne    1131 <values_not_equal_display_error+0x21>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <print_error@plt>
xor    %eax,%eax
cmp    %r14,%rbx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%llx == %llx\0A\00"
define i32 @values_not_equal_display_error(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = icmp ne i64 %6, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = call i32 @print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %13, i64 %14)
br label %16
16: ; preds = %12, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"%llx == %llx\0A\00"
define i32 @values_not_equal_display_error(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %0)
br label %6
6: ; preds = %4, %2
%7 = zext i1 %3 to i32
ret i32 %7
}
void end_virus() {}


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

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

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

LLVM IR (-O2):
define void @end_virus() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int create_quaddobl_cascade_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(188, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<create_quaddobl_cascade_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xbc,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_quaddobl_cascade_homotopy>:
mov    $0xbc,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @create_quaddobl_cascade_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 188, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @create_quaddobl_cascade_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 188, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("CCCCC\n");
  printf("C\n");
  printf("C\n");
  printf("CCCCC\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"CCCCC\0A\00"
@.str.1 = [3 x i8] c"C\0A\00"
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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.3 = [2 x i8] c"C\00"
@str.4 = [6 x i8] c"CCCCC\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ gdp_files_close(int /*<<< orphan*/ *);
char *gdp_files_getstring(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *gdp_files_open(char *);
char *gdp_files_quick_getstring(char *FileName, char *cParameter) {
  FILE *fAux = gdp_files_open(FileName);
  char *ret = gdp_files_getstring(fAux, cParameter);
  gdp_files_close(fAux);
  return ret;
}


x86 assembly (clang, -O0):
<gdp_files_quick_getstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <gdp_files_open@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gdp_files_getstring@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <gdp_files_close@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdp_files_quick_getstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <gdp_files_open@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <gdp_files_getstring@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <gdp_files_close@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @gdp_files_quick_getstring(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32* @gdp_files_open(i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i8*, i8** %4
%11 = call i8* @gdp_files_getstring(i32* %9, i8* %10)
store i8* %11, i8** %6
%12 = load i32*, i32** %5
%13 = call i32 @gdp_files_close(i32* %12)
%14 = load i8*, i8** %6
ret i8* %14
}

LLVM IR (-O2):
define i8* @gdp_files_quick_getstring(i8* %0, i8* %1) {
%3 = tail call i32* @gdp_files_open(i8* %0)
%4 = tail call i8* @gdp_files_getstring(i32* %3, i8* %1)
%5 = tail call i32 @gdp_files_close(i32* %3)
ret i8* %4
}
void sched_cacheflush(void) {}


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

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

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

LLVM IR (-O2):
define void @sched_cacheflush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: mergelogs -p penlog [-j jitter] \\\n"
         "        server1:logfile1 [server2:logfile2 ...]\n\n"
         "  -c                Do not use penlog cache\n"
         "  -d                Debugging (repeat for more)\n"
         "  -p penlog         Log file from pen\n"
         "  -j jitter         Jitter in seconds [2]\n"
         "  -r filename       Where to put rejects\n"
         "  -t seconds        Timezone\n"
         "  server:logfile    Web server address and name of logfile\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [392 x i8] c"Usage: mergelogs -p penlog [-j jitter] \\\0A server1:logfile1 [server2:logfile2 ...]\0A\0A -c Do not use penlog cache\0A -d Debugging (repeat for more)\0A -p penlog Log file from pen\0A -j jitter Jitter in seconds [2]\0A -r filename Where to put rejects\0A -t seconds Timezone\0A server:logfile Web server address and name of logfile\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([392 x i8], [392 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [391 x i8] c"Usage: mergelogs -p penlog [-j jitter] \\\0A server1:logfile1 [server2:logfile2 ...]\0A\0A -c Do not use penlog cache\0A -d Debugging (repeat for more)\0A -p penlog Log file from pen\0A -j jitter Jitter in seconds [2]\0A -r filename Where to put rejects\0A -t seconds Timezone\0A server:logfile Web server address and name of logfile\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([391 x i8], [391 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
char *langRomTypeMirroredRam2k() { return "2kB Mirrored RAM"; }


x86 assembly (clang, -O0):
<langRomTypeMirroredRam2k>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeMirroredRam2k>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"2kB Mirrored RAM\00"
define i8* @langRomTypeMirroredRam2k() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"2kB Mirrored RAM\00"
define i8* @langRomTypeMirroredRam2k() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int *, int, int, struct timespec const *, int *,
            int);
int futex(int *uaddr, int op, int val, const struct timespec *timeout,
          int *uaddr2, int val3) {
  return syscall(SYS_futex, uaddr, op, val, timeout, uaddr2, val3);
}


x86 assembly (clang, -O0):
<futex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32, i32* @SYS_futex
%14 = load i32*, i32** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load %struct.timespec*, %struct.timespec** %10
%18 = load i32*, i32** %11
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i32* %14, i32 %15, i32 %16, %struct.timespec* %17, i32* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5) {
%7 = load i32, i32* @SYS_futex
%8 = tail call i32 @syscall(i32 %7, i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int buf_overrun(const char *buf, size_t buflen, size_t offset, size_t dlen,
                FILE *log) {
  const char *tgt = buf + offset + dlen;
  if (tgt > (buf + buflen)) {
    if (NULL != log) {
      ((void)0);
    }
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<buf_overrun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jbe    115a <buf_overrun+0x5a>
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
je     114e <buf_overrun+0x4e>
jmp    114e <buf_overrun+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1161 <buf_overrun+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_overrun>:
add    %rdi,%rdx
add    %rcx,%rdx
add    %rdi,%rsi
xor    %eax,%eax
cmp    %rsi,%rdx
seta   %al
ret

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

LLVM IR (-O2):
define i32 @buf_overrun(i8* readnone %0, i64 %1, i64 %2, i64 %3, i32* nocapture readnone %4) {
%6 = getelementptr inbounds i8, i8* %0, i64 %2
%7 = getelementptr inbounds i8, i8* %6, i64 %3
%8 = getelementptr inbounds i8, i8* %0, i64 %1
%9 = icmp ugt i8* %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test22_head() {
  do {
    printf("test22");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test22_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test22_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test22_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test22\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test22_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test22\00"
define void @test22_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
enum nss_status _nss_noenum_setspent(void) { return NSS_STATUS_SUCCESS; }


x86 assembly (clang, -O0):
<_nss_noenum_setspent>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_noenum_setspent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_noenum_setspent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_noenum_setspent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  sleep(1);
  int a = 1;
  printf("%lx %d\n", &a, a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
movl   $0x1,0x4(%rsp)
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%lx %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @sleep(i32 1)
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, i32 1)
ret i32 0
}
int foo(unsigned word) { return (int)((word << 24) >> 24); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
int r_min(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<r_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <r_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <r_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @r_min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @r_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ unix_error(char *);
FILE *Fopen(const char *filename, const char *mode) {
  FILE *p;
  if ((p = fopen(filename, mode)) == NULL) {
    unix_error("fopen failed");
  }
  return (p);
}


x86 assembly (clang, -O0):
<Fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1157 <Fopen+0x37>
lea    0xeae(%rip),%rdi
call   1030 <unix_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fopen>:
push   %rbx
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Fopen+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <unix_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"fopen failed\00"
define noalias i32* @Fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32* %3
}
int fun642() { return 642; }


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

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

LLVM IR (-O0):
define i32 @fun642() {
ret i32 642
}

LLVM IR (-O2):
define i32 @fun642() {
ret i32 642
}
int ft_nearest_sqr(int nb) {
  int root;
  root = 0;
  while ((root * root) < nb)
    root++;
  return (root);
}


x86 assembly (clang, -O0):
<ft_nearest_sqr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112c <ft_nearest_sqr+0x2c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ft_nearest_sqr+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nearest_sqr>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
jl     1110 <ft_nearest_sqr+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_nearest_sqr(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = mul nsw i32 %3, %3
%5 = icmp slt i32 %4, %0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
int t2(int a) {
  if (a < 128) {
    return 2 * a;
  } else if (a >= 128) {
    return (2 * a) ^ 283;
  }
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jge    1122 <t2+0x22>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <t2+0x47>
cmpl   $0x80,-0x8(%rbp)
jl     1142 <t2+0x42>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
xor    $0x11b,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <t2+0x47>
jmp    1147 <t2+0x47>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
xor    $0x11b,%eax
cmp    $0x80,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @t2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = mul nsw i32 2, %7
store i32 %8, i32* %2
br label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 128
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = mul nsw i32 2, %13
%15 = xor i32 %14, 283
store i32 %15, i32* %2
br label %17
16: ; preds = %9
br label %17
17: ; preds = %6, %12, %16
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @t2(i32 %0) {
%2 = icmp slt i32 %0, 128
%3 = shl nsw i32 %0, 1
%4 = xor i32 %3, 283
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
void pollen_interfaces_Led_off__E() {}


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

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

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

LLVM IR (-O2):
define void @pollen_interfaces_Led_off__E() {
ret void
}
float mvVecScalarProduct3(const float *a, const float *b) {
  return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]);
}


x86 assembly (clang, -O0):
<mvVecScalarProduct3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecScalarProduct3>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mvVecScalarProduct3(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @mvVecScalarProduct3(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
int fun575() { return 575; }


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

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

LLVM IR (-O0):
define i32 @fun575() {
ret i32 575
}

LLVM IR (-O2):
define i32 @fun575() {
ret i32 575
}
/* Variables and functions */
int /*<<< orphan*/ CCM_1_DriverIRQHandler();
__attribute__((weak)) void CCM_1_IRQHandler(void) { CCM_1_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @CCM_1_IRQHandler() {
%1 = call i32 (...) @CCM_1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CCM_1_IRQHandler() {
%1 = tail call i32 (...) @CCM_1_DriverIRQHandler()
ret void
}
int max(a, b)
int a, b;
{ return (a < b) ? b : a; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int process_add_internal(char **, int /*<<< orphan*/);
int process_add(char **x) { return process_add_internal(x, 0); }


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

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

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

LLVM IR (-O2):
define i32 @process_add(i8** %0) {
%2 = tail call i32 @process_add_internal(i8** %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_data(unsigned int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  unsigned int i;
  for (i = 0; i < 10; i++)
    print_data(i);
  printf("done\n");
  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   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jae    115d <main+0x3d>
mov    -0x14(%rbp),%edi
call   1040 <print_data@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <print_data@plt>
mov    $0x1,%edi
call   1040 <print_data@plt>
mov    $0x2,%edi
call   1040 <print_data@plt>
mov    $0x3,%edi
call   1040 <print_data@plt>
mov    $0x4,%edi
call   1040 <print_data@plt>
mov    $0x5,%edi
call   1040 <print_data@plt>
mov    $0x6,%edi
call   1040 <print_data@plt>
mov    $0x7,%edi
call   1040 <print_data@plt>
mov    $0x8,%edi
call   1040 <print_data@plt>
mov    $0x9,%edi
call   1040 <print_data@plt>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"done\0A\00"
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 0, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 10
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @print_data(i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"done\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_data(i32 0)
%4 = tail call i32 @print_data(i32 1)
%5 = tail call i32 @print_data(i32 2)
%6 = tail call i32 @print_data(i32 3)
%7 = tail call i32 @print_data(i32 4)
%8 = tail call i32 @print_data(i32 5)
%9 = tail call i32 @print_data(i32 6)
%10 = tail call i32 @print_data(i32 7)
%11 = tail call i32 @print_data(i32 8)
%12 = tail call i32 @print_data(i32 9)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int values_not_equal_display_error(unsigned long const, unsigned long const);
int check_not_value(const unsigned long int value,
                    const unsigned long int check_value_data) {
  return values_not_equal_display_error(value, check_value_data);
}


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

x86 assembly (clang, -O2):
<check_not_value>:
jmp    1030 <values_not_equal_display_error@plt>

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

LLVM IR (-O2):
define i32 @check_not_value(i64 %0, i64 %1) {
%3 = tail call i32 @values_not_equal_display_error(i64 %0, i64 %1)
ret i32 %3
}
void av_packet_side_data_name() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_side_data_name() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_subb_atRi(FILE *stream, unsigned char i) {
  fprintf(stream, "SUBB  A, @R%X                    ", i);
}


x86 assembly (clang, -O0):
<fprint_subb_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [34 x i8] c"SUBB A, @R%X \00"
define void @fprint_subb_atRi(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *cfe_calloc(size_t nmemb, size_t size) { return calloc(nmemb, size); }


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

x86 assembly (clang, -O2):
<cfe_calloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @cfe_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
int get16(unsigned char *buf) { return (buf[0] * 256 + buf[1]); }


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = mul nsw i32 %6, 256
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = add nsw i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
int foo() {
  int a = 3;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
extern void DCC_byte_dump_hex(unsigned char byte) {
  printf("%x", byte);
  return;
}


x86 assembly (clang, -O0):
<DCC_byte_dump_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCC_byte_dump_hex>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @DCC_byte_dump_hex(i8 zeroext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait_8042();
int /*<<< orphan*/ write_8042(char);
void cmd_keyboard(char command) {
  write_8042(command);
  wait_8042();
}


x86 assembly (clang, -O0):
<cmd_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <write_8042@plt>
mov    $0x0,%al
call   1030 <wait_8042@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmd_keyboard(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @write_8042(i8 signext %3)
%5 = call i32 (...) @wait_8042()
ret void
}

LLVM IR (-O2):
define void @cmd_keyboard(i8 signext %0) {
%2 = tail call i32 @write_8042(i8 signext %0)
%3 = tail call i32 (...) @wait_8042()
ret void
}
double plus(double a, double b) { return a + b; }


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

x86 assembly (clang, -O2):
<plus>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @plus(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
int test_imm_BFint64_highword_reg(long long val) {
  return ((val >> 32) & (0xBF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BFint64_highword_reg>:
movabs $0xbf00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BFint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 191
%6 = icmp ne i64 %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_BFint64_highword_reg(i64 %0) {
%2 = and i64 %0, 820338753536
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
void ech(int pn) { brc(pn, 'X'); }


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

x86 assembly (clang, -O2):
<ech>:
mov    $0x58,%esi
jmp    1030 <brc@plt>

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

LLVM IR (-O2):
define void @ech(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 88)
ret void
}