xunge/DecIR huggingface dataset:
/* Variables and functions */
int foo();
int bar(void) { return foo() + 1; }


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

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

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

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @foo()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ morton(int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < 100; i++) {
    int x;
    int y;
    morton(i, &x, &y);
    printf("%d: %d %d\n", i, x, y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    117a <main+0x5a>
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <morton@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0x4(%rsp),%r14
mov    %rsp,%r15
lea    0xec7(%rip),%r12
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <morton@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%d: %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %9
9: ; preds = %19, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 100
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i32, i32* %6
%14 = call i32 @morton(i32 %13, i32* %7, i32* %8)
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %9
22: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%d: %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
br label %7
7: ; preds = %2, %7
%8 = phi i32 [ 0, %2 ], [ %13, %7 ]
%9 = call i32 @morton(i32 %8, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %11)
%13 = add nuw nsw i32 %8, 1
%14 = icmp eq i32 %13, 100
br i1 %14, label %15, label %7
15: ; preds = %7
ret i32 0
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
int stat(char *, struct stat *);
int isDir(char *path) {
  int s;
  struct stat info;
  s = stat(path, &info);
  return (s == 0 && (info.st_mode & S_IFDIR));
}


x86 assembly (clang, -O0):
<isDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1150 <isDir+0x40>
mov    -0x10(%rbp),%eax
mov    0x2e93(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDir>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
sete   %al
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isDir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFDIR
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %9, %1
%16 = phi i1 [ false, %1 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isDir(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
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IFDIR
%9 = and i32 %8, %7
%10 = icmp ne i32 %9, 0
%11 = select i1 %5, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int fun_stub_base_4_stub(char a, char b) {
  printf("fun_stub_base_4_stub:a = %d, b = %d\n", a, b);
  return a + b;
}


x86 assembly (clang, -O0):
<fun_stub_base_4_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"fun_stub_base_4_stub:a = %d, b = %d\0A\00"
define i32 @fun_stub_base_4_stub(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
@.str = [37 x i8] c"fun_stub_base_4_stub:a = %d, b = %d\0A\00"
define i32 @fun_stub_base_4_stub(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
%4 = sext i8 %0 to i32
%5 = sext i8 %1 to i32
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Type definitions */
struct Vector {
  int dummy;
};

/* Variables and functions */
int vector_length(struct Vector *);
int /*<<< orphan*/ vector_reserve(struct Vector *, int);
void vector_grow(struct Vector *vector) {
  vector_reserve(vector, 2 * vector_length(vector) + 1);
}


x86 assembly (clang, -O0):
<vector_grow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vector_length@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
shl    $0x1,%esi
add    $0x1,%esi
call   1040 <vector_reserve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_grow>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vector_length@plt>
lea    (%rax,%rax,1),%esi
add    $0x1,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vector_reserve@plt>

LLVM IR (-O0):
%struct.Vector = type { i32 }
define void @vector_grow(%struct.Vector* %0) {
%2 = alloca %struct.Vector*
store %struct.Vector* %0, %struct.Vector** %2
%3 = load %struct.Vector*, %struct.Vector** %2
%4 = load %struct.Vector*, %struct.Vector** %2
%5 = call i32 @vector_length(%struct.Vector* %4)
%6 = mul nsw i32 2, %5
%7 = add nsw i32 %6, 1
%8 = call i32 @vector_reserve(%struct.Vector* %3, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.Vector = type { i32 }
define void @vector_grow(%struct.Vector* %0) {
%2 = tail call i32 @vector_length(%struct.Vector* %0)
%3 = shl nsw i32 %2, 1
%4 = or i32 %3, 1
%5 = tail call i32 @vector_reserve(%struct.Vector* %0, i32 %4)
ret void
}
void OTHERNAME_free(void) {}


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

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

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

LLVM IR (-O2):
define void @OTHERNAME_free() {
ret void
}
double min_d(double x, double y) { return x > y ? y : x; }


x86 assembly (clang, -O0):
<min_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <min_d+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <min_d+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_d>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @min_d(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef unsigned long volatile uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void GPIODMATriggerDisable(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  (*((volatile unsigned long *)(ui32Port + 0x00000534))) &= (~ui8Pins);
}


x86 assembly (clang, -O0):
<GPIODMATriggerDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x534(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x534(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIODMATriggerDisable>:
mov    %rsi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x534(%rdi)
ret

LLVM IR (-O0):
define void @GPIODMATriggerDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add nsw i64 %7, 1332
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @GPIODMATriggerDisable(i64 %0, i64 %1) {
%3 = alloca i64
store volatile i64 %1, i64* %3
%4 = load volatile i64, i64* %3
%5 = xor i64 %4, -1
%6 = add nsw i64 %0, 1332
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
unsigned char convert_unsigned_char_to_unsigned_char(unsigned char x) {
  return x;
}


x86 assembly (clang, -O0):
<convert_unsigned_char_to_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @convert_unsigned_char_to_unsigned_char(i8 returned zeroext %0) {
ret i8 %0
}
/* Type definitions */
struct hashtab {
  int dummy;
};

/* Variables and functions */
int strcmp(void *, void *);
int strcmp_hash(struct hashtab *h, void *a, void *b) { return strcmp(a, b); }


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

x86 assembly (clang, -O2):
<strcmp_hash>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
%struct.hashtab = type { i32 }
define i32 @strcmp_hash(%struct.hashtab* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %2)
ret i32 %4
}
/* Type definitions */
struct fmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fmap *);
void fmap_destroy(struct fmap *fmap) { free(fmap); }


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

x86 assembly (clang, -O2):
<fmap_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.fmap = type { i32 }
define void @fmap_destroy(%struct.fmap* %0) {
%2 = alloca %struct.fmap*
store %struct.fmap* %0, %struct.fmap** %2
%3 = load %struct.fmap*, %struct.fmap** %2
%4 = call i32 @free(%struct.fmap* %3)
ret void
}

LLVM IR (-O2):
%struct.fmap = type { i32 }
define void @fmap_destroy(%struct.fmap* nocapture %0) {
%2 = tail call i32 @free(%struct.fmap* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int random();
int unirandom_i(int beg, int end) {
  assert(beg < end);
  return beg + (random() % (end - beg));
}


x86 assembly (clang, -O0):
<unirandom_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unirandom_i>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
sub    %ebp,%ebx
setg   %dil
call   1030 <assert@plt>
xor    %eax,%eax
call   1040 <random@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unirandom_i(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = call i32 (...) @random()
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = srem i32 %11, %14
%16 = add nsw i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @unirandom_i(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 (...) @random()
%7 = sub nsw i32 %1, %0
%8 = srem i32 %6, %7
%9 = add nsw i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_msg(char *, char *, unsigned long, unsigned long);
void show_timestamp(char *prefix, unsigned long tv_sec, unsigned long tv_usec) {
  test_msg("%8s: sec %20lu nsec %20lu\n", prefix, tv_sec, tv_usec);
}


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

x86 assembly (clang, -O2):
<show_timestamp>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <test_msg@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%8s: sec %20lu nsec %20lu\0A\00"
define void @show_timestamp(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @test_msg(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%8s: sec %20lu nsec %20lu\0A\00"
define void @show_timestamp(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @test_msg(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1, i64 %2)
ret void
}
int __attribute__((weak)) myfunc() { return 0; }


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

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

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

LLVM IR (-O2):
define weak i32 @myfunc() {
ret i32 0
}
double cos(double rad) {
  double sin();
  return (sin(3.14159 / 2.0 - rad));
}


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

x86 assembly (clang, -O2):
<cos>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 0x3FF921F9F01B866E, %3
%5 = call double @sin(double %4)
ret double %5
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fsub double 0x3FF921F9F01B866E, %0
%3 = tail call double @sin(double %2)
ret double %3
}
/* Variables and functions */
int isdigit(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", isdigit('0'));
  printf("%d\n", isdigit('1'));
  printf("%d\n", isdigit('a'));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <isdigit@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x31,%edi
call   1030 <isdigit@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x61,%edi
call   1030 <isdigit@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x30,%edi
call   1030 <isdigit@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x31,%edi
call   1030 <isdigit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x61,%edi
call   1030 <isdigit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @isdigit(i8 signext 48)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @isdigit(i8 signext 49)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @isdigit(i8 signext 97)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isdigit(i8 signext 48)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isdigit(i8 signext 49)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isdigit(i8 signext 97)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int print_binlog_table_map_event(struct table_map_event *ev) { return 0; }


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

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

LLVM IR (-O0):
%struct.table_map_event = type opaque
define i32 @print_binlog_table_map_event(%struct.table_map_event* %0) {
%2 = alloca %struct.table_map_event*
store %struct.table_map_event* %0, %struct.table_map_event** %2
ret i32 0
}

LLVM IR (-O2):
%struct.table_map_event = type opaque
define i32 @print_binlog_table_map_event(%struct.table_map_event* nocapture readnone %0) {
ret i32 0
}
double Foo(unsigned a) {
  unsigned local_data[16384] __attribute__((unused));
  double d;
  d = a;
  return d;
}


x86 assembly (clang, -O0):
<Foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xffa0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
add    $0xffa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Foo>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @Foo(i32 %0) {
%2 = alloca i32
%3 = alloca [16384 x i32]
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = uitofp i32 %5 to double
store double %6, double* %4
%7 = load double, double* %4
ret double %7
}

LLVM IR (-O2):
define double @Foo(i32 %0) {
%2 = uitofp i32 %0 to double
ret double %2
}
int PDC_get_font(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @PDC_get_font() {
ret i32 0
}
void free_tab(int lin, int **tab) {
  int i;
  for (i = 0; i < lin; i++) {
    free(tab[i]);
  }
  free(tab);
}


x86 assembly (clang, -O0):
<free_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <free_tab+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <free_tab+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_tab(i32 %0, i32** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %1, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %1 to i8*
tail call void @free(i8* %14)
ret void
}
void wpas_p2p_continue_after_scan(struct wpa_supplicant *wpa_s) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_continue_after_scan(%struct.wpa_supplicant* %0) {
%2 = alloca %struct.wpa_supplicant*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %2
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_continue_after_scan(%struct.wpa_supplicant* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ file;

/* Variables and functions */
int write(int, char *, int);
int sendDelete(int sock, char *file) {
  int bsent;
  bsent = write(sock, "DEL;", sizeof("DEL;"));
  if (bsent < sizeof("DEL;"))
    return (-1);
  bsent = write(sock, file, sizeof(file));
  if (bsent < sizeof(file))
    return (-1);
  return 0;
}


x86 assembly (clang, -O0):
<sendDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    0xed7(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x5,%rax
jae    1150 <sendDelete+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <sendDelete+0x75>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x8,%rax
jae    117e <sendDelete+0x6e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <sendDelete+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendDelete>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xee1(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x5,%ecx
jb     1149 <sendDelete+0x39>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <write@plt>
cmp    $0x8,%eax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"DEL;\00"
define i32 @sendDelete(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i32, i32* %4
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %10, 5
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %22
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = call i32 @write(i32 %14, i8* %15, i32 8)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = icmp ult i64 %18, 8
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 -1, i32* %3
br label %22
21: ; preds = %13
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %12
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [5 x i8] c"DEL;\00"
define i32 @sendDelete(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = icmp ult i32 %3, 5
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @write(i32 %0, i8* %1, i32 8)
%7 = icmp ult i32 %6, 8
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
void selfld_(void) {}


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

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

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

LLVM IR (-O2):
define void @selfld_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int scanw(char *, void *);
int con_scanf(char *fmt, void *app) {
  int i;
  echo();
  i = scanw(fmt, app);
  refresh();
  noecho();
  return i;
}


x86 assembly (clang, -O0):
<con_scanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <scanw@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <noecho@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_scanf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <echo@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanw@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <noecho@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @con_scanf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 (...) @echo()
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @scanw(i8* %7, i8* %8)
store i32 %9, i32* %5
%10 = call i32 (...) @refresh()
%11 = call i32 (...) @noecho()
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @con_scanf(i8* %0, i8* %1) {
%3 = tail call i32 (...) @echo()
%4 = tail call i32 @scanw(i8* %0, i8* %1)
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @noecho()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stats_updatebyname_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stats@%p::updatebyname (rtpp_stats_updatebyname) is "
          "invoked after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_stats_updatebyname_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_stats_updatebyname_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"Method rtpp_stats@%p::updatebyname (rtpp_stats_updatebyname) is invoked after destruction\0A\00"
define void @rtpp_stats_updatebyname_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"Method rtpp_stats@%p::updatebyname (rtpp_stats_updatebyname) is invoked after destruction\0A\00"
define void @rtpp_stats_updatebyname_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int die(char *msg) {
  fputs(msg, stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i32 @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void bintrailer() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_compare() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disconnect_server();
void ned_disconnect() { disconnect_server(); }


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

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

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

LLVM IR (-O2):
define void @ned_disconnect() {
%1 = tail call i32 (...) @disconnect_server()
ret void
}
/* Variables and functions */
int choose(int, char *, int, char *);
int /*<<< orphan*/ printf(char *);
page57() {
  printf("In the centre of the room is a table and a single chair.  There is "
         "an Orange\n");
  printf("folder on the table top, but you can\'t make out the lettering on "
         "it.\n");
  return choose(11, "You sit down and read the folder", 12,
                "You leave the room");
}


x86 assembly (clang, -O0):
<page57>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xf17(%rip),%rdi
call   1040 <printf@plt>
mov    $0xb,%edi
lea    0xf4c(%rip),%rsi
mov    $0xc,%edx
lea    0xf61(%rip),%rcx
call   1030 <choose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<page57>:
push   %rax
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4d(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rsi
lea    0xeda(%rip),%rcx
mov    $0xb,%edi
mov    $0xc,%edx
pop    %rax
jmp    1040 <choose@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"In the centre of the room is a table and a single chair. There is an Orange\0A\00"
@.str.1 = [70 x i8] c"folder on the table top, but you can't make out the lettering on it.\0A\00"
@.str.2 = [33 x i8] c"You sit down and read the folder\00"
@.str.3 = [19 x i8] c"You leave the room\00"
define i32 @page57() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @choose(i32 11, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret i32 %3
}

LLVM IR (-O2):
@.str.2 = [33 x i8] c"You sit down and read the folder\00"
@.str.3 = [19 x i8] c"You leave the room\00"
@str = [77 x i8] c"In the centre of the room is a table and a single chair. There is an Orange\00"
@str.4 = [69 x i8] c"folder on the table top, but you can't make out the lettering on it.\00"
define i32 @page57() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @choose(i32 11, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("El jose esta to carvo, se parece a pepe villuela.\n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"El jose esta to carvo, se parece a pepe villuela.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [50 x i8] c"El jose esta to carvo, se parece a pepe villuela.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: ated [-i] <interface>\n");
  fprintf(stderr, "example: ated -i ra0\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>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeef(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"usage: ated [-i] <interface>\0A\00"
@.str.1 = [22 x i8] c"example: ated -i ra0\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"usage: ated [-i] <interface>\0A\00"
@.str.1 = [22 x i8] c"example: ated -i ra0\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int answerctcp(int usern, char *nick, char *ctcp) { return 0x0; }


x86 assembly (clang, -O0):
<answerctcp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @answerctcp(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void install_pmask() {
  int i;
  return;
}


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

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

LLVM IR (-O0):
define void @install_pmask() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @install_pmask() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ signal(int, int);
int main(void) {
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  signal(8, 1);
  puts("done");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
mov    $0x8,%edi
mov    $0x1,%esi
call   1040 <signal@plt>
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"done\00"
define i32 @main() {
%1 = tail call i32 @signal(i32 8, i32 1)
%2 = tail call i32 @signal(i32 8, i32 1)
%3 = tail call i32 @signal(i32 8, i32 1)
%4 = tail call i32 @signal(i32 8, i32 1)
%5 = tail call i32 @signal(i32 8, i32 1)
%6 = tail call i32 @signal(i32 8, i32 1)
%7 = tail call i32 @signal(i32 8, i32 1)
%8 = tail call i32 @signal(i32 8, i32 1)
%9 = tail call i32 @signal(i32 8, i32 1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned char proto_assembleFrame(unsigned char *, unsigned short *,
                                  unsigned char *, int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *);
unsigned char protoR_readBaseInfo(unsigned char *buf, unsigned short *bufSize,
                                  unsigned char *gatewayId) {
  return proto_assembleFrame(buf, bufSize, gatewayId, 0x00, 0x92, 0, NULL);
}


x86 assembly (clang, -O0):
<protoR_readBaseInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r9d,%r9d
mov    $0x92,%r8d
xor    %eax,%eax
mov    %r9d,%ecx
movq   $0x0,(%rsp)
call   1030 <proto_assembleFrame@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protoR_readBaseInfo>:
push   %rax
movq   $0x0,(%rsp)
xor    %ecx,%ecx
mov    $0x92,%r8d
xor    %r9d,%r9d
call   1030 <proto_assembleFrame@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @protoR_readBaseInfo(i8* %0, i16* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i8*
store i8* %0, i8** %4
store i16* %1, i16** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i16*, i16** %5
%9 = load i8*, i8** %6
%10 = call zeroext i8 @proto_assembleFrame(i8* %7, i16* %8, i8* %9, i32 0, i32 146, i32 0, i32* null)
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @protoR_readBaseInfo(i8* %0, i16* %1, i8* %2) {
%4 = tail call zeroext i8 @proto_assembleFrame(i8* %0, i16* %1, i8* %2, i32 0, i32 146, i32 0, i32* null)
ret i8 %4
}
void band_negative_constant_Bad() {
  char a[1];
  int x = (-3) & (-2);
  a[x + 5] = 0;
}


x86 assembly (clang, -O0):
<band_negative_constant_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0xfffffffc,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
cltq
movb   $0x0,-0x1(%rbp,%rax,1)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @band_negative_constant_Bad() {
%1 = alloca [1 x i8]
%2 = alloca i32
store i32 -4, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 %5
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
define void @band_negative_constant_Bad() {
ret void
}
int cairo_code_draw_lushGraphYBound_get_height() { return 8; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushGraphYBound_get_height() {
ret i32 8
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushGraphYBound_get_height() {
ret i32 8
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  c = (getchar() != EOF);
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_ptr(int /*<<< orphan*/);
int /*<<< orphan*/ scheme_entry();
int main(int argc, char **argv) {
  print_ptr(scheme_entry());
  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   1040 <scheme_entry@plt>
mov    %eax,%edi
call   1030 <print_ptr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <scheme_entry@plt>
mov    %eax,%edi
call   1030 <print_ptr@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 (...) @scheme_entry()
%7 = call i32 @print_ptr(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @scheme_entry()
%4 = tail call i32 @print_ptr(i32 %3)
ret i32 0
}
/* Variables and functions */
int rand();
int produz() { return rand() % 100; }


x86 assembly (clang, -O0):
<produz>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<produz>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @produz() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 100
ret i32 %2
}

LLVM IR (-O2):
define i32 @produz() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
ret i32 %2
}