xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pclos();
void pclos_() { pclos(); }


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

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

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

LLVM IR (-O2):
define void @pclos_() {
%1 = tail call i32 (...) @pclos()
ret void
}
void dead_result7(int *data) {
  int j = data[2];
  data[j] = 2;
}


x86 assembly (clang, -O0):
<dead_result7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dead_result7>:
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @dead_result7(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
store i32 2, i32* %10
ret void
}

LLVM IR (-O2):
define void @dead_result7(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 2, i32* %5
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ppuSetNameTblSingleLower();
int /*<<< orphan*/ ppuSetNameTblSingleUpper();
int /*<<< orphan*/ prg32setBank0(int);
void m7_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & (1 << 4))
    ppuSetNameTblSingleUpper();
  else
    ppuSetNameTblSingleLower();
  prg32setBank0((val & 7) << 15);
}


x86 assembly (clang, -O0):
<m7_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1159 <m7_setParams+0x29>
mov    $0x0,%al
call   1030 <ppuSetNameTblSingleUpper@plt>
jmp    1160 <m7_setParams+0x30>
mov    $0x0,%al
call   1050 <ppuSetNameTblSingleLower@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xf,%edi
call   1040 <prg32setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m7_setParams>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
test   $0x10,%bl
jne    1141 <m7_setParams+0x11>
call   1050 <ppuSetNameTblSingleLower@plt>
jmp    1146 <m7_setParams+0x16>
call   1030 <ppuSetNameTblSingleUpper@plt>
and    $0x7,%ebx
shl    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <prg32setBank0@plt>

LLVM IR (-O0):
define void @m7_setParams(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 = and i32 %6, 16
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @ppuSetNameTblSingleUpper()
br label %13
11: ; preds = %2
%12 = call i32 (...) @ppuSetNameTblSingleLower()
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %4
%15 = and i32 %14, 7
%16 = shl i32 %15, 15
%17 = call i32 @prg32setBank0(i32 %16)
ret void
}

