xunge/DecIR huggingface dataset:
int test_imm_EAuint32_mem(unsigned int *val) {
  return ((*val) & (0xEA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EAuint32_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, 234
%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_EAuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 234
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ system(char *);
void clearscreen() {
  if (system("cls")) {
    system("clear");
  }
}


x86 assembly (clang, -O0):
<clearscreen>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1136 <clearscreen+0x26>
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearscreen>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
je     112f <clearscreen+0x1f>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"clear\00"
define void @clearscreen() {
%1 = call i64 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i64 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"clear\00"
define void @clearscreen() {
%1 = tail call i64 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int stat(char const *, struct stat *);
unsigned char is_file(const char *path) {
  struct stat inf;
  int res = stat(path, &inf);
  if (res) {
    return 0;
  }
  if (S_ISREG(inf.st_mode)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114f <is_file+0x2f>
movb   $0x0,-0x1(%rbp)
jmp    116e <is_file+0x4e>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     116a <is_file+0x4a>
movb   $0x1,-0x1(%rbp)
jmp    116e <is_file+0x4e>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
je     1131 <is_file+0x11>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define zeroext i8 @is_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i8
br label %12
12: ; preds = %6, %1
%13 = phi i8 [ 0, %1 ], [ %11, %6 ]
ret i8 %13
}
void put2digs(char *at, int what) {
  at[0] = (char)('0' + ((what / 10) % 10));
  at[1] = (char)('0' + (what % 10));
}


x86 assembly (clang, -O0):
<put2digs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put2digs>:
movslq %esi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    $0x30,%sil
mov    %sil,(%rdi)
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,0x1(%rdi)
ret

LLVM IR (-O0):
define void @put2digs(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 10
%7 = srem i32 %6, 10
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = srem i32 %12, 10
%14 = add nsw i32 48, %13
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @put2digs(i8* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 10
%4 = srem i32 %3, 10
%5 = trunc i32 %4 to i8
%6 = add nsw i8 %5, 48
store i8 %6, i8* %0
%7 = srem i32 %1, 10
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 48
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void t14(char a) { free(&a); }


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

x86 assembly (clang, -O2):
<t14>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @t14(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @free(i8* %2)
ret void
}

LLVM IR (-O2):
define void @t14(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int exists(char *filepath) {
  if (access(filepath, F_OK) != -1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     1143 <exists+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <exists+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @F_OK
%6 = call i32 @access(i8* %4, i32 %5)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
int config_MODULE_PANDORA(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @config_MODULE_PANDORA() {
ret i32 1
}

LLVM IR (-O2):
define i32 @config_MODULE_PANDORA() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void test_crash() {
  do {
    printf("test_crash"
           "\n");
    fflush(stdout);
  } while (0);
  {
    printf("about to crash, this will log an error\n");
    int *crash = 0;
    *crash = 1;
  }
}


x86 assembly (clang, -O0):
<test_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"test_crash\0A\00"
@stdout = global i32 0
@.str.1 = [40 x i8] c"about to crash, this will log an error\0A\00"
define void @test_crash() {
%1 = alloca i32*
br label %2
2: ; preds = %0
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
br label %6
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
store i32* null, i32** %1
%8 = load i32*, i32** %1
store i32 1, i32* %8
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [11 x i8] c"test_crash\00"
@str.2 = [39 x i8] c"about to crash, this will log an error\00"
define void @test_crash() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: avroappend [<input avro file>] <output avro file>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: avroappend [<input avro file>] <output avro file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: avroappend [<input avro file>] <output avro file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void cons_clear() { system("cls"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
define void @cons_clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((always_)) int Clamp0To2047(int x) {
  if (x < 0)
    return 0;
  if (x > 2047)
    return 2047;
  return x;
}


x86 assembly (clang, -O0):
<Clamp0To2047>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <Clamp0To2047+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <Clamp0To2047+0x3c>
cmpl   $0x7ff,-0x8(%rbp)
jle    1136 <Clamp0To2047+0x36>
movl   $0x7ff,-0x4(%rbp)
jmp    113c <Clamp0To2047+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clamp0To2047>:
cmp    $0x7ff,%edi
mov    $0x7ff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Clamp0To2047(i32 %0) {
%2 = icmp slt i32 %0, 2047
%3 = select i1 %2, i32 %0, i32 2047
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ hier();
void main() {
  hier();
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hier@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <hier@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @hier()
%2 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @hier()
%2 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_strings(char *array[], size_t len) {
  size_t i;
  for (i = 0; i < len; i++) {
    free(array[i]);
  }
}


x86 assembly (clang, -O0):
<free_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <free_strings+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <free_strings+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_strings>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1142 <free_strings+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_strings+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @free_strings(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @free(i8* %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int __feh;

/* Variables and functions */
int write(int, int *, int);
int bewrite32(int fd, int c) {
  int r;
  do {
    int __feh = c;
    if (!1)
      c = c;
    else
      c = ((((__feh)&0xff000000) >> 24) | (((__feh)&0x00ff0000) >> 8) |
           (((__feh)&0x0000ff00) << 8) | (((__feh)&0x000000ff) << 24));
  } while (0);
  r = write(fd, &c, 4);
  return r;
}


x86 assembly (clang, -O0):
<bewrite32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x10(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bewrite32>:
push   %rax
bswap  %esi
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bewrite32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %2
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = and i32 %9, -16777216
%11 = lshr i32 %10, 24
%12 = load i32, i32* %6
%13 = and i32 %12, 16711680
%14 = ashr i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %6
%17 = and i32 %16, 65280
%18 = shl i32 %17, 8
%19 = or i32 %15, %18
%20 = load i32, i32* %6
%21 = and i32 %20, 255
%22 = shl i32 %21, 24
%23 = or i32 %19, %22
store i32 %23, i32* %4
br label %24
24: ; preds = %7
%25 = load i32, i32* %3
%26 = call i32 @write(i32 %25, i32* %4, i32 4)
store i32 %26, i32* %5
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @bewrite32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @llvm.bswap.i32(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @write(i32 %0, i32* %3, i32 4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void test_close(FILE *file) { fclose(file); }


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

x86 assembly (clang, -O2):
<test_close>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @test_close(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
void foo_2_2_1_1_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_2_2_2_1_1() {
ret void
}
void function_type(char *type) {}


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

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

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

LLVM IR (-O2):
define void @function_type(i8* nocapture %0) {
ret void
}
void runOverflow() {}


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

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

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

LLVM IR (-O2):
define void @runOverflow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int prc_a2(int a) {
  a = a + 20;
  printf("a+20 [%d]\n", a);
  return a;
}


x86 assembly (clang, -O0):
<prc_a2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prc_a2>:
push   %rbx
lea    0x14(%rdi),%ebx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a+20 [%d]\0A\00"
define i32 @prc_a2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 20
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"a+20 [%d]\0A\00"
define i32 @prc_a2(i32 %0) {
%2 = add nsw i32 %0, 20
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}
void __attribute__((always_)) mck_disable_all_irq() {}


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

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

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

LLVM IR (-O2):
define void @mck_disable_all_irq() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void snail_cnt_reset(void) {
  mbus_remote_register_write(0x6, 0x01, ((0 << 5) | (0 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<snail_cnt_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x9,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snail_cnt_reset>:
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x9,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @snail_cnt_reset() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
define void @snail_cnt_reset() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 1, i32 9)
ret void
}
__attribute__((always_)) void __clear_bit_unlock(unsigned nr,
                                                 volatile unsigned long *addr) {
  __asm__ __volatile__("" : : : "memory");
  __clear_bit(nr, addr);
}


x86 assembly (clang, -O0):
<__clear_bit_unlock>:
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    $0x0,%al
call   1030 <__clear_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__clear_bit_unlock(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = load i64*, i64** %4
%7 = call i32 (i32, i64*, ...) bitcast (i32 (...)* @__clear_bit to i32 (i32, i64*, ...)*)(i32 %5, i64* %6)
ret void
}

LLVM IR (-O2):
define void @__clear_bit_unlock(i32 %0, i64* %1) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 (i32, i64*, ...) bitcast (i32 (...)* @__clear_bit to i32 (i32, i64*, ...)*)(i32 %0, i64* %1)
ret void
}
extern void externFunction() {
  printf("__func__ %s\n", __func__);
  printf("__FUNCTION__ %s\n", __FUNCTION__);
  printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
}


x86 assembly (clang, -O0):
<externFunction>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    0xefa(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<externFunction>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeee(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0xefe(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"__func__ %s\0A\00"
@__func__.externFunction = [15 x i8] c"externFunction\00"
@.str.1 = [17 x i8] c"__FUNCTION__ %s\0A\00"
@.str.2 = [25 x i8] c"__PRETTY_FUNCTION__ %s\0A\0A\00"
@__PRETTY_FUNCTION__.externFunction = [22 x i8] c"void externFunction()\00"
define void @externFunction() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.externFunction, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.externFunction, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__PRETTY_FUNCTION__.externFunction, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"__func__ %s\0A\00"
@__func__.externFunction = [15 x i8] c"externFunction\00"
@.str.1 = [17 x i8] c"__FUNCTION__ %s\0A\00"
@.str.2 = [25 x i8] c"__PRETTY_FUNCTION__ %s\0A\0A\00"
@__PRETTY_FUNCTION__.externFunction = [22 x i8] c"void externFunction()\00"
define void @externFunction() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.externFunction, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.externFunction, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__PRETTY_FUNCTION__.externFunction, i64 0, i64 0))
ret void
}
int __test_and_set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % 32));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
  unsigned long old = *p;
  *p = old | mask;
  return (old & mask) != 0;
}


x86 assembly (clang, -O0):
<__test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
or     -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_set_bit>:
lea    0x1f(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%ecx
and    $0xffffffe0,%ecx
sub    %ecx,%edi
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,8),%rcx
mov    %rcx,%rdx
bts    %rdi,%rdx
mov    %rdx,(%rsi,%rax,8)
xor    %eax,%eax
bt     %rdi,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 32
%10 = zext i32 %9 to i64
%11 = shl i64 1, %10
store i64 %11, i64* %5
%12 = load i64*, i64** %4
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 32
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i64, i64* %12, i64 %15
store i64* %16, i64** %6
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = load i64, i64* %5
%21 = or i64 %19, %20
%22 = load i64*, i64** %6
store i64 %21, i64* %22
%23 = load i64, i64* %7
%24 = load i64, i64* %5
%25 = and i64 %23, %24
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @__test_and_set_bit(i32 %0, i64* nocapture %1) {
%3 = srem i32 %0, 32
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 32
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %5
store i64 %10, i64* %8
%11 = and i64 %9, %5
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
double log(double);
double rand_uniopen();
double rand_logistic(void) {
  double u;
  u = rand_uniopen();
  return log(u / (1 - u));
}


x86 assembly (clang, -O0):
<rand_logistic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand_uniopen@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_logistic>:
push   %rax
xor    %eax,%eax
call   1030 <rand_uniopen@plt>
movsd  0xed0(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
jmp    1040 <log@plt>

LLVM IR (-O0):
define double @rand_logistic() {
%1 = alloca double
%2 = call double (...) @rand_uniopen()
store double %2, double* %1
%3 = load double, double* %1
%4 = load double, double* %1
%5 = fsub double 1.000000e+00, %4
%6 = fdiv double %3, %5
%7 = call double @log(double %6)
ret double %7
}

LLVM IR (-O2):
define double @rand_logistic() {
%1 = tail call double (...) @rand_uniopen()
%2 = fsub double 1.000000e+00, %1
%3 = fdiv double %1, %2
%4 = tail call double @log(double %3)
ret double %4
}
long long bit44() { return 0x0000100000000000LL; }


x86 assembly (clang, -O0):
<bit44>:
push   %rbp
mov    %rsp,%rbp
movabs $0x100000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit44>:
movabs $0x100000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit44() {
ret i64 17592186044416
}

LLVM IR (-O2):
define i64 @bit44() {
ret i64 17592186044416
}
/* Variables and functions */
int f407(int *);
int f408(int *p) { return f407(p); }


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

x86 assembly (clang, -O2):
<f408>:
jmp    1030 <f407@plt>

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

LLVM IR (-O2):
define i32 @f408(i32* %0) {
%2 = tail call i32 @f407(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void check_recsize(int sz) {
  if ((sz > 100000) || (sz < 0)) {
    fatal("TomTom"
          ":malformed file.  Bad record size.");
  }
}


x86 assembly (clang, -O0):
<check_recsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jg     1132 <check_recsize+0x22>
cmpl   $0x0,-0x4(%rbp)
jge    113e <check_recsize+0x2e>
lea    0xec7(%rip),%rdi
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_recsize>:
cmp    $0x186a1,%edi
jb     1124 <check_recsize+0x14>
lea    0xee1(%rip),%rdi
jmp    1030 <fatal@plt>
ret

LLVM IR (-O0):
@.str = [41 x i8] c"TomTom:malformed file. Bad record size.\00"
define void @check_recsize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 100000
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5, %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"TomTom:malformed file. Bad record size.\00"
define void @check_recsize(i32 %0) {
%2 = icmp ugt i32 %0, 100000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_angles();
int /*<<< orphan*/ set_palette(int /*<<< orphan*/);
void init_tables(void) {
  set_palette(0);
  init_angles();
}


x86 assembly (clang, -O0):
<init_tables>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <set_palette@plt>
mov    $0x0,%al
call   1030 <init_angles@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_tables>:
push   %rax
xor    %edi,%edi
call   1040 <set_palette@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_angles@plt>

LLVM IR (-O0):
define void @init_tables() {
%1 = call i32 @set_palette(i32 0)
%2 = call i32 (...) @init_angles()
ret void
}

LLVM IR (-O2):
define void @init_tables() {
%1 = tail call i32 @set_palette(i32 0)
%2 = tail call i32 (...) @init_angles()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ child_pids_kill_all_and_wait();
int /*<<< orphan*/ logging(char *, int);
int /*<<< orphan*/ set_terminate();
void sh_term(int signum, siginfo_t *siginfo, void *ucontext) {
  (void)siginfo;
  (void)ucontext;
  logging("signal terminate handler called - signal received [%d]", signum);
  set_terminate();
  child_pids_kill_all_and_wait();
}


x86 assembly (clang, -O0):
<sh_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1050 <logging@plt>
mov    $0x0,%al
call   1040 <set_terminate@plt>
mov    $0x0,%al
call   1030 <child_pids_kill_all_and_wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_term>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1050 <logging@plt>
xor    %eax,%eax
call   1040 <set_terminate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <child_pids_kill_all_and_wait@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"signal terminate handler called - signal received [%d]\00"
define void @sh_term(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %5
%8 = load i8*, i8** %6
%9 = load i32, i32* %4
%10 = call i32 @logging(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @set_terminate()
%12 = call i32 (...) @child_pids_kill_all_and_wait()
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"signal terminate handler called - signal received [%d]\00"
define void @sh_term(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @logging(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 (...) @set_terminate()
%6 = tail call i32 (...) @child_pids_kill_all_and_wait()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void pushad() { db(0x60); }


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

x86 assembly (clang, -O2):
<pushad>:
mov    $0x60,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @pushad() {
%1 = call i32 @db(i32 96)
ret void
}

LLVM IR (-O2):
define void @pushad() {
%1 = tail call i32 @db(i32 96)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_template_test();
int /*<<< orphan*/ simple_match_test();
int main(int argc, const char *argv[]) {
  add_template_test();
  simple_match_test();
  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)
mov    $0x0,%al
call   1030 <add_template_test@plt>
mov    $0x0,%al
call   1040 <simple_match_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @add_template_test()
%4 = tail call i32 (...) @simple_match_test()
ret i32 0
}
int sdReadCxD(int interface, unsigned char *buf, int cmd) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @sdReadCxD(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
void oqdF(char *x) { const char *y = x; }


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

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

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

LLVM IR (-O2):
define void @oqdF(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void market_display_help(void) {
  const char *help = {
      "\n\nAIDE: \n"
      " - Afficher une categorie: \"afficher <nom-categorie>\"\n"
      " - Acheter un objet: \"acheter <nom-objet>[arme, armure, moteur, coque] "
      "<id>\"\n"
      " - Acheter nourrirutre/fuel: \"acheter [nourriture,fuel] "
      "<quantite/[max]>\"\n"
      " - Comparer deux objets: \"comparer [nom] [id]\"\n"};
  printf("%s\n\n", help);
}


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

x86 assembly (clang, -O2):
<market_display_help>:
lea    0xfef(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [262 x i8] c"\0A\0AAIDE: \0A - Afficher une categorie: \22afficher <nom-categorie>\22\0A - Acheter un objet: \22acheter <nom-objet>[arme, armure, moteur, coque] <id>\22\0A - Acheter nourrirutre/fuel: \22acheter [nourriture,fuel] <quantite/[max]>\22\0A - Comparer deux objets: \22comparer [nom] [id]\22\0A\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
define void @market_display_help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [262 x i8] c"\0A\0AAIDE: \0A - Afficher une categorie: \22afficher <nom-categorie>\22\0A - Acheter un objet: \22acheter <nom-objet>[arme, armure, moteur, coque] <id>\22\0A - Acheter nourrirutre/fuel: \22acheter [nourriture,fuel] <quantite/[max]>\22\0A - Comparer deux objets: \22comparer [nom] [id]\22\0A\00"
@.str.1 = [5 x i8] c"%s\0A\0A\00"
define void @market_display_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned short icrc(unsigned short, unsigned long, short, int);
int benchmark(void) {
  unsigned short i1, i2;
  unsigned long n;
  n = 40;
  i1 = icrc(0, n, (short)0, 1);
  i2 = icrc(i1, n + 2, (short)0, 1);
  return 0;
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x28,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%edi
call   1030 <icrc@plt>
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rsi
add    $0x2,%rsi
xor    %edx,%edx
mov    $0x1,%ecx
movzwl %ax,%edi
call   1030 <icrc@plt>
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark>:
push   %rax
mov    $0x28,%esi
xor    %edi,%edi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <icrc@plt>
movzwl %ax,%edi
mov    $0x2a,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <icrc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @benchmark() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i64
store i64 40, i64* %3
%4 = load i64, i64* %3
%5 = call zeroext i16 @icrc(i16 zeroext 0, i64 %4, i16 signext 0, i32 1)
store i16 %5, i16* %1
%6 = load i16, i16* %1
%7 = load i64, i64* %3
%8 = add i64 %7, 2
%9 = call zeroext i16 @icrc(i16 zeroext %6, i64 %8, i16 signext 0, i32 1)
store i16 %9, i16* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @benchmark() {
%1 = tail call zeroext i16 @icrc(i16 zeroext 0, i64 40, i16 signext 0, i32 1)
%2 = tail call zeroext i16 @icrc(i16 zeroext %1, i64 42, i16 signext 0, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ yyparse();
int main(void) { exit(yyparse()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <yyparse@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <yyparse@plt>
mov    %eax,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
%2 = tail call i32 @exit(i32 %1)
unreachable
}
int is_prime(int number) {
  int middle = number / 2;
  int i;
  for (i = 2; i <= middle; i++) {
    if ((number % i) == 0) {
      return i;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1156 <is_prime+0x56>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1143 <is_prime+0x43>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <is_prime+0x5d>
jmp    1148 <is_prime+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <is_prime+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %r8d,%r8d
cmp    $0x4,%edi
jl     1137 <is_prime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <is_prime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <is_prime+0x20>
mov    %r8d,%eax
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 2
store i32 %7, i32* %4
store i32 2, i32* %5
br label %8
8: ; preds = %20, %1
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i32, i32* %5
store i32 %18, i32* %2
br label %24
19: ; preds = %12
br label %20
20: ; preds = %19
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
store i32 0, i32* %2
br label %24
24: ; preds = %23, %17
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %5
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %6, %4
br i1 %11, label %12, label %5
12: ; preds = %5, %9, %1
%13 = phi i32 [ 0, %1 ], [ 0, %9 ], [ %6, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ LDY_();
int /*<<< orphan*/ c64_memZero();
void LDY_zp(void) {
  c64_memZero();
  LDY_();
}


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

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

LLVM IR (-O0):
define void @LDY_zp() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 (...) @LDY_()
ret void
}

LLVM IR (-O2):
define void @LDY_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @LDY_()
ret void
}
long int longint_ignoring_longlongint(long int x, long long int y) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @longint_ignoring_longlongint(i64 returned %0, i64 %1) {
ret i64 %0
}