xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ srand(unsigned int);
void tkInitRandom() {
  unsigned int ticks;
  struct timeval tv;
  gettimeofday(&tv, 0);
  ticks = tv.tv_sec + tv.tv_usec;
  srand(ticks);
}


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

x86 assembly (clang, -O2):
<tkInitRandom>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x4(%rsp),%edi
add    (%rsp),%edi
call   1040 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @tkInitRandom() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add i32 %5, %7
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = call i32 @srand(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @tkInitRandom() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = add i32 %7, %5
%9 = call i32 @srand(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkIfStrCharsAreUnique(char *);
int main(int argc, const char *argv[]) {
  char str[] = "abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()?";
  checkIfStrCharsAreUnique(str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <checkIfStrCharsAreUnique@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [48 x i8] c"abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()?\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [48 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [48 x i8]* %6 to i8*
%8 = getelementptr inbounds [48 x i8], [48 x i8]* %6, i64 0, i64 0
%9 = call i32 @checkIfStrCharsAreUnique(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [48 x i8] c"abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()?\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [48 x i8]
%4 = getelementptr inbounds [48 x i8], [48 x i8]* %3, i64 0, i64 0
%5 = call i32 @checkIfStrCharsAreUnique(i8* %4)
ret i32 0
}
OP(ed, fb) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *filename) {
  int exists = 0;
  FILE *fp = NULL;
  if ((fp = fopen(filename, "r")) != NULL)
    exists = 1;
  if (fp)
    fclose(fp);
  return exists;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1160 <file_exists+0x40>
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1174 <file_exists+0x54>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <file_exists+0x1d>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 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 = %4, %1
%7 = xor i1 %3, true
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("int size:%d\n", sizeof(int));
  printf("long size:%d\n", sizeof(long));
  printf("long long size:%d\n", sizeof(long long));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"int size:%d\0A\00"
@.str.1 = [14 x i8] c"long size:%d\0A\00"
@.str.2 = [19 x i8] c"long long size:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
int test_imm_28uint32_mem(unsigned int *val) {
  return ((*val) & (0x28 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_28uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 40
%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_28uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 40
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int hash(const char *string) {
  unsigned int hashval = 0;
  while (*string)
    hashval = ((hashval << 5) + hashval) + *string++;
  return hashval;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int qe_inrange(int, char, char);
int qe_islower(int c) { return qe_inrange(c, 'a', 'z'); }


x86 assembly (clang, -O0):
<qe_islower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x61,%esi
mov    $0x7a,%edx
call   1030 <qe_inrange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qe_islower>:
mov    $0x61,%esi
mov    $0x7a,%edx
jmp    1030 <qe_inrange@plt>

LLVM IR (-O0):
define i32 @qe_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @qe_inrange(i32 %3, i8 signext 97, i8 signext 122)
ret i32 %4
}

LLVM IR (-O2):
define i32 @qe_islower(i32 %0) {
%2 = tail call i32 @qe_inrange(i32 %0, i8 signext 97, i8 signext 122)
ret i32 %2
}
int SetParameters(double x[]) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @SetParameters(double* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cursordown(int);
int /*<<< orphan*/ cursorhorizontalabsolute(int);
void cursordown_cursorhorizontalabsolute(void) {
  cursordown(1);
  cursorhorizontalabsolute(1);
}


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

x86 assembly (clang, -O2):
<cursordown_cursorhorizontalabsolute>:
push   %rax
mov    $0x1,%edi
call   1030 <cursordown@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <cursorhorizontalabsolute@plt>

LLVM IR (-O0):
define void @cursordown_cursorhorizontalabsolute() {
%1 = call i32 @cursordown(i32 1)
%2 = call i32 @cursorhorizontalabsolute(i32 1)
ret void
}

LLVM IR (-O2):
define void @cursordown_cursorhorizontalabsolute() {
%1 = tail call i32 @cursordown(i32 1)
%2 = tail call i32 @cursorhorizontalabsolute(i32 1)
ret void
}
int save(unsigned int addr, unsigned int data) {
  *((volatile unsigned int *)addr) = data;
}


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

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

LLVM IR (-O0):
define i32 @save(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %6, i32* %9
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @save(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
ret i32 undef
}
int vde_chain_nm8_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 4;
  if (sz_res)
    *sz_res = 3;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 92;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm8_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm8_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm8_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm8_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm8_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x5c,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm8_work>:
test   %rdi,%rdi
je     110b <vde_chain_nm8_work+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm8_work+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm8_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm8_work+0x2c>
movl   $0x5c,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm8_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 92, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
int test_imm_DEint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xDE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DEint64_highword_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, 32
%6 = and i64 %5, 222
%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_DEint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 953482739712
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ io_clear_bit(int);
int /*<<< orphan*/ io_set_bit(int);
void elev_set_door_open_lamp(int value) {
  if (value)
    io_set_bit((0x300 + 3));
  else
    io_clear_bit((0x300 + 3));
}


x86 assembly (clang, -O0):
<elev_set_door_open_lamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <elev_set_door_open_lamp+0x24>
mov    $0x303,%edi
call   1030 <io_set_bit@plt>
jmp    114e <elev_set_door_open_lamp+0x2e>
mov    $0x303,%edi
call   1040 <io_clear_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elev_set_door_open_lamp>:
test   %edi,%edi
je     112e <elev_set_door_open_lamp+0xe>
mov    $0x303,%edi
jmp    1030 <io_set_bit@plt>
mov    $0x303,%edi
jmp    1040 <io_clear_bit@plt>

LLVM IR (-O0):
define void @elev_set_door_open_lamp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @io_set_bit(i32 771)
br label %9
7: ; preds = %1
%8 = call i32 @io_clear_bit(i32 771)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @elev_set_door_open_lamp(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @io_set_bit(i32 771)
br label %7
5: ; preds = %1
%6 = tail call i32 @io_clear_bit(i32 771)
br label %7
7: ; preds = %5, %3
ret void
}
void HardFault_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @HardFault_Handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
unsigned long long faktrektisk(unsigned long long num) {
  unsigned long long retval;
  if (num == 0)
    retval = 1;
  else
    retval = num * faktrektisk(num - 1);
  printf("%10llu", num);
  printf("%30llu\n", retval);
  return retval;
}


x86 assembly (clang, -O0):
<faktrektisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1144 <faktrektisk+0x24>
movq   $0x1,-0x10(%rbp)
jmp    1168 <faktrektisk+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1040 <faktrektisk@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<faktrektisk>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     113e <faktrektisk+0x1e>
lea    -0x1(%r14),%rdi
call   1040 <faktrektisk@plt>
mov    %rax,%rbx
imul   %r14,%rbx
jmp    1143 <faktrektisk+0x23>
mov    $0x1,%ebx
lea    0xeb6(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%10llu\00"
@.str.1 = [8 x i8] c"%30llu\0A\00"
define i64 @faktrektisk(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add i64 %0, -1
%5 = tail call i64 @faktrektisk(i64 %4)
%6 = mul i64 %5, %0
br label %7
7: ; preds = %1, %3
%8 = phi i64 [ %6, %3 ], [ 1, %1 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ get_value(int /*<<< orphan*/ *, char *, char *, char *);
int get_file_len(FILE *fd) {
  int len = 0;
  char len_str[5000] = {0};
  get_value(fd, "Content-Length: ", "\r\n", len_str);
  len = atoi(len_str);
  return len;
}


x86 assembly (clang, -O0):
<get_file_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13a0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x13a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x1388,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x13a0(%rbp),%rcx
lea    0xe95(%rip),%rsi
lea    0xe9f(%rip),%rdx
call   1040 <get_value@plt>
lea    -0x13a0(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x13a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_len>:
push   %r14
push   %rbx
sub    $0x1388,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x1388,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xeaa(%rip),%rsi
lea    0xeb4(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rcx
call   1040 <get_value@plt>
mov    %r14,%rdi
call   1050 <atoi@plt>
add    $0x1388,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Content-Length: \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define i32 @get_file_len(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [5000 x i8]
store i32* %0, i32** %2
store i32 0, i32* %3
%5 = bitcast [5000 x i8]* %4 to i8*
%6 = load i32*, i32** %2
%7 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%8 = call i32 @get_value(i32* %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [5000 x i8], [5000 x i8]* %4, i64 0, i64 0
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [17 x i8] c"Content-Length: \00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define i32 @get_file_len(i32* %0) {
%2 = alloca [5000 x i8]
%3 = getelementptr inbounds [5000 x i8], [5000 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_value(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @atoi(i8* %3)
ret i32 %5
}
/* Variables and functions */
int dcc_readx(int, char *, int);
int dcc_r_token(int ifd, char *buf) { return dcc_readx(ifd, buf, 4); }


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

x86 assembly (clang, -O2):
<dcc_r_token>:
mov    $0x4,%edx
jmp    1030 <dcc_readx@plt>

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

LLVM IR (-O2):
define i32 @dcc_r_token(i32 %0, i8* %1) {
%3 = tail call i32 @dcc_readx(i32 %0, i8* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *unquote(char const *);
char *newstr(char const *p) {
  char *q = NULL;
  if ((p = unquote(p)) != NULL) {
    int l = strlen(p) + 1;
    if ((q = malloc(l)) != NULL)
      memcpy(q, p, l);
  }
  return q;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <unquote@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     11a5 <newstr+0x65>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11a0 <newstr+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
jmp    11a5 <newstr+0x65>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %rbp
push   %r14
push   %rbx
call   1050 <unquote@plt>
test   %rax,%rax
je     117c <newstr+0x3c>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     117c <newstr+0x3c>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    117e <newstr+0x3e>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @newstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
%6 = call i8* @unquote(i8* %5)
store i8* %6, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %21
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i8* @malloc(i32 %12)
store i8* %13, i8** %3
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %20
15: ; preds = %8
%16 = load i8*, i8** %3
%17 = load i8*, i8** %2
%18 = load i32, i32* %4
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %8
br label %21
21: ; preds = %20, %1
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @newstr(i8* %0) {
%2 = tail call i8* @unquote(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %2)
%6 = add nsw i32 %5, 1
%7 = tail call i8* @malloc(i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @memcpy(i8* %7, i8* %2, i32 %6)
br label %11
11: ; preds = %4, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ null, %4 ]
ret i8* %12
}
int min_int(int a, int b) { return a < b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @min_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ COND_GE();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sge_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_GE() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_sge_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_GE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sge_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_GE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sge_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_GE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sge_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_GE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void gtk_tree_view_column_get_sort_column_id() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_sort_column_id() {
ret void
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return (c + 32);
  else
    return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <ft_tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <ft_tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(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 %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  printf("OK\n");
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
abs(number) int number;
{ return (number < 0 ? -number : number); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int do_961() { return 961; }


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

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

LLVM IR (-O0):
define i32 @do_961() {
ret i32 961
}

LLVM IR (-O2):
define i32 @do_961() {
ret i32 961
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void HpmDisplayLine(char *s, int n) {
  while (n--)
    printf("%c", *s);
  printf("\n");
}


x86 assembly (clang, -O0):
<HpmDisplayLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114d <HpmDisplayLine+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <HpmDisplayLine+0xf>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HpmDisplayLine>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     112e <HpmDisplayLine+0x1e>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
movsbl (%r14),%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <HpmDisplayLine+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @HpmDisplayLine(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = load i8, i8* %0
%8 = sext i8 %7 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = icmp eq i32 %6, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int os_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) {
  return accept(sockfd, addr, addrlen);
}


x86 assembly (clang, -O0):
<os_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <accept@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_accept>:
jmp    1030 <accept@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @os_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @os_accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ necHstate(int /*<<< orphan*/);
void necH1state() { necHstate(0); }


x86 assembly (clang, -O0):
<necH1state>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <necHstate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<necH1state>:
xor    %edi,%edi
jmp    1030 <necHstate@plt>

LLVM IR (-O0):
define void @necH1state() {
%1 = call i32 @necHstate(i32 0)
ret void
}

LLVM IR (-O2):
define void @necH1state() {
%1 = tail call i32 @necHstate(i32 0)
ret void
}
/* Type definitions */
struct Stream_t {
  int dummy;
};
struct Fs_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fat_write(struct Fs_t *);
int fs_flush(struct Stream_t *Stream) {
  struct Fs_t *This = (struct Fs_t *)Stream;
  fat_write(This);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.Stream_t = type { i32 }
%struct.Fs_t = type { i32 }
define i32 @fs_flush(%struct.Stream_t* %0) {
%2 = alloca %struct.Stream_t*
%3 = alloca %struct.Fs_t*
store %struct.Stream_t* %0, %struct.Stream_t** %2
%4 = load %struct.Stream_t*, %struct.Stream_t** %2
%5 = bitcast %struct.Stream_t* %4 to %struct.Fs_t*
store %struct.Fs_t* %5, %struct.Fs_t** %3
%6 = load %struct.Fs_t*, %struct.Fs_t** %3
%7 = call i32 @fat_write(%struct.Fs_t* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.Stream_t = type { i32 }
%struct.Fs_t = type { i32 }
define i32 @fs_flush(%struct.Stream_t* %0) {
%2 = bitcast %struct.Stream_t* %0 to %struct.Fs_t*
%3 = tail call i32 @fat_write(%struct.Fs_t* %2)
ret i32 0
}
unsigned int test_log2(unsigned int v) {
  unsigned c = 0;
  while (v >>= 1) {
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <test_log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <test_log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <test_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void println() {
  int i;
  for (i = 0; i < 50; i++)
    printf("-");
  printf("\n");
}


x86 assembly (clang, -O0):
<println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1143 <println+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <println+0xf>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println>:
push   %rbx
mov    $0x32,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <println+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @println() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @putchar(i32 45)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 50
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @putchar(i32 10)
ret void
}
float flt_cmp_gt(float a, float b, float c, float d) { return (a > b) ? c : d; }


x86 assembly (clang, -O0):
<flt_cmp_gt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1136 <flt_cmp_gt+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1140 <flt_cmp_gt+0x40>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_cmp_gt>:
cmpltss %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm3,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @flt_cmp_gt(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fcmp ogt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load float, float* %7
br label %16
14: ; preds = %4
%15 = load float, float* %8
br label %16
16: ; preds = %14, %12
%17 = phi float [ %13, %12 ], [ %15, %14 ]
ret float %17
}

LLVM IR (-O2):
define float @flt_cmp_gt(float %0, float %1, float %2, float %3) {
%5 = fcmp ogt float %0, %1
%6 = select i1 %5, float %2, float %3
ret float %6
}
/* Variables and functions */
int *foo();
int main() {
  int *a = foo();
  return a[0] + a[1];
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
mov    0x4(%rax),%ecx
add    (%rax),%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* (...) @foo()
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @foo()
%2 = load i32, i32* %1
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
ret i32 %5
}
int ima_inode_removexattr(struct dentry *dentry, const char *xattr_name) {
  return 0;
}


x86 assembly (clang, -O0):
<ima_inode_removexattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.dentry = type opaque
define i32 @ima_inode_removexattr(%struct.dentry* %0, i8* %1) {
%3 = alloca %struct.dentry*
%4 = alloca i8*
store %struct.dentry* %0, %struct.dentry** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @ima_inode_removexattr(%struct.dentry* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ unlambdamarkovcircuit();
int main() {
  printf("Hello world\n");
  unlambdamarkovcircuit();
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @unlambdamarkovcircuit()
ret i32 0
}