LLVM IR (-O2):
define void @m7_setParams(i32 %0, i32 %1) {
%3 = and i32 %1, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @ppuSetNameTblSingleUpper()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ppuSetNameTblSingleLower()
br label %9
9: ; preds = %7, %5
%10 = shl i32 %1, 15
%11 = and i32 %10, 229376
%12 = tail call i32 @prg32setBank0(i32 %11)
ret void
}
int rhs(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @rhs(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ test_named();
int /*<<< orphan*/ test_named2();
int /*<<< orphan*/ test_unnamed();
int main(void) {
  test_unnamed();
  test_named();
  test_named2();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_unnamed()
%2 = tail call i32 (...) @test_named()
%3 = tail call i32 (...) @test_named2()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *trace_next_symbol(char **paddr, FILE *mapf) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @trace_next_symbol(i8** nocapture readnone %0, i32* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
double __infer_nondet_double();
double fmin(double x, double y) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call double (...) @__infer_nondet_double()
ret double %5
}

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = tail call double (...) @__infer_nondet_double()
ret double %3
}
void g_slist_remove_all() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_remove_all() {
ret void
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ queue_dequeue(struct queue *);
int /*<<< orphan*/ queue_empty(struct queue *);
void queue_clear(struct queue *theQueue) {
  while (!queue_empty(theQueue))
    queue_dequeue(theQueue);
  return;
}


x86 assembly (clang, -O0):
<queue_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <queue_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <queue_clear+0x2a>
jmp    1158 <queue_clear+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <queue_dequeue@plt>
jmp    112c <queue_clear+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_clear>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <queue_empty@plt>
test   %eax,%eax
jne    1146 <queue_clear+0x26>
mov    %rbx,%rdi
call   1040 <queue_dequeue@plt>
mov    %rbx,%rdi
jmp    1130 <queue_clear+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
define void @queue_clear(%struct.queue* %0) {
%2 = alloca %struct.queue*
store %struct.queue* %0, %struct.queue** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.queue*, %struct.queue** %2
%5 = call i32 @queue_empty(%struct.queue* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load %struct.queue*, %struct.queue** %2
%10 = call i32 @queue_dequeue(%struct.queue* %9)
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define void @queue_clear(%struct.queue* %0) {
%2 = tail call i32 @queue_empty(%struct.queue* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @queue_dequeue(%struct.queue* %0)
%6 = tail call i32 @queue_empty(%struct.queue* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
void foo423() {}


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

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

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

LLVM IR (-O2):
define void @foo423() {
ret void
}
/* Variables and functions */
char tolower(char const);
unsigned int simple_guess_base(const char *cp) {
  if (cp[0] == '0') {
    if (tolower(cp[1]) == 'x')
      return 16;
    else
      return 8;
  } else {
    return 10;
  }
}


x86 assembly (clang, -O0):
<simple_guess_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    115d <simple_guess_base+0x4d>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
cmp    $0x78,%eax
jne    1151 <simple_guess_base+0x41>
movl   $0x10,-0x4(%rbp)
jmp    1164 <simple_guess_base+0x54>
movl   $0x8,-0x4(%rbp)
jmp    1164 <simple_guess_base+0x54>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_guess_base>:
push   %rax
mov    $0xa,%eax
cmpb   $0x30,(%rdi)
jne    1132 <simple_guess_base+0x22>
movsbl 0x1(%rdi),%edi
call   1030 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x78,%al
sete   %cl
lea    0x8(,%rcx,8),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @simple_guess_base(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 48
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call signext i8 @tolower(i8 signext %6)
%8 = icmp eq i8 %7, 120
%9 = select i1 %8, i32 16, i32 8
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %9, %4 ], [ 10, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int getFileSize(char *strFileName) {
  FILE *fp = fopen(strFileName, "r");
  int size;
  fseek(fp, 0L, SEEK_END);
  size = ftell(fp);
  fclose(fp);
  return size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
push   %rbp
push   %rbx
push   %rax
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i32 @getFileSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%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** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i32 @getFileSize(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 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i64 0, i32 %3)
%5 = tail call i32 @ftell(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
ret i32 %5
}
void dj_start(void) {}


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

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

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

LLVM IR (-O2):
define void @dj_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mu_assert(char *, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ trimwhitespace(char *, char *);
char *test_trimwhitespace2() {
  char str[] = "dt";
  char out[40];
  trimwhitespace(out, str);
  mu_assert("2: after trim str != dt", strcmp(out, "dt") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<test_trimwhitespace2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed6(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xece(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x3(%rbp),%rsi
call   1030 <trimwhitespace@plt>
lea    -0x30(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe84(%rip),%rdi
call   1050 <mu_assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trimwhitespace2>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movb   $0x0,0xe(%rsp)
movw   $0x7464,0xc(%rsp)
lea    0xecb(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <trimwhitespace@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
lea    0xe89(%rip),%rdi
call   1050 <mu_assert@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_trimwhitespace2.str = [3 x i8] c"dt\00"
@.str = [24 x i8] c"2: after trim str != dt\00"
@.str.1 = [3 x i8] c"dt\00"
define i8* @test_trimwhitespace2() {
%1 = alloca [3 x i8]
%2 = alloca [40 x i8]
%3 = bitcast [3 x i8]* %1 to i8*
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%6 = call i32 @trimwhitespace(i8* %4, i8* %5)
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @mu_assert(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i8* null
}

LLVM IR (-O2):
@.str = [24 x i8] c"2: after trim str != dt\00"
@.str.1 = [3 x i8] c"dt\00"
define noalias i8* @test_trimwhitespace2() {
%1 = alloca [3 x i8]
%2 = alloca [40 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @trimwhitespace(i8* %4, i8* %3)
%6 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @mu_assert(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i8* null
}
void format_skeleton_read(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ load_bank_at(int /*<<< orphan*/ *, char *, int);
void load_bank(uint8_t *p, char *name) { load_bank_at(p, name, 0xC000); }


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

x86 assembly (clang, -O2):
<load_bank>:
mov    $0xc000,%edx
jmp    1030 <load_bank_at@plt>

LLVM IR (-O0):
define void @load_bank(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 @load_bank_at(i32* %5, i8* %6, i32 49152)
ret void
}

LLVM IR (-O2):
define void @load_bank(i32* %0, i8* %1) {
%3 = tail call i32 @load_bank_at(i32* %0, i8* %1, i32 49152)
ret void
}
int Int_abs(int x) { return x > 0 ? x : -x; }


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

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

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

LLVM IR (-O2):
define i32 @Int_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
struct dns_packet *dns_cache_fetch(struct dns_cache *cache, int *error) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.dns_packet = type opaque
%struct.dns_cache = type opaque
define %struct.dns_packet* @dns_cache_fetch(%struct.dns_cache* %0, i32* %1) {
%3 = alloca %struct.dns_cache*
%4 = alloca i32*
store %struct.dns_cache* %0, %struct.dns_cache** %3
store i32* %1, i32** %4
ret %struct.dns_packet* null
}

LLVM IR (-O2):
%struct.dns_packet = type opaque
%struct.dns_cache = type opaque
define noalias %struct.dns_packet* @dns_cache_fetch(%struct.dns_cache* nocapture readnone %0, i32* nocapture readnone %1) {
ret %struct.dns_packet* null
}
int _hash(const char *str) {
  unsigned char *p = (unsigned char *)str;
  unsigned int h = 0;
  while (*p != '\0')
    h = (h << 4) ^ (h >> 28) ^ *p++;
  return h;
}


x86 assembly (clang, -O0):
<_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <_hash+0x51>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    -0x14(%rbp),%ecx
shr    $0x1c,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <_hash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <_hash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
rol    $0x4,%eax
xor    %ecx,%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 i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 0, i32* %4
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = load i32, i32* %4
%13 = shl i32 %12, 4
%14 = load i32, i32* %4
%15 = lshr i32 %14, 28
%16 = xor i32 %13, %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
%19 = load i8, i8* %17
%20 = zext i8 %19 to i32
%21 = xor i32 %16, %20
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %4
ret i32 %23
}

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* [ %10, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = tail call i32 @llvm.fshl.i32(i32 %6, i32 %6, i32 4)
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = xor i32 %9, %8
%12 = load i8, i8* %10
%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
}
__attribute__((__always___)) void rte_xend(void) {
  __asm__ volatile(".byte 0x0f,0x01,0xd5" ::: "memory");
}


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

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

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

LLVM IR (-O2):
define void @rte_xend() {
tail call void asm sideeffect ".byte 0x0f,0x01,0xd5", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned int);
void adc_reg32_m32(unsigned int reg32, unsigned int *m32) {
  put8(0x13);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<adc_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x13,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x13,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @adc_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 19)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @adc_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 19)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
/* Variables and functions */
int RTLD_LAZY;
int RTLD_LOCAL;
void *dlopen(char const *, int);
void *dlsym(void *, char const *);
void *init(const char *lib, const char *func) {
  void *handle = dlopen(lib, RTLD_LAZY | RTLD_LOCAL);
  return (handle == NULL) ? NULL : dlsym(handle, func);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    0x2e8c(%rip),%rax
or     (%rax),%esi
call   1030 <dlopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <init+0x45>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1176 <init+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <dlsym@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
mov    %rsi,%rbx
mov    0x2eb5(%rip),%rax
mov    0x2e9e(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1030 <dlopen@plt>
test   %rax,%rax
je     114c <init+0x2c>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <dlsym@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RTLD_LAZY = global i32 0
@RTLD_LOCAL = global i32 0
define i8* @init(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i32, i32* @RTLD_LAZY
%8 = load i32, i32* @RTLD_LOCAL
%9 = or i32 %7, %8
%10 = call i8* @dlopen(i8* %6, i32 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %2
br label %18
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i8* @dlsym(i8* %15, i8* %16)
br label %18
18: ; preds = %14, %13
%19 = phi i8* [ null, %13 ], [ %17, %14 ]
ret i8* %19
}

LLVM IR (-O2):
@RTLD_LAZY = global i32 0
@RTLD_LOCAL = global i32 0
define i8* @init(i8* %0, i8* %1) {
%3 = load i32, i32* @RTLD_LAZY
%4 = load i32, i32* @RTLD_LOCAL
%5 = or i32 %4, %3
%6 = tail call i8* @dlopen(i8* %0, i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i8* @dlsym(i8* %6, i8* %1)
br label %10
10: ; preds = %2, %8
%11 = phi i8* [ %9, %8 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  printf("9==8%d\n", 9 == 8);
  printf("9==9=%d\n", 9 == 9);
  printf("9!=8%d\n", 9 != 8);
  printf("9!=9=%d\n", 9 != 9);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"9==8%d\0A\00"
@.str.1 = [9 x i8] c"9==9=%d\0A\00"
@.str.2 = [8 x i8] c"9!=8%d\0A\00"
@.str.3 = [9 x i8] c"9!=9=%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int startTimer(int timeout) {
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  return ((int)tp.tv_sec + timeout) * 512 + (int)tp.tv_nsec / 2097152;
}


x86 assembly (clang, -O0):
<startTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x10(%rbp),%rax
add    -0x4(%rbp),%eax
shl    $0x9,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x200000,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startTimer>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
add    0x8(%rsp),%ebx
shl    $0x9,%ebx
mov    (%rsp),%ecx
lea    0x1fffff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x15,%eax
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @startTimer(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %3)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = mul nsw i32 %10, 512
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = sdiv i32 %14, 2097152
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @startTimer(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = add nsw i32 %8, %0
%10 = shl nsw i32 %9, 9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = sdiv i32 %13, 2097152
%15 = add nsw i32 %10, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cgiTableFieldStartAlignRight() { printf("<TD ALIGN = RIGHT>"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"<TD ALIGN = RIGHT>\00"
define void @cgiTableFieldStartAlignRight() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"<TD ALIGN = RIGHT>\00"
define void @cgiTableFieldStartAlignRight() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *str_replace(char *, char *, char *, char const *);
char *word_replace(char *line, char *pos, size_t len, const char *replace) {
  return str_replace(line, pos, pos + len, replace);
}


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

x86 assembly (clang, -O2):
<word_replace>:
add    %rsi,%rdx
jmp    1030 <str_replace@plt>

LLVM IR (-O0):
define i8* @word_replace(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8*, i8** %8
%15 = call i8* @str_replace(i8* %9, i8* %10, i8* %13, i8* %14)
ret i8* %15
}

LLVM IR (-O2):
define i8* @word_replace(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = getelementptr inbounds i8, i8* %1, i64 %2
%6 = tail call i8* @str_replace(i8* %0, i8* %1, i8* %5, i8* %3)
ret i8* %6
}
/* Variables and functions */
int bar();
int hide_old_foo() { return 10 + bar(); }


x86 assembly (clang, -O0):
<hide_old_foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_old_foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hide_old_foo() {
%1 = call i32 (...) @bar()
%2 = add nsw i32 10, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @hide_old_foo() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 10
ret i32 %2
}
int f() {
  int i;
  int c;
  i = 0;
  c = 0;
  while (i < 100) {
    if (i >= 50)
      break;
    c = c + i;
    i = i + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1142 <f+0x42>
cmpl   $0x32,-0x4(%rbp)
jl     112b <f+0x2b>
jmp    1142 <f+0x42>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <f+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 1225
}
/* Variables and functions */
int helper(int);
int addDigits(int num) {
  while (num >= 10) {
    num = helper(num);
  }
  return num;
}


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1135 <addDigits+0x25>
mov    -0x4(%rbp),%edi
call   1030 <helper@plt>
mov    %eax,-0x4(%rbp)
jmp    111b <addDigits+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
push   %rax
mov    %edi,%eax
cmp    $0xa,%edi
jl     112c <addDigits+0x1c>
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <helper@plt>
cmp    $0x9,%eax
jg     1120 <addDigits+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @addDigits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @helper(i32 %7)
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = tail call i32 @helper(i32 %4)
%6 = icmp sgt i32 %5, 9
br i1 %6, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ %0, %1 ], [ %5, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_new_file(char const *, char *);
int /*<<< orphan*/ PEM_write_bio_X509(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
void pki_write_certificate(X509 *certificate, const char *filename) {
  BIO *bio_file = NULL;
  bio_file = BIO_new_file(filename, "w");
  PEM_write_bio_X509(bio_file, certificate);
  BIO_free(bio_file);
}


x86 assembly (clang, -O0):
<pki_write_certificate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1050 <BIO_new_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <PEM_write_bio_X509@plt>
mov    -0x18(%rbp),%rdi
call   1040 <BIO_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pki_write_certificate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1050 <BIO_new_file@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <PEM_write_bio_X509@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <BIO_free@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @pki_write_certificate(i32* %0, i8* %1) {
%3 = tail call i32* @BIO_new_file(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @PEM_write_bio_X509(i32* %3, i32* %0)
%5 = tail call i32 @BIO_free(i32* %3)
ret void
}
int test_imm_45uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x45 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_45uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 69
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double __infer_nondet_double();
double sin(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @sin(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
void EVP_CIPHER_CTX_test_flags(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_SET_PWR() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerLoadSet(uint32_t ui32Base, uint32_t ui32Timer, uint32_t ui32Value) {
  ;

  ;
  if (ui32Timer & 0x000000ff) {
    (*((volatile unsigned long *)(ui32Base + 0x00000028))) = ui32Value;
  }
  if (ui32Timer & 0x0000ff00) {
    (*((volatile unsigned long *)(ui32Base + 0x0000002C))) = ui32Value;
  }
}


x86 assembly (clang, -O0):
<TimerLoadSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
je     112d <TimerLoadSet+0x2d>
movslq -0xc(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
cltq
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
cmp    $0x0,%eax
je     114d <TimerLoadSet+0x4d>
movslq -0xc(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerLoadSet>:
movslq %edx,%rax
movslq %edi,%rcx
test   %sil,%sil
je     110f <TimerLoadSet+0xf>
mov    %rax,0x28(%rcx)
test   $0xff00,%esi
je     111b <TimerLoadSet+0x1b>
mov    %rax,0x2c(%rcx)
ret

LLVM IR (-O0):
define void @TimerLoadSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = and i32 %7, 255
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 40
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i64*
store volatile i64 %12, i64* %16
br label %17
17: ; preds = %10, %3
%18 = load i32, i32* %5
%19 = and i32 %18, 65280
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 44
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i64*
store volatile i64 %23, i64* %27
br label %28
28: ; preds = %21, %17
ret void
}

LLVM IR (-O2):
define void @TimerLoadSet(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 255
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = sext i32 %2 to i64
%8 = add nsw i32 %0, 40
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
br label %11
11: ; preds = %6, %3
%12 = and i32 %1, 65280
%13 = icmp eq i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %11
%15 = sext i32 %2 to i64
%16 = add nsw i32 %0, 44
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
br label %19
19: ; preds = %14, %11
ret void
}
int _do_nothing_on_object(void *data, void *extra) {
  int result = 0;
  ((void)(data));
  ((void)(extra));
  return result;
}


x86 assembly (clang, -O0):
<_do_nothing_on_object>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_do_nothing_on_object(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help(char **para) {
  printf(
      "This is a test program with 8 commands and help command\n	"
      "	com1[parameter]\t--give a instruction and print the parameter\n	"
      "	com2\t\t\t--give a instruction\n		com3\t\t\t--give a "
      "instruction\n		- h OR - help\t\t--give the help\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [213 x i8] c"This is a test program with 8 commands and help command\0A\09\09com1[parameter]\09--give a instruction and print the parameter\0A\09\09com2\09\09\09--give a instruction\0A\09\09com3\09\09\09--give a instruction\0A\09\09- h OR - help\09\09--give the help\0A\00"
define i32 @help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [212 x i8] c"This is a test program with 8 commands and help command\0A\09\09com1[parameter]\09--give a instruction and print the parameter\0A\09\09com2\09\09\09--give a instruction\0A\09\09com3\09\09\09--give a instruction\0A\09\09- h OR - help\09\09--give the help\00"
define i32 @help(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([212 x i8], [212 x i8]* @str, i64 0, i64 0))
ret i32 0
}
txt_metamisc(type, leng, mess) char *mess;
{
  prtime();
  printf("Meta event, unrecognized, type=0x%02x leng=%d\n", type, leng);
}


x86 assembly (clang, -O0):
<txt_metamisc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_metamisc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xecb(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Meta event, unrecognized, type=0x%02x leng=%d\0A\00"
define i32 @txt_metamisc(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = call i32 (...) @prtime()
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [47 x i8] c"Meta event, unrecognized, type=0x%02x leng=%d\0A\00"
define i32 @txt_metamisc(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @prtime()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
void xbmc_dummy_function() { return; }


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

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

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

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