xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x81() {
  Assert_real((isgraph(129) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              650, ("isgraph should be 0 for 0x81"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x81>:
push   %rbp
mov    %rsp,%rbp
mov    $0x81,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28a,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x81>:
push   %rax
mov    $0x81,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28a,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x81\00"
define void @t_isgraph_0x81() {
%1 = call i64 @isgraph(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x81\00"
define void @t_isgraph_0x81() {
%1 = tail call i64 @isgraph(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void func4(int var1, int var2) {
  var1 += var2;
  var1 -= var2;
  var1 *= var2;
  var1 /= var2;
  var1 %= var2;
  var1 &= var2;
  var1 |= var2;
  var1 ^= var2;
  var1 >>= var2;
  var1 <<= var2;
}


x86 assembly (clang, -O0):
<func4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = sdiv i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = srem i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = and i32 %21, %20
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = or i32 %24, %23
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = xor i32 %27, %26
store i32 %28, i32* %3
%29 = load i32, i32* %4
%30 = load i32, i32* %3
%31 = ashr i32 %30, %29
store i32 %31, i32* %3
%32 = load i32, i32* %4
%33 = load i32, i32* %3
%34 = shl i32 %33, %32
store i32 %34, i32* %3
ret void
}

LLVM IR (-O2):
define void @func4(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_help(char *prog_name) {
  printf("Usage: %s -i input_file_name -o output_file_name\n", prog_name);
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"Usage: %s -i input_file_name -o output_file_name\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"Usage: %s -i input_file_name -o output_file_name\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ op_dist_uniform(int);
int rand_int(int module) { return (int)op_dist_uniform(module); }


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

x86 assembly (clang, -O2):
<rand_int>:
jmp    1030 <op_dist_uniform@plt>

LLVM IR (-O0):
define i32 @rand_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @op_dist_uniform(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand_int(i32 %0) {
%2 = tail call i64 @op_dist_uniform(i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
bool requestedChunkStartIsInCache(int32_t startPos, int32_t reqSize,
                                  int32_t cacheStartPos, int32_t cacheSize) {
  return startPos >= cacheStartPos && startPos < cacheStartPos + cacheSize;
}


x86 assembly (clang, -O0):
<requestedChunkStartIsInCache>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x21(%rbp)
jl     113c <requestedChunkStartIsInCache+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    -0x20(%rbp),%rcx
cmp    %rcx,%rax
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<requestedChunkStartIsInCache>:
cmp    %rdx,%rdi
setge  %al
add    %rdx,%rcx
cmp    %rdi,%rcx
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @requestedChunkStartIsInCache(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp sge i64 %0, %2
%6 = add nsw i64 %3, %2
%7 = icmp sgt i64 %6, %0
%8 = select i1 %5, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ stic_simple_test_result(int, char *, char const *,
                                           unsigned int);
void stic_assert_false(int test, const char *function, unsigned int line) {
  stic_simple_test_result(!test, "Should have been false", function, line);
}


x86 assembly (clang, -O0):
<stic_assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xec2(%rip),%rsi
call   1030 <stic_simple_test_result@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stic_assert_false>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0xedd(%rip),%rsi
mov    %eax,%edi
jmp    1030 <stic_simple_test_result@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Should have been false\00"
define void @stic_assert_false(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @stic_simple_test_result(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Should have been false\00"
define void @stic_assert_false(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @stic_simple_test_result(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret void
}
int ras_add_daemon_trace(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ras_add_daemon_trace() {
ret i32 0
}
void spin() {
  while (1)
    __asm("");
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <spin+0x9>
jmp    1109 <spin+0x9>

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

LLVM IR (-O0):
define void @spin() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @spin() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
int isalnum(int c) {
  if (c >= 'A') {
    if (c <= 'Z') {
      return (1);
    }
  }
  if (c >= 'a') {
    if (c <= 'z') {
      return (1);
    }
  }
  if (c >= '0') {
    if (c <= '9') {
      return (1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <isalnum+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <isalnum+0x27>
movl   $0x1,-0x4(%rbp)
jmp    117d <isalnum+0x7d>
jmp    112c <isalnum+0x2c>
cmpl   $0x61,-0x8(%rbp)
jl     1151 <isalnum+0x51>
cmpl   $0x7a,-0x8(%rbp)
jg     114c <isalnum+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    117d <isalnum+0x7d>
jmp    1151 <isalnum+0x51>
cmpl   $0x30,-0x8(%rbp)
jl     1176 <isalnum+0x76>
cmpl   $0x39,-0x8(%rbp)
jg     1171 <isalnum+0x71>
movl   $0x1,-0x4(%rbp)
jmp    117d <isalnum+0x7d>
jmp    1176 <isalnum+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %28
10: ; preds = %6
br label %11
11: ; preds = %10, %1
%12 = load i32, i32* %3
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 122
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %2
br label %28
18: ; preds = %14
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %3
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %3
%24 = icmp sle i32 %23, 57
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 1, i32* %2
br label %28
26: ; preds = %22
br label %27
27: ; preds = %26, %19
store i32 0, i32* %2
br label %28
28: ; preds = %27, %25, %17, %9
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int SPI_CS_HIGH;
int SPI_getMode(int);
int SPI_setMode(int, int);
int SPI_setCSActiveLow(int spidev_fd) {
  int mode = SPI_getMode(spidev_fd);
  if (mode < 0)
    return -1;
  return SPI_setMode(spidev_fd, mode & ~SPI_CS_HIGH);
}


x86 assembly (clang, -O0):
<SPI_setCSActiveLow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <SPI_getMode@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <SPI_setCSActiveLow+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <SPI_setCSActiveLow+0x48>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <SPI_setMode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_setCSActiveLow>:
push   %rbx
mov    %edi,%ebx
call   1040 <SPI_getMode@plt>
test   %eax,%eax
js     1143 <SPI_setCSActiveLow+0x23>
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <SPI_setMode@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SPI_CS_HIGH = global i32 0
define i32 @SPI_setCSActiveLow(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @SPI_getMode(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* @SPI_CS_HIGH
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
%16 = call i32 @SPI_setMode(i32 %11, i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@SPI_CS_HIGH = global i32 0
define i32 @SPI_setCSActiveLow(i32 %0) {
%2 = tail call i32 @SPI_getMode(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @SPI_CS_HIGH
%6 = xor i32 %5, -1
%7 = and i32 %2, %6
%8 = tail call i32 @SPI_setMode(i32 %0, i32 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}
double *mult3(const double a[], double b, double result[]) {
  result[0] = a[0] * b;
  result[1] = a[1] * b;
  result[2] = a[2] * b;
  return result;
}


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

x86 assembly (clang, -O2):
<mult3>:
mov    %rsi,%rax
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsi)
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define double* @mult3(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double, double* %5
%18 = fmul double %16, %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
store double %18, double* %20
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = load double, double* %5
%25 = fmul double %23, %24
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
%28 = load double*, double** %6
ret double* %28
}

LLVM IR (-O2):
define double* @mult3(double* nocapture %0, double %1, double* returned writeonly %2) {
%4 = load double, double* %0
%5 = fmul double %4, %1
store double %5, double* %2
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %1
%9 = getelementptr inbounds double, double* %2, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = fmul double %11, %1
%13 = getelementptr inbounds double, double* %2, i64 2
store double %12, double* %13
ret double* %2
}
int rsh_inbounds(int a, int b) { return a >> b; }


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

x86 assembly (clang, -O2):
<rsh_inbounds>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @rsh_inbounds(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
pid_t _getpid(void) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_getpid>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_getpid>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @_getpid() {
%1 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @_getpid() {
%1 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pr4759_aux(int *);
void pr4759() {
  int *p;
  pr4759_aux(p);
}


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

x86 assembly (clang, -O2):
<pr4759>:
jmp    1030 <pr4759_aux@plt>

LLVM IR (-O0):
define void @pr4759() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @pr4759_aux(i32* %2)
ret void
}

LLVM IR (-O2):
define void @pr4759() {
%1 = tail call i32 @pr4759_aux(i32* undef)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int mixed_volume(int *mv) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(78, mv, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<mixed_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x4e,%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):
<mixed_volume>:
mov    %rdi,%rsi
mov    $0x4e,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @mixed_volume(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 78, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void __ashldi3(int64_t a, unsigned int b) {}


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

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

LLVM IR (-O0):
define void @__ashldi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @__ashldi3(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ __builtin_pow10l(long double);
int /*<<< orphan*/ link_failure_builtin_pow10l();
void test_builtin_pow10l(long double ld) {
  if (__builtin_pow10l(ld) != __builtin_pow10l(ld))
    link_failure_builtin_pow10l();
}


x86 assembly (clang, -O0):
<test_builtin_pow10l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_pow10l@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <__builtin_pow10l@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_builtin_pow10l+0x43>
mov    $0x0,%al
call   1030 <link_failure_builtin_pow10l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_pow10l>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_pow10l@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <__builtin_pow10l@plt>
cmp    %rax,%rbx
jne    1151 <test_builtin_pow10l+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_pow10l@plt>

LLVM IR (-O0):
define void @test_builtin_pow10l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @__builtin_pow10l(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @__builtin_pow10l(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_builtin_pow10l()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_builtin_pow10l(x86_fp80 %0) {
%2 = tail call i64 @__builtin_pow10l(x86_fp80 %0)
%3 = tail call i64 @__builtin_pow10l(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_pow10l()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
scalar_t__ alloca(int);
int /*<<< orphan*/ test11a(char *);
void __attribute__((no)) test11(void) {
  char *save = (char *)alloca(4);
  test11a(save);
}


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

x86 assembly (clang, -O2):
<test11>:
push   %rax
mov    $0x4,%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <test11a@plt>

LLVM IR (-O0):
define void @test11() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @test11a(i8* %4)
ret void
}

LLVM IR (-O2):
define void @test11() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @test11a(i8* %2)
ret void
}
void solveSudoku() {}


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

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

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

LLVM IR (-O2):
define void @solveSudoku() {
ret void
}
int execve(const char *filename, char *const argv[], char *const envp[]) {
  int result;
  asm("movl $11, %%eax;"
      "int $0x80;"
      : "=a"(result)
      : "b"(filename), "c"(argv), "d"(envp));
  return result;
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    $0xb,%eax
int    $0x80
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0xb,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = call i32 asm "movl $$11, %eax;int $$0x80;", "={ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8** %9, i8** %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @execve(i8* readnone %0, i8** readnone %1, i8** readnone %2) {
%4 = tail call i32 asm "movl $$11, %eax;int $$0x80;", "={ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8** %1, i8** %2)
ret i32 %4
}
void foo766(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo766(i32 %0) {
ret void
}
int test_imm_92uint16_reg(unsigned short val) {
  return ((val) & (0x92 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_92uint16_reg>:
test   $0x92,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_92uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 146
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int IN_CLASSD(int /*<<< orphan*/);
int isMulticast(uint32_t prefix) { return IN_CLASSD(prefix); }


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

x86 assembly (clang, -O2):
<isMulticast>:
jmp    1030 <IN_CLASSD@plt>

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

LLVM IR (-O2):
define i32 @isMulticast(i32 %0) {
%2 = tail call i32 @IN_CLASSD(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef union cfglist {
  int dummy;
} cfglist;
struct program {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct program *);
int free_program(union cfglist *cl, void *param) {
  struct program *program;
  if (cl == NULL) {
    return 0;
  }
  program = (struct program *)cl;
  free(program);
  return 0;
}


x86 assembly (clang, -O0):
<free_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <free_program+0x27>
movl   $0x0,-0x4(%rbp)
jmp    114f <free_program+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_program>:
test   %rdi,%rdi
je     111f <free_program+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
%union.cfglist = type { i32 }
%struct.program = type { i32 }
define i32 @free_program(%union.cfglist* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %union.cfglist*
%5 = alloca i8*
%6 = alloca %struct.program*
store %union.cfglist* %0, %union.cfglist** %4
store i8* %1, i8** %5
%7 = load %union.cfglist*, %union.cfglist** %4
%8 = icmp eq %union.cfglist* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %15
10: ; preds = %2
%11 = load %union.cfglist*, %union.cfglist** %4
%12 = bitcast %union.cfglist* %11 to %struct.program*
store %struct.program* %12, %struct.program** %6
%13 = load %struct.program*, %struct.program** %6
%14 = call i32 @free(%struct.program* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%union.cfglist = type { i32 }
%struct.program = type { i32 }
define i32 @free_program(%union.cfglist* %0, i8* nocapture readnone %1) {
%3 = icmp eq %union.cfglist* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast %union.cfglist* %0 to %struct.program*
%6 = tail call i32 @free(%struct.program* %5)
br label %7
7: ; preds = %2, %4
ret i32 0
}
/* Variables and functions */
scalar_t__ LoadSourceFile(char const *);
int PC_LoadSourceHandle(const char *filename) {
  return (int)LoadSourceFile(filename);
}


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

x86 assembly (clang, -O2):
<PC_LoadSourceHandle>:
jmp    1030 <LoadSourceFile@plt>

LLVM IR (-O0):
define i32 @PC_LoadSourceHandle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @LoadSourceFile(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @PC_LoadSourceHandle(i8* %0) {
%2 = tail call i64 @LoadSourceFile(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *_strchr(char *, char);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *s = "apple";
  char c = 'l';
  char *p = _strchr(s, c);
  printf("%c\n", *p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movb   $0x6c,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <_strchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    0xeac(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"apple\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i8 108, i8* %3
%5 = load i8*, i8** %2
%6 = load i8, i8* %3
%7 = call i8* @_strchr(i8* %5, i8 signext %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"apple\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i8* @_strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 108)
%2 = load i8, i8* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gpio_timer();
void timer_init(void) { gpio_timer(); }


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

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

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

LLVM IR (-O2):
define void @timer_init() {
%1 = tail call i32 (...) @gpio_timer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayMenuEntry(int, char *);
void displayMenu() {
  displayMenuEntry(1, "Addition");
  displayMenuEntry(2, "Substraction");
  displayMenuEntry(3, "Multiplication");
  displayMenuEntry(4, "XOR");
  displayMenuEntry(5, "Exit");
}


x86 assembly (clang, -O0):
<displayMenu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <displayMenuEntry@plt>
mov    $0x2,%edi
lea    0xed8(%rip),%rsi
call   1030 <displayMenuEntry@plt>
mov    $0x3,%edi
lea    0xed4(%rip),%rsi
call   1030 <displayMenuEntry@plt>
mov    $0x4,%edi
lea    0xed2(%rip),%rsi
call   1030 <displayMenuEntry@plt>
mov    $0x5,%edi
lea    0xec5(%rip),%rsi
call   1030 <displayMenuEntry@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayMenu>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <displayMenuEntry@plt>
lea    0xee0(%rip),%rsi
mov    $0x2,%edi
call   1030 <displayMenuEntry@plt>
lea    0xedc(%rip),%rsi
mov    $0x3,%edi
call   1030 <displayMenuEntry@plt>
lea    0xeda(%rip),%rsi
mov    $0x4,%edi
call   1030 <displayMenuEntry@plt>
lea    0xecd(%rip),%rsi
mov    $0x5,%edi
pop    %rax
jmp    1030 <displayMenuEntry@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Addition\00"
@.str.1 = [13 x i8] c"Substraction\00"
@.str.2 = [15 x i8] c"Multiplication\00"
@.str.3 = [4 x i8] c"XOR\00"
@.str.4 = [5 x i8] c"Exit\00"
define void @displayMenu() {
%1 = call i32 @displayMenuEntry(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @displayMenuEntry(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @displayMenuEntry(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @displayMenuEntry(i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @displayMenuEntry(i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Addition\00"
@.str.1 = [13 x i8] c"Substraction\00"
@.str.2 = [15 x i8] c"Multiplication\00"
@.str.3 = [4 x i8] c"XOR\00"
@.str.4 = [5 x i8] c"Exit\00"
define void @displayMenu() {
%1 = tail call i32 @displayMenuEntry(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @displayMenuEntry(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @displayMenuEntry(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @displayMenuEntry(i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @displayMenuEntry(i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hexdump_eol(void) { printf("\n"); }


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

x86 assembly (clang, -O2):
<hexdump_eol>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @hexdump_eol() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void exploit() { system("/bin/sh"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define void @exploit() {
%1 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define void @exploit() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void rop3_36_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_36_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_36_0_0>:
xor    %esi,%edx
mov    (%rdi),%al
xor    %sil,%al
and    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_36_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = and i8 %6, %4
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int *allocRecord(int size) {
  int i;
  int *p, *a;
  p = a = (int *)malloc(size);
  for (i = 0; i < size; i += sizeof(int))
    *p++ = 0;
  return a;
}


x86 assembly (clang, -O0):
<allocRecord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1163 <allocRecord+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
movslq -0x8(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x8(%rbp)
jmp    1132 <allocRecord+0x22>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocRecord>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <allocRecord+0x29>
add    $0xffffffff,%ebx
and    $0xfffffffc,%ebx
add    $0x4,%rbx
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32* @allocRecord(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
%6 = add nsw i32 %0, -1
%7 = and i32 %6, -4
%8 = zext i32 %7 to i64
%9 = add nuw nsw i64 %8, 4
br label %10
10: ; preds = %4, %1
%11 = inttoptr i64 %2 to i32*
ret i32* %11
}
void gtk_label_get_mnemonic_widget() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ RTI_WriteItemEx(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/ const *);
uint_fast8_t RTI_WriteItem(uint8_t ui8ItemID, uint8_t ui8Length,
                           const uint8_t *pui8Value) {
  return RTI_WriteItemEx(0xFF, ui8ItemID, ui8Length, pui8Value);
}


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

x86 assembly (clang, -O2):
<RTI_WriteItem>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0xff,%edi
jmp    1030 <RTI_WriteItemEx@plt>

LLVM IR (-O0):
define i32 @RTI_WriteItem(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 @RTI_WriteItemEx(i32 255, i32 %7, i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @RTI_WriteItem(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @RTI_WriteItemEx(i32 255, i32 %0, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ printf(char *);
int main() {
  char *args[2];
  printf("I am going to exec an 'ls' program in current process\n");
  args[0] = "ls";
  args[1] = 0;
  execv("/bin/ls", args);
  printf("I execed 'ls' program\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf01(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xee5(%rip),%rdi
call   1040 <execv@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xeb5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execv@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [55 x i8] c"I am going to exec an 'ls' program in current process\0A\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [8 x i8] c"/bin/ls\00"
@.str.3 = [23 x i8] c"I execed 'ls' program\0A\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%6 = call i32 @execv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [8 x i8] c"/bin/ls\00"
@str = [54 x i8] c"I am going to exec an 'ls' program in current process\00"
@str.4 = [22 x i8] c"I execed 'ls' program\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %5
%6 = call i32 @execv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %4)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ h_free(void *);
void component_background_free(void *handle) { h_free(handle); }


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

x86 assembly (clang, -O2):
<component_background_free>:
jmp    1030 <h_free@plt>

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

LLVM IR (-O2):
define void @component_background_free(i8* %0) {
%2 = tail call i32 @h_free(i8* %0)
ret void
}
/* Variables and functions */
int break_loop(int, int);
int break_constant_FP(int p) { return break_loop(p, -1); }


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

x86 assembly (clang, -O2):
<break_constant_FP>:
mov    $0xffffffff,%esi
jmp    1030 <break_loop@plt>

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

LLVM IR (-O2):
define i32 @break_constant_FP(i32 %0) {
%2 = tail call i32 @break_loop(i32 %0, i32 -1)
ret i32 %2
}
int bmk_cpu_sched_switch(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<bmk_cpu_sched_switch>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <bmk_cpu_sched_switch+0x9>
jmp    1109 <bmk_cpu_sched_switch+0x9>

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

LLVM IR (-O0):
define i32 @bmk_cpu_sched_switch() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define i32 @bmk_cpu_sched_switch() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
bool nrf52_errata_178(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_178() {
ret i32 0
}
void flush_cache(void) {}


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

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

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

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