xunge/DecIR huggingface dataset:
int test_imm_BBint8_mem(signed char *val) {
  return ((*val) & (0xBB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BBint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xbb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_BBint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -69
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void do_sleep_sec(int sec) {
  struct timespec req;
  req.tv_sec = sec;
  req.tv_nsec = 0;
  nanosleep(&req, NULL);
}


x86 assembly (clang, -O0):
<do_sleep_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_sleep_sec>:
sub    $0x18,%rsp
mov    %edi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @do_sleep_sec(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %6
%7 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @do_sleep_sec(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %5
%6 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
int emac1_ifinerrors_set(unsigned int dev_id, union emac1_ifinerrors_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_ifinerrors_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_ifinerrors_u = type opaque
define i32 @emac1_ifinerrors_set(i32 %0, %union.emac1_ifinerrors_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_ifinerrors_u*
store i32 %0, i32* %3
store %union.emac1_ifinerrors_u* %1, %union.emac1_ifinerrors_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_ifinerrors_u = type opaque
define i32 @emac1_ifinerrors_set(i32 %0, %union.emac1_ifinerrors_u* nocapture readnone %1) {
ret i32 1
}
int longCadena(char *s) {
  char *p = s;
  while (*p != '\0') {
    p++;
  }
  return p - s;
}


x86 assembly (clang, -O0):
<longCadena>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <longCadena+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <longCadena+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longCadena>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <longCadena+0x10>
ret

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

LLVM IR (-O2):
define i32 @longCadena(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *arg[]) {
  int a = 15;
  int i, count = 0;
  for (i = 32; i > 0; i--) {
    if ((a & (1 << i - 1)) != 0)
      count++;
  }
  printf("number of 1 bits are %d \n", count);
  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   $0xf,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x20,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    117e <main+0x6e>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     116b <main+0x5b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1170 <main+0x60>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    113b <main+0x2b>
mov    -0x1c(%rbp),%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"number of 1 bits are %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 15, i32* %6
store i32 0, i32* %8
store i32 32, i32* %7
br label %9
9: ; preds = %23, %2
%10 = load i32, i32* %7
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = sub nsw i32 %14, 1
%16 = shl i32 1, %15
%17 = and i32 %13, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
br label %22
22: ; preds = %19, %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %7
%25 = add nsw i32 %24, -1
store i32 %25, i32* %7
br label %9
26: ; preds = %9
%27 = load i32, i32* %8
%28 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"number of 1 bits are %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int getRealTime(struct timeval *now) {
  int result;
  result = gettimeofday(now, NULL);
  return result;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @getRealTime(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i32
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @getRealTime(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret i32 %2
}
/* Variables and functions */
int memory_pressure_get();
int /*<<< orphan*/ memory_pressure_set();
int cfs_memory_pressure_get_and_set(void) {
  int old = memory_pressure_get();
  if (!old)
    memory_pressure_set();
  return old;
}


x86 assembly (clang, -O0):
<cfs_memory_pressure_get_and_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <memory_pressure_get@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1143 <cfs_memory_pressure_get_and_set+0x23>
mov    $0x0,%al
call   1040 <memory_pressure_set@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfs_memory_pressure_get_and_set>:
push   %rbx
xor    %eax,%eax
call   1030 <memory_pressure_get@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1135 <cfs_memory_pressure_get_and_set+0x15>
xor    %eax,%eax
call   1040 <memory_pressure_set@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cfs_memory_pressure_get_and_set() {
%1 = alloca i32
%2 = call i32 (...) @memory_pressure_get()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @memory_pressure_set()
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @cfs_memory_pressure_get_and_set() {
%1 = tail call i32 (...) @memory_pressure_get()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @memory_pressure_set()
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
int i2c_smbus_write_byte_data(int, int, int);
int bananapiI2CWriteReg8(int fd, int reg, int data) {
  return i2c_smbus_write_byte_data(fd, reg, data);
}


x86 assembly (clang, -O0):
<bananapiI2CWriteReg8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <i2c_smbus_write_byte_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bananapiI2CWriteReg8>:
jmp    1030 <i2c_smbus_write_byte_data@plt>

LLVM IR (-O0):
define i32 @bananapiI2CWriteReg8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @i2c_smbus_write_byte_data(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @bananapiI2CWriteReg8(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @i2c_smbus_write_byte_data(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void glutChangeToMenuEntry(int item, const char *label, int value) {}


x86 assembly (clang, -O0):
<glutChangeToMenuEntry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glutChangeToMenuEntry(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @glutChangeToMenuEntry(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int cat_file(int, char const *);
int chdir(char const *);
int /*<<< orphan*/ perror(char const *);
int cmd_cat(const char *jobid, const char *file) {
  if (chdir(jobid) == -1) {
    perror(jobid);
    return 1;
  }
  int rc = cat_file(1, file);
  chdir("..");
  return rc;
}


x86 assembly (clang, -O0):
<cmd_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
jne    1167 <cmd_cat+0x37>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    118a <cmd_cat+0x5a>
mov    -0x18(%rbp),%rsi
mov    $0x1,%edi
call   1050 <cat_file@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe81(%rip),%rdi
call   1030 <chdir@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_cat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
je     1169 <cmd_cat+0x39>
mov    $0x1,%edi
mov    %r14,%rsi
call   1050 <cat_file@plt>
mov    %eax,%ebx
lea    0xea6(%rip),%rdi
call   1030 <chdir@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
jmp    1161 <cmd_cat+0x31>

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

LLVM IR (-O2):
@.str = [3 x i8] c"..\00"
define i32 @cmd_cat(i8* %0, i8* %1) {
%3 = tail call i32 @chdir(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
br label %10
7: ; preds = %2
%8 = tail call i32 @cat_file(i32 1, i8* %1)
%9 = tail call i32 @chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 1, %5 ], [ %8, %7 ]
ret i32 %11
}
int simple_function(char *arg1) { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @simple_function(i8* nocapture readnone %0) {
ret i32 42
}
int is_address_register(int r) {
  switch (r) {
  case 0:
  case 1:
  case 2:
  case 3:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_address_register>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
ja     1124 <is_address_register+0x24>
jmp    1118 <is_address_register+0x18>
movl   $0x1,-0x4(%rbp)
jmp    112b <is_address_register+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_address_register(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_address_register(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int get_ntime();
long long get_mtime(void) { return get_ntime() / 1000000; }


x86 assembly (clang, -O0):
<get_mtime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_ntime@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mtime>:
push   %rax
xor    %eax,%eax
call   1030 <get_ntime@plt>
cltq
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_mtime() {
%1 = call i32 (...) @get_ntime()
%2 = sdiv i32 %1, 1000000
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_mtime() {
%1 = tail call i32 (...) @get_ntime()
%2 = sdiv i32 %1, 1000000
%3 = sext i32 %2 to i64
ret i64 %3
}
void caller(void (*func)(void)) { func(); }


x86 assembly (clang, -O0):
<caller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller>:
jmp    *%rdi

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

LLVM IR (-O2):
define void @caller(void ()* nocapture %0) {
tail call void %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ o5__resetvars();
int /*<<< orphan*/ write_char(int);
void o5_reset() {
  o5__resetvars();
  write_char(0xff);
}


x86 assembly (clang, -O0):
<o5_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <o5__resetvars@plt>
mov    $0xff,%edi
call   1030 <write_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<o5_reset>:
push   %rax
xor    %eax,%eax
call   1040 <o5__resetvars@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <write_char@plt>

LLVM IR (-O0):
define void @o5_reset() {
%1 = call i32 (...) @o5__resetvars()
%2 = call i32 @write_char(i32 255)
ret void
}

LLVM IR (-O2):
define void @o5_reset() {
%1 = tail call i32 (...) @o5__resetvars()
%2 = tail call i32 @write_char(i32 255)
ret void
}
int test_imm_70uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x70 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_70uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 112
%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_70uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 481036337152
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double __negdf2(double a) {
  long lc[2];
  lc[1] = ((const long *)&a)[1] ^ 0x80000000;
  lc[0] = ((const long *)&a)[0];
  return (*(const double *)lc);
}


x86 assembly (clang, -O0):
<__negdf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movabs $0x80000000,%rax
xor    0x0(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @__negdf2(double %0) {
%2 = alloca double
%3 = alloca [2 x i64]
store double %0, double* %2
%4 = bitcast double* %2 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 1
%6 = load i64, i64* %5
%7 = xor i64 %6, 2147483648
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
store i64 %7, i64* %8
%9 = bitcast double* %2 to i64*
%10 = getelementptr inbounds i64, i64* %9, i64 0
%11 = load i64, i64* %10
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
store i64 %11, i64* %12
%13 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%14 = bitcast i64* %13 to double*
%15 = load double, double* %14
ret double %15
}

LLVM IR (-O2):
define double @__negdf2(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ CompileCondition();
int /*<<< orphan*/ ResetIf();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_CanGoUp(void) {
  WriteInstruction("call cangu");
  WriteInstruction("jp nz,      ");
  CompileCondition();
  ResetIf();
}


x86 assembly (clang, -O0):
<CR_CanGoUp>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec4(%rip),%rdi
call   1040 <WriteInstruction@plt>
mov    $0x0,%al
call   1050 <CompileCondition@plt>
mov    $0x0,%al
call   1030 <ResetIf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_CanGoUp>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec7(%rip),%rdi
call   1040 <WriteInstruction@plt>
xor    %eax,%eax
call   1050 <CompileCondition@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ResetIf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"call cangu\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_CanGoUp() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @CompileCondition()
%4 = call i32 (...) @ResetIf()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"call cangu\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_CanGoUp() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @CompileCondition()
%4 = tail call i32 (...) @ResetIf()
ret void
}
long long mod(long long a, long long b) {
  long long r = a % b;
  return r < 0 ? r + b : r;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    1136 <mod+0x36>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    113e <mod+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <mod+0x16>
cqto
idiv   %rsi
jmp    111a <mod+0x1a>
xor    %edx,%edx
div    %esi
mov    %rdx,%rax
sar    $0x3f,%rax
and    %rsi,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @mod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = srem i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64, i64* %5
%13 = load i64, i64* %4
%14 = add nsw i64 %12, %13
br label %17
15: ; preds = %2
%16 = load i64, i64* %5
br label %17
17: ; preds = %15, %11
%18 = phi i64 [ %14, %11 ], [ %16, %15 ]
ret i64 %18
}

LLVM IR (-O2):
define i64 @mod(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i64 %1, i64 0
%6 = add nsw i64 %5, %3
ret i64 %6
}
int is_id_letter(int c) {
  return (c & 0xff) > ' ' && c != ':' && c != '"' && c != '=' && c != '.';
}


x86 assembly (clang, -O0):
<is_id_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x5(%rbp)
jle    1155 <is_id_letter+0x55>
xor    %eax,%eax
cmpl   $0x3a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1155 <is_id_letter+0x55>
xor    %eax,%eax
cmpl   $0x22,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1155 <is_id_letter+0x55>
xor    %eax,%eax
cmpl   $0x3d,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1155 <is_id_letter+0x55>
cmpl   $0x2e,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_id_letter>:
movzbl %dil,%ecx
xor    %eax,%eax
cmp    $0x21,%ecx
jb     1122 <is_id_letter+0x22>
cmp    $0x3d,%edi
ja     1123 <is_id_letter+0x23>
mov    %edi,%ecx
movabs $0x2400000400000000,%rdx
bt     %rcx,%rdx
jae    1123 <is_id_letter+0x23>
ret
xor    %eax,%eax
cmp    $0x2e,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @is_id_letter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = icmp sgt i32 %4, 32
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 58
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 34
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 61
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp ne i32 %16, 46
br label %18
18: ; preds = %15, %12, %9, %6, %1
%19 = phi i1 [ false, %12 ], [ false, %9 ], [ false, %6 ], [ false, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_id_letter(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ugt i32 %2, 32
br i1 %3, label %4, label %8
4: ; preds = %1
switch i32 %0, label %5 [
i32 61, label %8
i32 58, label %8
i32 34, label %8
]
5: ; preds = %4
%6 = icmp ne i32 %0, 46
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %4, %4, %1, %5
%9 = phi i32 [ 0, %4 ], [ %7, %5 ], [ 0, %1 ], [ 0, %4 ], [ 0, %4 ]
ret i32 %9
}
int op_neg(int a) { return -a; }


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

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

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

LLVM IR (-O2):
define i32 @op_neg(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
void whileStmt() {
  while (0) {
  }
  1 + 1;
}


x86 assembly (clang, -O0):
<whileStmt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <whileStmt+0x9>
xor    %eax,%eax
test   $0x1,%al
jne    1118 <whileStmt+0x18>
jmp    111d <whileStmt+0x1d>
jmp    1109 <whileStmt+0x9>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @whileStmt() {
br label %1
1: ; preds = %2, %0
br i1 false, label %2, label %3
2: ; preds = %1
br label %1
3: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @whileStmt() {
ret void
}
/* Variables and functions */
float pow(int, int);
int floatToQ(float num) { return (int)(num * pow(2, 16)); }


x86 assembly (clang, -O0):
<floatToQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x10,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floatToQ>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
mov    $0x10,%esi
call   1030 <pow@plt>
mulss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @floatToQ(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @pow(i32 2, i32 16)
%5 = fmul float %3, %4
%6 = fptosi float %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @floatToQ(float %0) {
%2 = tail call float @pow(i32 2, i32 16)
%3 = fmul float %2, %0
%4 = fptosi float %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ combinationUtil(long *, long, long, int /*<<< orphan*/,
                                   long *, int /*<<< orphan*/);
void printCombination(long arr[], long n, long r) {
  long data[r];
  combinationUtil(arr, n, r, 0, data, 0);
}


x86 assembly (clang, -O0):
<printCombination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,8),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r8
sub    %rcx,%r8
mov    %r8,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
call   1030 <combinationUtil@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCombination>:
push   %rbp
mov    %rsp,%rbp
mov    %rsp,%r8
lea    0xf(,%rdx,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r8
mov    %r8,%rsp
xor    %ecx,%ecx
xor    %r9d,%r9d
call   1030 <combinationUtil@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @printCombination(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %6
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %7
%11 = alloca i64, i64 %9
store i64 %9, i64* %8
%12 = load i64*, i64** %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = call i32 @combinationUtil(i64* %12, i64 %13, i64 %14, i32 0, i64* %11, i32 0)
%16 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @printCombination(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64, i64 %2
%5 = call i32 @combinationUtil(i64* %0, i64 %1, i64 %2, i32 0, i64* %4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
void delField(char *field) { memset(field, ' ', 9); }


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

x86 assembly (clang, -O2):
<delField>:
mov    $0x20,%esi
mov    $0x9,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @delField(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i8 signext 32, i32 9)
ret void
}
void output_init() { return; }


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

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

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

LLVM IR (-O2):
define void @output_init() {
ret void
}
/* Variables and functions */
char const *basename(char *);
int /*<<< orphan*/ px_free(char *);
void *px_strdup(char const *);
char *strrchr(char const *, char);
char *basename_noext(const char *filename) {
  char *tmp = px_strdup(filename);
  filename = px_strdup(basename(tmp));
  px_free(tmp);
  if (strrchr(filename, '.'))
    strrchr(filename, '.')[0] = '\0';
  return (char *)filename;
}


x86 assembly (clang, -O0):
<basename_noext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <px_strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1060 <px_strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <px_free@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
cmp    $0x0,%rax
je     11a0 <basename_noext+0x60>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename_noext>:
push   %r14
push   %rbx
push   %rax
call   1060 <px_strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <basename@plt>
mov    %rax,%rdi
call   1060 <px_strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <px_free@plt>
mov    %r14,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     117c <basename_noext+0x3c>
movb   $0x0,(%rax)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @basename_noext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @px_strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i8* @basename(i8* %6)
%8 = call i8* @px_strdup(i8* %7)
store i8* %8, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 @px_free(i8* %9)
%11 = load i8*, i8** %2
%12 = call i8* @strrchr(i8* %11, i8 signext 46)
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = call i8* @strrchr(i8* %15, i8 signext 46)
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 0, i8* %17
br label %18
18: ; preds = %14, %1
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @basename_noext(i8* %0) {
%2 = tail call i8* @px_strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i8* @px_strdup(i8* %3)
%5 = tail call i32 @px_free(i8* %2)
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %4, i8 signext 46)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8 0, i8* %6
br label %9
9: ; preds = %8, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
void ST8DD_RawLog(const char *str) { puts(str); }


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

x86 assembly (clang, -O2):
<ST8DD_RawLog>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @ST8DD_RawLog(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
void swapDoubles(double *a, double *b) {
  double temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<swapDoubles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapDoubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swapDoubles(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
store double %7, double* %5
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = load double*, double** %3
store double %9, double* %10
%11 = load double, double* %5
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @swapDoubles(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ paths(int, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printf("Solution: %llu.\n", paths(20, 20));
  return 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)
mov    $0x14,%esi
mov    %esi,%edi
call   1040 <paths@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"Solution: %llu.\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 @paths(i32 20, i32 20)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"Solution: %llu.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @paths(i32 20, i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ err_exit(char *);
scalar_t__ setgroups(size_t, int /*<<< orphan*/ *);
void _setgroups(size_t s, gid_t *g) {
  if (setgroups(s, g) < 0)
    err_exit("_setgroups");
}


x86 assembly (clang, -O0):
<_setgroups>:
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 <setgroups@plt>
cmp    $0x0,%rax
jge    1153 <_setgroups+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setgroups>:
push   %rax
call   1030 <setgroups@plt>
test   %rax,%rax
js     112d <_setgroups+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <err_exit@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"_setgroups\00"
define void @_setgroups(i64 %0, i32* %1) {
%3 = tail call i64 @setgroups(i64 %0, i32* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_exit(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIA1_SetInterruptFlag(int);
void VIA1_iCA1_PulseNtfy(void) { VIA1_SetInterruptFlag(1); }


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

x86 assembly (clang, -O2):
<VIA1_iCA1_PulseNtfy>:
mov    $0x1,%edi
jmp    1030 <VIA1_SetInterruptFlag@plt>

LLVM IR (-O0):
define void @VIA1_iCA1_PulseNtfy() {
%1 = call i32 @VIA1_SetInterruptFlag(i32 1)
ret void
}

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


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x30,%edi
call   1040 <foo@plt>
test   %rax,%rax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 48)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ puts(char *);
void screen_print_int(int i, int base) {
  char buf[100];
  itoa(i, buf, base);
  puts(buf);
}


x86 assembly (clang, -O0):
<screen_print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <itoa@plt>
lea    -0x70(%rbp),%rdi
call   1030 <puts@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_print_int>:
push   %rbx
sub    $0x70,%rsp
mov    %esi,%edx
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <itoa@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @screen_print_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %4
%9 = call i32 @itoa(i32 %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @puts(i8* %10)
ret void
}

LLVM IR (-O2):
define void @screen_print_int(i32 %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @itoa(i32 %0, i8* %4, i32 %1)
%6 = call i32 @puts(i8* %4)
ret void
}
/* Type definitions */
struct mxt_platform_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ enable_irq(unsigned int);
void board_enable_irq(const struct mxt_platform_data *pdata, unsigned int irq) {
  enable_irq(irq);
}


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

x86 assembly (clang, -O2):
<board_enable_irq>:
mov    %esi,%edi
jmp    1030 <enable_irq@plt>

LLVM IR (-O0):
%struct.mxt_platform_data = type { i32 }
define void @board_enable_irq(%struct.mxt_platform_data* %0, i32 %1) {
%3 = alloca %struct.mxt_platform_data*
%4 = alloca i32
store %struct.mxt_platform_data* %0, %struct.mxt_platform_data** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @enable_irq(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.mxt_platform_data = type { i32 }
define void @board_enable_irq(%struct.mxt_platform_data* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @enable_irq(i32 %1)
ret void
}
void __undef(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__undef() {
ret void
}
/* Variables and functions */
char *__memrchr(char const *, int, scalar_t__);
scalar_t__ strlen(char const *);
char *strrchr(const char *s, int c) { return __memrchr(s, c, strlen(s) + 1); }


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <__memrchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <__memrchr@plt>

LLVM IR (-O0):
define i8* @strrchr(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 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @__memrchr(i8* %5, i32 %6, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @__memrchr(i8* %0, i32 %1, i64 %4)
ret i8* %5
}
/* Variables and functions */
double log1(double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%.16f \n", log1(200123.987));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <log1@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%.16f \0A\00"
define i32 @main() {
%1 = tail call double @log1(double 0x41086DDFE5604189)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
void foo_1_2_1_2_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_1_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fuck() {
  printf("Fuck World!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Fuck World!\0A\00"
define i32 @fuck() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Fuck World!\00"
define i32 @fuck() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute((weak)) void mix(void) {}


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

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

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

LLVM IR (-O2):
define weak void @mix() {
ret void
}
float fminf(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<fminf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <fminf+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <fminf+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminf>:
minss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fminf(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ gdt_init();
int /*<<< orphan*/ idt_init();
void dts_init() {
  gdt_init();
  idt_init();
}


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

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

LLVM IR (-O0):
define void @dts_init() {
%1 = call i32 (...) @gdt_init()
%2 = call i32 (...) @idt_init()
ret void
}

LLVM IR (-O2):
define void @dts_init() {
%1 = tail call i32 (...) @gdt_init()
%2 = tail call i32 (...) @idt_init()
ret void
}