xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void do_write_uint16(void *dst, uint16_t data) {
  uint8_t *d = (uint8_t *)dst;
  d[0] = (uint8_t)((data >> 8) & 0xff);
  d[1] = (uint8_t)(data & 0xff);
}


x86 assembly (clang, -O0):
<do_write_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_write_uint16>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %rcx,(%rdi)
movzbl %al,%eax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @do_write_uint16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = sext i32 %10 to i64
%12 = load i64*, i64** %5
%13 = getelementptr inbounds i64, i64* %12, i64 0
store i64 %11, i64* %13
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = sext i32 %15 to i64
%17 = load i64*, i64** %5
%18 = getelementptr inbounds i64, i64* %17, i64 1
store i64 %16, i64* %18
ret void
}

LLVM IR (-O2):
define void @do_write_uint16(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = zext i32 %5 to i64
store i64 %6, i64* %3
%7 = and i32 %1, 255
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i64*
store i64 %8, i64* %10
ret void
}
void gtk_box_set_child_packing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_box_set_child_packing() {
ret void
}
int blezInstruction(int i) { return (i <= 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<blezInstruction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovle %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blezInstruction>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @blezInstruction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @blezInstruction(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
__attribute__((unused)) unsigned MEM_64bits(void) {
  return sizeof(size_t) == 8;
}


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

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

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

LLVM IR (-O2):
define i32 @MEM_64bits() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_packet(char *packet) { free(packet); }


x86 assembly (clang, -O0):
<free_packet>:
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):
<free_packet>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_packet(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ set_error_id(int);
int time();
__attribute__((constructor)) void init_error_id() {
  set_error_id(getpid() * time());
}


x86 assembly (clang, -O0):
<init_error_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <time@plt>
mov    -0x4(%rbp),%edi
imul   %eax,%edi
call   1050 <set_error_id@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_error_id>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <time@plt>
imul   %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1050 <set_error_id@plt>

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_error_id, i8* null }]
define void @init_error_id() {
%1 = call i32 (...) @getpid()
%2 = call i32 (...) @time()
%3 = mul nsw i32 %1, %2
%4 = call i32 @set_error_id(i32 %3)
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init_error_id, i8* null }]
define void @init_error_id() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @time()
%3 = mul nsw i32 %2, %1
%4 = tail call i32 @set_error_id(i32 %3)
ret void
}
unsigned ROL(unsigned word, int i) {
  asm("roll %%cl,%0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


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

x86 assembly (clang, -O2):
<ROL>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ROL(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 = call i32 asm "roll %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ROL(i32 %0, i32 %1) {
%3 = tail call i32 asm "roll %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  if (x <= 0) {
    return 0;
  }
  while (x != 0) {
    x = x - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     113f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1163 <main+0x53>
jmp    1144 <main+0x34>
cmpl   $0x0,-0x8(%rbp)
je     115c <main+0x4c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %15
7: ; preds = %0
br label %8
8: ; preds = %11, %7
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %2
br label %8
14: ; preds = %8
store i32 0, i32* %1
br label %15
15: ; preds = %14, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void balance_symbols_pascal(char *filename) {
  printf("Probably implement in the near future");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Probably implement in the near future\00"
define void @balance_symbols_pascal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Probably implement in the near future\00"
define void @balance_symbols_pascal(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 254;
  printf("%d in hex format is 0x%x\n", a, a);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"%d in hex format is 0x%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 254, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"%d in hex format is 0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 254, i32 254)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scaF(char *);
void scaF2(char *x) { scaF(x); }


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

x86 assembly (clang, -O2):
<scaF2>:
jmp    1030 <scaF@plt>

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

LLVM IR (-O2):
define void @scaF2(i8* %0) {
%2 = tail call i32 @scaF(i8* %0)
ret void
}
void adcRequest(unsigned int group_channel) {
  if (group_channel > 0xffff) {
    (*((volatile unsigned int *const)(0x48030000 + 0x1c4))) =
        (group_channel >> 16) & 0xffff;
  } else {
    (*((volatile unsigned int *const)(0x48030000 + 0x1c0))) = group_channel;
  }
}


x86 assembly (clang, -O0):
<adcRequest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffff,-0x4(%rbp)
jbe    112c <adcRequest+0x2c>
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
mov    $0x480301c4,%eax
mov    %ecx,(%rax)
jmp    1136 <adcRequest+0x36>
mov    -0x4(%rbp),%ecx
mov    $0x480301c0,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcRequest>:
cmp    $0x10000,%edi
jb     1113 <adcRequest+0x13>
shr    $0x10,%edi
mov    %edi,0x480301c4
ret
mov    %edi,0x480301c0
ret

LLVM IR (-O0):
define void @adcRequest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 65535
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = and i32 %7, 65535
store volatile i32 %8, i32* inttoptr (i64 1208156612 to i32*)
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
store volatile i32 %10, i32* inttoptr (i64 1208156608 to i32*)
br label %11
11: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
define void @adcRequest(i32 %0) {
%2 = icmp ugt i32 %0, 65535
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i32 %0, 16
store volatile i32 %4, i32* inttoptr (i64 1208156612 to i32*)
br label %6
5: ; preds = %1
store volatile i32 %0, i32* inttoptr (i64 1208156608 to i32*)
br label %6
6: ; preds = %5, %3
ret void
}
/* Type definitions */
struct vec4 {
  int dummy;
};
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec4_multiply_mat4(float *, float *, float *);
__attribute__((always_)) struct vec4 *
psvec4_multiply_mat4(struct vec4 *result, struct vec4 *a, struct mat4 *m) {
  vec4_multiply_mat4((float *)result, (float *)a, (float *)m);
  return result;
}


x86 assembly (clang, -O0):
<psvec4_multiply_mat4>:
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
call   1030 <vec4_multiply_mat4@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec4_multiply_mat4>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4_multiply_mat4@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4 = type { i32 }
%struct.mat4 = type { i32 }
define %struct.vec4* @psvec4_multiply_mat4(%struct.vec4* %0, %struct.vec4* %1, %struct.mat4* %2) {
%4 = alloca %struct.vec4*
%5 = alloca %struct.vec4*
%6 = alloca %struct.mat4*
store %struct.vec4* %0, %struct.vec4** %4
store %struct.vec4* %1, %struct.vec4** %5
store %struct.mat4* %2, %struct.mat4** %6
%7 = load %struct.vec4*, %struct.vec4** %4
%8 = bitcast %struct.vec4* %7 to float*
%9 = load %struct.vec4*, %struct.vec4** %5
%10 = bitcast %struct.vec4* %9 to float*
%11 = load %struct.mat4*, %struct.mat4** %6
%12 = bitcast %struct.mat4* %11 to float*
%13 = call i32 @vec4_multiply_mat4(float* %8, float* %10, float* %12)
%14 = load %struct.vec4*, %struct.vec4** %4
ret %struct.vec4* %14
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
%struct.mat4 = type { i32 }
define %struct.vec4* @psvec4_multiply_mat4(%struct.vec4* returned %0, %struct.vec4* %1, %struct.mat4* %2) {
%4 = bitcast %struct.vec4* %0 to float*
%5 = bitcast %struct.vec4* %1 to float*
%6 = bitcast %struct.mat4* %2 to float*
%7 = tail call i32 @vec4_multiply_mat4(float* %4, float* %5, float* %6)
ret %struct.vec4* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void fatal(char *str) {
  printf("Fatal error: %s\n", str);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Fatal error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Fatal error: %s\0A\00"
define void @fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int Section2Second(int number) { return number % 1000 / 100; }


x86 assembly (clang, -O0):
<Section2Second>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section2Second>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
cwtl
imul   $0x147b,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x13,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Section2Second(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 1000
%5 = sdiv i32 %4, 100
ret i32 %5
}

LLVM IR (-O2):
define i32 @Section2Second(i32 %0) {
%2 = srem i32 %0, 1000
%3 = trunc i32 %2 to i16
%4 = sdiv i16 %3, 100
%5 = sext i16 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52_set_bsmod(uint8_t *p_a52, uint8_t i_bsid) {
  p_a52[5] &= ~0x7;
  p_a52[5] |= i_bsid & 0x7;
}


x86 assembly (clang, -O0):
<a52_set_bsmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
and    $0xfffffff8,%ecx
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    -0x8(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_set_bsmod>:
mov    0x14(%rdi),%eax
and    $0xfffffff8,%eax
and    $0x7,%esi
or     %eax,%esi
mov    %esi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @a52_set_bsmod(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 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
%8 = and i32 %7, -8
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 5
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @a52_set_bsmod(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
%4 = load i32, i32* %3
%5 = and i32 %4, -8
%6 = and i32 %1, 7
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
extern unsigned __atomic_fetch_add_4(unsigned *mem, unsigned addend,
                                     int mem_type) {
  unsigned ret = *mem;
  *mem += addend;
  return ret;
}


x86 assembly (clang, -O0):
<__atomic_fetch_add_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_add_4>:
mov    (%rdi),%eax
add    %eax,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define i32 @__atomic_fetch_add_4(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32, i32* %5
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = add i32 %12, %10
store i32 %13, i32* %11
%14 = load i32, i32* %7
ret i32 %14
}

LLVM IR (-O2):
define i32 @__atomic_fetch_add_4(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = add i32 %4, %1
store i32 %5, i32* %0
ret i32 %4
}
void foo218(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo218(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GP_create(int, char *, char *);
char *getString();
int /*<<< orphan*/ isNString(int);
int /*<<< orphan*/ messErr(int);
void IF_gplot_new(void) {
  char *t, *f;
  if (!isNString(2)) {
    messErr(6);
    return;
  }
  t = getString();
  f = getString();
  GP_create(0 | 1, t, f);
}


x86 assembly (clang, -O0):
<IF_gplot_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <isNString@plt>
cmp    $0x0,%eax
jne    116a <IF_gplot_new+0x2a>
mov    $0x6,%edi
call   1050 <messErr@plt>
jmp    1192 <IF_gplot_new+0x52>
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1060 <GP_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_gplot_new>:
push   %rbx
mov    $0x2,%edi
call   1040 <isNString@plt>
test   %eax,%eax
je     1171 <IF_gplot_new+0x31>
xor    %eax,%eax
call   1030 <getString@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getString@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1060 <GP_create@plt>
mov    $0x6,%edi
pop    %rbx
jmp    1050 <messErr@plt>

LLVM IR (-O0):
define void @IF_gplot_new() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i32 @isNString(i32 2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @messErr(i32 6)
br label %13
7: ; preds = %0
%8 = call i8* (...) @getString()
store i8* %8, i8** %1
%9 = call i8* (...) @getString()
store i8* %9, i8** %2
%10 = load i8*, i8** %1
%11 = load i8*, i8** %2
%12 = call i32 @GP_create(i32 1, i8* %10, i8* %11)
br label %13
13: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @IF_gplot_new() {
%1 = tail call i32 @isNString(i32 2)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @messErr(i32 6)
br label %9
5: ; preds = %0
%6 = tail call i8* (...) @getString()
%7 = tail call i8* (...) @getString()
%8 = tail call i32 @GP_create(i32 1, i8* %6, i8* %7)
br label %9
9: ; preds = %5, %3
ret void
}
int assertion_cmp_u(unsigned lhs, unsigned rhs) {
  if (lhs == rhs) {
    return 0;
  } else if (lhs < rhs) {
    return -1;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<assertion_cmp_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <assertion_cmp_u+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1141 <assertion_cmp_u+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    113a <assertion_cmp_u+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <assertion_cmp_u+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertion_cmp_u>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setae  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @assertion_cmp_u(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp ult i32 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
int bit_index(unsigned int a) {
  int i;
  if (a == 0)
    return -1;
  for (i = 0; (a & 1) == 0; a >>= 1, i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<bit_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <bit_index+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <bit_index+0x55>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114f <bit_index+0x4f>
jmp    1138 <bit_index+0x38>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <bit_index+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_index>:
test   %edi,%edi
je     111e <bit_index+0x1e>
xor    %eax,%eax
test   $0x1,%dil
jne    111d <bit_index+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1110 <bit_index+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @bit_index(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
double gdtr(a, b, x)
double a, b, x;
{
  if (x < 0.0) {
    mtherr("gdtr", 1);
    return (0.0);
  }
  return (igam(b, a * x));
}


x86 assembly (clang, -O0):
<gdtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1165 <gdtr+0x45>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <gdtr+0x64>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1030 <igam@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdtr>:
push   %rax
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jbe    1148 <gdtr+0x28>
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret
mulsd  %xmm2,%xmm3
movaps %xmm1,%xmm0
movapd %xmm3,%xmm1
mov    $0x2,%al
call   1030 <igam@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"gdtr\00"
define double @gdtr(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %7
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
store double 0.000000e+00, double* %4
br label %19
12: ; preds = %3
%13 = load double, double* %6
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fmul double %14, %15
%17 = call i32 (double, double, ...) bitcast (i32 (...)* @igam to i32 (double, double, ...)*)(double %13, double %16)
%18 = sitofp i32 %17 to double
store double %18, double* %4
br label %19
19: ; preds = %12, %10
%20 = load double, double* %4
ret double %20
}

LLVM IR (-O2):
@.str = [5 x i8] c"gdtr\00"
define double @gdtr(double %0, double %1, double %2) {
%4 = fcmp olt double %2, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
br label %11
7: ; preds = %3
%8 = fmul double %0, %2
%9 = tail call i32 (double, double, ...) bitcast (i32 (...)* @igam to i32 (double, double, ...)*)(double %1, double %8)
%10 = sitofp i32 %9 to double
br label %11
11: ; preds = %7, %5
%12 = phi double [ 0.000000e+00, %5 ], [ %10, %7 ]
ret double %12
}
__attribute__((vector_size(16))) float f1(void) {}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movaps -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <4 x float> @f1() {
%1 = alloca <4 x float>
%2 = load <4 x float>, <4 x float>* %1
ret <4 x float> %2
}

LLVM IR (-O2):
define <4 x float> @f1() {
ret <4 x float> undef
}
void BN_mod_exp_recp(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_exp_recp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ install_malloc_hooks();
int /*<<< orphan*/ restore_malloc_hooks();
void libc_free(void *ptr) {
  restore_malloc_hooks();
  free(ptr);
  install_malloc_hooks();
}


x86 assembly (clang, -O0):
<libc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <restore_malloc_hooks@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1050 <install_malloc_hooks@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_free>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <restore_malloc_hooks@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <install_malloc_hooks@plt>

LLVM IR (-O0):
define void @libc_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @restore_malloc_hooks()
%4 = load i8*, i8** %2
%5 = call i32 @free(i8* %4)
%6 = call i32 (...) @install_malloc_hooks()
ret void
}

LLVM IR (-O2):
define void @libc_free(i8* nocapture %0) {
%2 = tail call i32 (...) @restore_malloc_hooks()
%3 = tail call i32 @free(i8* %0)
%4 = tail call i32 (...) @install_malloc_hooks()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
int /*<<< orphan*/ strftime(char *, size_t, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_date(char *buffer, size_t size) {
  const time_t now = time(NULL);
  struct tm *tm = localtime(&now);
  strftime(buffer, size, "%F %T UTC%z", tm);
}


x86 assembly (clang, -O0):
<get_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    0xe94(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_date>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeaa(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%F %T UTC%z\00"
define void @get_date(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.tm*
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %8, %struct.tm** %6
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = load %struct.tm*, %struct.tm** %6
%12 = call i32 @strftime(i8* %9, i64 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%F %T UTC%z\00"
define void @get_date(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
noiferr() { error("no matching #if..."); }


x86 assembly (clang, -O0):
<noiferr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"no matching #if...\00"
define i32 @noiferr() {
%1 = alloca i32
%2 = call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [19 x i8] c"no matching #if...\00"
define i32 @noiferr() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int _execl(name, args)
char *name;
int args;
{
  extern char **environ;
  return _execve(name, &args, environ);
}


x86 assembly (clang, -O0):
<_execl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%rdx
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <_execve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_execl>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%rdx
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <_execve@plt>
pop    %rcx
ret

LLVM IR (-O0):
@environ = external global i8**
define i32 @_execl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** @environ
%7 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @_execve to i32 (i8*, i32*, i8**, ...)*)(i8* %5, i32* %4, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
@environ = external global i8**
define i32 @_execl(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i8**, i8*** @environ
%5 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @_execve to i32 (i8*, i32*, i8**, ...)*)(i8* %0, i32* %3, i8** %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ i2c_EnableINT(int /*<<< orphan*/, unsigned char);
void i2c0_EnableINT(unsigned char i2cints) { i2c_EnableINT(0, i2cints); }


x86 assembly (clang, -O0):
<i2c0_EnableINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movzbl -0x1(%rbp),%esi
call   1030 <i2c_EnableINT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c0_EnableINT>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <i2c_EnableINT@plt>

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

LLVM IR (-O2):
define void @i2c0_EnableINT(i8 zeroext %0) {
%2 = tail call i32 @i2c_EnableINT(i32 0, i8 zeroext %0)
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long my_ftime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (long)(t.tv_sec) * 1000 + (long)(t.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<my_ftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ftime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @my_ftime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @my_ftime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
long int f2(long int b) { return (16 + (b & 7)) & 15; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
add    $0x10,%rax
and    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %rdi,%rax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i64 @f2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 7
%5 = add nsw i64 16, %4
%6 = and i64 %5, 15
ret i64 %6
}

LLVM IR (-O2):
define i64 @f2(i64 %0) {
%2 = and i64 %0, 7
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *t;
  if (size == 0)
    return NULL;
  t = malloc(size);
  if (t == NULL) {
    fprintf(stderr, ("out of memory"));
    exit(1);
  }
  return t;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1193 <xmalloc+0x63>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118b <xmalloc+0x5b>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
test   %rdi,%rdi
je     1142 <xmalloc+0x12>
call   1040 <malloc@plt>
test   %rax,%rax
je     1146 <xmalloc+0x16>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %19
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %8
%18 = load i8*, i8** %4
store i8* %18, i8** %2
br label %19
19: ; preds = %17, %7
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3, %1
%11 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %11
}
int get_nondet_int(void) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
define i32 @get_nondet_int() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_nondet_int() {
ret i32 undef
}
void RTProcGetPriority(void) {}


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

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

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

LLVM IR (-O2):
define void @RTProcGetPriority() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("\nOI\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\0AOI\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"\0AOI\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void dr_register_host(struct resource *r, int rs) {}


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

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

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

LLVM IR (-O2):
%struct.resource = type opaque
define void @dr_register_host(%struct.resource* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crmode();
void flush_in() { crmode(); }


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

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

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

LLVM IR (-O2):
define void @flush_in() {
%1 = tail call i32 (...) @crmode()
ret void
}
/* Type definitions */
struct esh_shell {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
bool init_plugin(struct esh_shell *shell) {
  printf("Plugin 'prompt' initialized...\n");
  return true;
}


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

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

LLVM IR (-O0):
%struct.esh_shell = type { i32 }
@.str = [32 x i8] c"Plugin 'prompt' initialized...\0A\00"
define i32 @init_plugin(%struct.esh_shell* %0) {
%2 = alloca %struct.esh_shell*
store %struct.esh_shell* %0, %struct.esh_shell** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.esh_shell = type { i32 }
@str = [31 x i8] c"Plugin 'prompt' initialized...\00"
define i32 @init_plugin(%struct.esh_shell* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 1
}
long __ocl_convert_long_char_sat(char src) { return src; }


x86 assembly (clang, -O0):
<__ocl_convert_long_char_sat>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbq -0x1(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_convert_long_char_sat>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__ocl_convert_long_char_sat(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @__ocl_convert_long_char_sat(i8 signext %0) {
%2 = sext i8 %0 to i64
ret i64 %2
}
double decimalPortion(double d) { return d - (double)(int)d; }


x86 assembly (clang, -O0):
<decimalPortion>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalPortion>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @decimalPortion(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fsub double %3, %6
ret double %7
}

LLVM IR (-O2):
define double @decimalPortion(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ run_tests(int, char **);
int main(int argc, char **args) {
  run_tests(argc, args);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <run_tests@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <run_tests@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @run_tests(i32 %6, i8** %7)
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @run_tests(i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun1() { printf("In fun1\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"In fun1\00"
define void @fun1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *mm_block_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<mm_block_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mm_block_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int fptr(int x) { return x - 1; }


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

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

LLVM IR (-O0):
define i32 @fptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @fptr(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
char read_uart() { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @read_uart() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @read_uart() {
ret i8 0
}