xunge/DecIR huggingface dataset:
invo_name() {
  register int *ip;
  ip = 0;
  while (*--ip != -1)
    ;
  while (*--ip < 0)
    ;
  return (ip[2]);
}


x86 assembly (clang, -O0):
<invo_name>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0xffffffff,-0x4(%rax)
je     112a <invo_name+0x2a>
jmp    110c <invo_name+0xc>
jmp    112f <invo_name+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,-0x4(%rax)
jge    114d <invo_name+0x4d>
jmp    112f <invo_name+0x2f>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invo_name>:
mov    $0x8,%eax
mov    $0xfffffffffffffffc,%rcx
nopl   0x0(%rax)
add    $0xfffffffffffffffc,%rax
cmpl   $0xffffffff,(%rcx)
lea    -0x4(%rcx),%rcx
jne    1110 <invo_name+0x10>
nopl   (%rax)
cmpl   $0x0,-0xc(%rax)
lea    -0x4(%rax),%rax
js     1120 <invo_name+0x20>
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @invo_name() {
br label %1
1: ; preds = %1, %0
%2 = phi i32* [ null, %0 ], [ %3, %1 ]
%3 = getelementptr inbounds i32, i32* %2, i64 -1
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32* [ %8, %6 ], [ %3, %1 ]
%8 = getelementptr inbounds i32, i32* %7, i64 -1
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6
%12 = getelementptr inbounds i32, i32* %7, i64 1
%13 = load i32, i32* %12
ret i32 %13
}
int test_imm_60int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x60 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_60int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 96
%7 = icmp ne i64 %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_60int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6291456
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exist(char *filename) {
  FILE *file;
  if ((file = fopen(filename, "rt"))) {
    fclose(file);
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <file_exist+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <file_exist+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
define i32 @file_exist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sd_send_cmd_param(int /*<<< orphan*/, int /*<<< orphan*/);
uint8_t sd_send_cmd(uint8_t cmd) { return sd_send_cmd_param(cmd, 0); }


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

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

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

LLVM IR (-O2):
define i32 @sd_send_cmd(i32 %0) {
%2 = tail call i32 @sd_send_cmd_param(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ ft_isascii(char);
int ft_sisascii(char *s) {
  while (*s) {
    if (ft_isascii(*s))
      s++;
    else
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_sisascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <ft_sisascii+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ft_isascii@plt>
cmp    $0x0,%rax
je     1150 <ft_sisascii+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    115c <ft_sisascii+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1168 <ft_sisascii+0x58>
jmp    111c <ft_sisascii+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sisascii>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114c <ft_sisascii+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <ft_isascii@plt>
test   %rax,%rax
je     114a <ft_sisascii+0x3a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_sisascii+0x20>
jmp    114c <ft_sisascii+0x3c>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_sisascii(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i64 @ft_isascii(i8 signext %8)
%11 = icmp eq i64 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int f(int *, int *, int);
int *pre_process(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[8] = {2, 4, 1, 16, 7, 5, 11, 9};
  int *b = pre_process(array, 8);
  int max = f(array, b, 8);
  printf("max =%d\n  ", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1050 <pre_process@plt>
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x8,%edx
call   1030 <f@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <pre_process@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
call   1030 <f@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [8 x i32] [i32 2, i32 4, i32 1, i32 16, i32 7, i32 5, i32 11, i32 9]
@.str = [11 x i8] c"max =%d\0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [8 x i32]* %2 to i8*
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%7 = call i32* @pre_process(i32* %6, i32 8)
store i32* %7, i32** %3
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i32 @f(i32* %8, i32* %9, i32 8)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [8 x i32] [i32 2, i32 4, i32 1, i32 16, i32 7, i32 5, i32 11, i32 9]
@.str = [11 x i8] c"max =%d\0A \00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32* @pre_process(i32* %3, i32 8)
%5 = call i32 @f(i32* %3, i32* %4, i32 8)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test12(void) { return test_sat_parser_should_fail("(a or -bc)^"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"(a or -bc)^\00"
define i32 @test12() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"(a or -bc)^\00"
define i32 @test12() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void __asan_before_dynamic_init(const char *module_name) {}


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

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

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

LLVM IR (-O2):
define void @__asan_before_dynamic_init(i8* nocapture %0) {
ret void
}
number(s) char *s;
{
  int n, c;
  n = 0;
  while (c = *s++) {
    if (c < '0' || c > '9')
      return (-1);
    n = n * 10 + c - '0';
  }
  return (n);
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     115f <number+0x5f>
cmpl   $0x30,-0x18(%rbp)
jl     1141 <number+0x41>
cmpl   $0x39,-0x18(%rbp)
jle    114d <number+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <number+0x65>
imul   $0xa,-0x14(%rbp),%eax
add    -0x18(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <number+0xf>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
mov    (%rdi),%cl
test   %cl,%cl
je     1130 <number+0x30>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    -0x3a(%rcx),%edx
cmp    $0xf6,%dl
jb     1133 <number+0x33>
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <number+0x10>
ret
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @number(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %6
6: ; preds = %19, %1
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
store i32 %10, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %6
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 48
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 57
br i1 %17, label %18, label %19
18: ; preds = %15, %12
store i32 -1, i32* %2
br label %27
19: ; preds = %15
%20 = load i32, i32* %4
%21 = mul nsw i32 %20, 10
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
%24 = sub nsw i32 %23, 48
store i32 %24, i32* %4
br label %6
25: ; preds = %6
%26 = load i32, i32* %4
store i32 %26, i32* %2
br label %27
27: ; preds = %25, %18
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %16, %11 ], [ %2, %1 ]
%6 = phi i8* [ %8, %11 ], [ %0, %1 ]
%7 = phi i32 [ %15, %11 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add i8 %5, -58
%10 = icmp ult i8 %9, -10
br i1 %10, label %18, label %11
11: ; preds = %4
%12 = zext i8 %5 to i32
%13 = mul nsw i32 %7, 10
%14 = add i32 %13, -48
%15 = add i32 %14, %12
%16 = load i8, i8* %8
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %4, %11, %1
%19 = phi i32 [ 0, %1 ], [ %15, %11 ], [ -1, %4 ]
ret i32 %19
}
void term_OSProfileClear(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo675() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  ((void)argc);
  ((void)argv);
  printf("POLARSSL_RSA_C and/or POLARSSL_X509_CRT_PARSE_C "
         "POLARSSL_FS_IO and/or POLARSSL_X509_CRL_PARSE_C "
         "not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [110 x i8] c"POLARSSL_RSA_C and/or POLARSSL_X509_CRT_PARSE_C POLARSSL_FS_IO and/or POLARSSL_X509_CRL_PARSE_C not defined.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [109 x i8] c"POLARSSL_RSA_C and/or POLARSSL_X509_CRT_PARSE_C POLARSSL_FS_IO and/or POLARSSL_X509_CRL_PARSE_C not defined.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([109 x i8], [109 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_in(int tok, int *toks) {
  int *t = toks;
  while (*t) {
    if (*t == tok)
      return t - toks;
    t++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<is_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1157 <is_in+0x57>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1146 <is_in+0x46>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x4(%rbp)
jmp    115e <is_in+0x5e>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <is_in+0x13>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in>:
mov    (%rsi),%edx
mov    $0xffffffff,%eax
test   %edx,%edx
je     1120 <is_in+0x20>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edi,%edx
je     1121 <is_in+0x21>
mov    0x4(%rsi,%rcx,4),%edx
add    $0x1,%rcx
test   %edx,%edx
jne    1110 <is_in+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in(i32 %0, i32* %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %15
%6 = phi i32 [ %17, %15 ], [ %3, %2 ]
%7 = phi i32* [ %16, %15 ], [ %1, %2 ]
%8 = icmp eq i32 %6, %0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = ptrtoint i32* %7 to i64
%11 = ptrtoint i32* %1 to i64
%12 = sub i64 %10, %11
%13 = lshr exact i64 %12, 2
%14 = trunc i64 %13 to i32
br label %19
15: ; preds = %5
%16 = getelementptr inbounds i32, i32* %7, i64 1
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %15, %2, %9
%20 = phi i32 [ %14, %9 ], [ -1, %2 ], [ -1, %15 ]
ret i32 %20
}
/* Variables and functions */
long d64_block_offset(int, int /*<<< orphan*/);
long d64_track_offset(int track) { return d64_block_offset(track, 0); }


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

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

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

LLVM IR (-O2):
define i64 @d64_track_offset(i32 %0) {
%2 = tail call i64 @d64_block_offset(i32 %0, i32 0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ DIST_POINT_NAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ DIST_POINT_NAME_it;
void DIST_POINT_NAME_free(DIST_POINT_NAME *a) {
  ASN1_item_free((ASN1_VALUE *)a, &DIST_POINT_NAME_it);
}


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

x86 assembly (clang, -O2):
<DIST_POINT_NAME_free>:
mov    0x2ed9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@DIST_POINT_NAME_it = global i32 0
define void @DIST_POINT_NAME_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @DIST_POINT_NAME_it)
ret void
}

LLVM IR (-O2):
@DIST_POINT_NAME_it = global i32 0
define void @DIST_POINT_NAME_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @DIST_POINT_NAME_it)
ret void
}
int sys$rundwn(int mode) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)(mode);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(68), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$rundwn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x44,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$rundwn>:
movslq %edi,%rdi
mov    $0x44,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$rundwn"(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$rundwn"(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Colleen();
int main() {
  Colleen();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Colleen()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Colleen()
ret i32 0
}
void dosomething(int *ptr) {
  int temp = 32 + 12;
  *ptr = temp;
}


x86 assembly (clang, -O0):
<dosomething>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dosomething>:
movl   $0x2c,(%rdi)
ret

LLVM IR (-O0):
define void @dosomething(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 44, i32* %3
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
store i32 %4, i32* %5
ret void
}

LLVM IR (-O2):
define void @dosomething(i32* nocapture writeonly %0) {
store i32 44, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int pthread_join(int /*<<< orphan*/, void **);
extern int __async_wait(void *handle, void **result) {
  int ret = pthread_join(*((pthread_t *)handle), result);
  free(handle);
  return ret;
}


x86 assembly (clang, -O0):
<__async_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_join@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__async_wait>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <pthread_join@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__async_wait(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8**, i8*** %4
%10 = call i32 @pthread_join(i32 %8, i8** %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @__async_wait(i8* nocapture %0, i8** %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @pthread_join(i32 %4, i8** %1)
%6 = tail call i32 @free(i8* %0)
ret i32 %5
}
/* Variables and functions */
int colorRead(char, int, int);
int detectColor(char outputPin) {
  int red = colorRead(outputPin, 1, 1);
  int green = colorRead(outputPin, 2, 1);
}


x86 assembly (clang, -O0):
<detectColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
movsbl -0x5(%rbp),%edi
mov    %edx,%esi
call   1030 <colorRead@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%esi
mov    $0x1,%edx
movsbl -0x5(%rbp),%edi
call   1030 <colorRead@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detectColor>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <colorRead@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <colorRead@plt>

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

LLVM IR (-O2):
define i32 @detectColor(i8 signext %0) {
%2 = tail call i32 @colorRead(i8 signext %0, i32 1, i32 1)
%3 = tail call i32 @colorRead(i8 signext %0, i32 2, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int i) { assert(i != i + 1); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = icmp ne i32 %4, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @assert(i32 1)
ret i32 undef
}
int add(int value1, int value2) { return value1 + value2; }


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

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

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int pthread_mutex_lock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_mutex_lock() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
void report(const char *prefix, const char *err, va_list params) {
  char msg[1024];
  vsnprintf(msg, sizeof(msg), err, params);
  fprintf(stderr, " %s%s\n", prefix, msg);
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    -0x420(%rbp),%rcx
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c" %s%s\0A\00"
define void @report(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i8* %8, i32 1024, i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %4
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c" %s%s\0A\00"
define void @report(i8* %0, i8* nocapture %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @vsnprintf(i8* %5, i32 1024, i8* %1, i32 %2)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5)
ret void
}
unsigned char bcd2CharToDec(unsigned char bcd) {
  int decimal;
  decimal = bcd >> 4;
  decimal = decimal * 10;
  decimal = decimal + (bcd & 0x0F);
  return decimal;
}


x86 assembly (clang, -O0):
<bcd2CharToDec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2CharToDec>:
mov    %edi,%eax
shr    $0x4,%al
movzbl %al,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%dil
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @bcd2CharToDec(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 4
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 10
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 15
%13 = add nsw i32 %9, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @bcd2CharToDec(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = mul nuw i8 %2, 10
%4 = and i8 %0, 15
%5 = add nuw i8 %3, %4
ret i8 %5
}
void g_bit_storage() {}


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

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

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

LLVM IR (-O2):
define void @g_bit_storage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_array(char const **);
int main(int argc, char *argv[]) {
  const char *a[] = {"One", "Two", NULL};
  print_array(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ccd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"One\00"
@.str.1 = [4 x i8] c"Two\00"
@__const.main.a = [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i8*]* %6 to i8*
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %6, i64 0, i64 0
%9 = call i32 @print_array(i8** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"One\00"
@.str.1 = [4 x i8] c"Two\00"
@__const.main.a = [3 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8*]
%4 = bitcast [3 x i8*]* %3 to i8*
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%6 = call i32 @print_array(i8** %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ syslog(int, char *, char const *);
void sys_log(void *data, int priority, const char *file, int line,
             const char *string) {
  syslog(priority, "%s", string);
}


x86 assembly (clang, -O0):
<sys_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x28(%rbp),%rdx
lea    0xec8(%rip),%rsi
call   1030 <syslog@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_log>:
mov    %r8,%rdx
mov    %esi,%edi
lea    0xee4(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @sys_log(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = load i8*, i8** %10
%13 = call i32 @syslog(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @sys_log(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* %4) {
%6 = tail call i32 @syslog(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ owner;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
unsigned long get_XSelectionRequestEvent_owner(void *_p) {
  return (unsigned long)((XSelectionRequestEvent *)_p)->owner;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSelectionRequestEvent_owner(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSelectionRequestEvent_owner(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void test_func(void) {
  static volatile int counter = 0;
  counter++;
}


x86 assembly (clang, -O0):
<test_func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func>:
addl   $0x1,0x2f1d(%rip)
ret

LLVM IR (-O0):
@test_func.counter = internal global i32 0
define void @test_func() {
%1 = load volatile i32, i32* @test_func.counter
%2 = add nsw i32 %1, 1
store volatile i32 %2, i32* @test_func.counter
ret void
}

LLVM IR (-O2):
@test_func.counter = internal global i32 0
define void @test_func() {
%1 = load volatile i32, i32* @test_func.counter
%2 = add nsw i32 %1, 1
store volatile i32 %2, i32* @test_func.counter
ret void
}
int geteuid(void) { return 1000; }


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

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

LLVM IR (-O0):
define i32 @geteuid() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 1000
}
int ft_isalnum(int c) {
  if ((c >= 48 && c <= 57) || (c >= 65 && c <= 90) || (c >= 97 && c <= 122))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     111b <ft_isalnum+0x1b>
cmpl   $0x39,-0x8(%rbp)
jle    1143 <ft_isalnum+0x43>
cmpl   $0x41,-0x8(%rbp)
jl     112f <ft_isalnum+0x2f>
cmpl   $0x5a,-0x8(%rbp)
jle    1143 <ft_isalnum+0x43>
cmpl   $0x61,-0x8(%rbp)
jl     114f <ft_isalnum+0x4f>
cmpl   $0x7a,-0x8(%rbp)
jg     114f <ft_isalnum+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_isalnum+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ regmatch_t;
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int regexec(int /*<<< orphan*/ const *, char const *, size_t,
            int /*<<< orphan*/ *, int);
__attribute__((__weak__, __always___)) int
softboundcets_regexec(const regex_t *preg, const char *string, size_t nmatch,
                      regmatch_t pmatch[], int eflags) {
  return regexec(preg, string, nmatch, pmatch, eflags);
}


x86 assembly (clang, -O0):
<softboundcets_regexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <regexec@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_regexec>:
jmp    1030 <regexec@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_regexec(i32* %0, i8* %1, i64 %2, i32* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @regexec(i32* %11, i8* %12, i64 %13, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define weak i32 @softboundcets_regexec(i32* %0, i8* %1, i64 %2, i32* %3, i32 %4) {
%6 = tail call i32 @regexec(i32* %0, i8* %1, i64 %2, i32* %3, i32 %4)
ret i32 %6
}
int f(int x) {
  for (int i = 0; i < 10; i++) {
    x = x + i;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112f <f+0x2f>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <f+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x2d(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add i32 %0, 45
ret i32 %2
}
/* Variables and functions */
long labs(long);
int /*<<< orphan*/ printf(char *, long);
int main() {
  long int a, b;
  a = labs(65987L);
  printf("Value of a = %ld\n", a);
  b = labs(-1005090L);
  printf("Value of b = %ld\n", b);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x101c3,%edi
call   1030 <labs@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffffff0a9de,%rdi
call   1030 <labs@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"Value of a = %ld\0A\00"
@.str.1 = [18 x i8] c"Value of b = %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i64 @labs(i64 65987)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = call i64 @labs(i64 -1005090)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Value of a = %ld\0A\00"
@.str.1 = [18 x i8] c"Value of b = %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 65987)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 1005090)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MCUSendCmdOverlayCtrl(int);
void MCUSendCmdOverlayCtrlStop() { MCUSendCmdOverlayCtrl(1); }


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

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

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

LLVM IR (-O2):
define void @MCUSendCmdOverlayCtrlStop() {
%1 = tail call i32 @MCUSendCmdOverlayCtrl(i32 1)
ret void
}
/* Variables and functions */
double log(double);
double sd_c(double pd, double T) {
  return 6864.8 + 1004.0 * log(T / 298.15) - 287.1 * log(pd / 100000.0);
}


x86 assembly (clang, -O0):
<sd_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xef1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  0xed0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe88(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_c>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
divsd  0xede(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0xed5(%rip),%xmm0
addsd  0xed5(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0xec9(%rip),%xmm0
call   1030 <log@plt>
mulsd  0xec4(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @sd_c(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fdiv double %5, 2.981500e+02
%7 = call double @log(double %6)
%8 = call double @llvm.fmuladd.f64(double 1.004000e+03, double %7, double 6.864800e+03)
%9 = load double, double* %3
%10 = fdiv double %9, 1.000000e+05
%11 = call double @log(double %10)
%12 = call double @llvm.fmuladd.f64(double -2.871000e+02, double %11, double %8)
ret double %12
}

LLVM IR (-O2):
define double @sd_c(double %0, double %1) {
%3 = fdiv double %1, 2.981500e+02
%4 = tail call double @log(double %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.004000e+03, double 6.864800e+03)
%6 = fdiv double %0, 1.000000e+05
%7 = tail call double @log(double %6)
%8 = tail call double @llvm.fmuladd.f64(double %7, double -2.871000e+02, double %5)
ret double %8
}