xunge/DecIR huggingface dataset:
int test_imm_C1uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xC1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C1uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12648448
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
void think(int argi) {
  printf("I'm philosopher #%d,I will think for %d second(s)!\n", argi,
         argi + 4);
  sleep(argi + 4);
}


x86 assembly (clang, -O0):
<think>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
add    $0x4,%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x4,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<think>:
push   %rbx
mov    %edi,%esi
lea    0x4(%rsi),%ebx
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"I'm philosopher #%d,I will think for %d second(s)!\0A\00"
define void @think(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 4
%6 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 4
%9 = call i32 @sleep(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"I'm philosopher #%d,I will think for %d second(s)!\0A\00"
define void @think(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
%4 = tail call i32 @sleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b();
int /*<<< orphan*/ printf(char *);
void a() {
  printf("a\n");
  b();
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <b@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [2 x i8] c"a\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @b()
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c = EOF;
  printf("%5d", c);
  return 0;
}


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

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

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

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

x86 assembly (clang, -O2):
<main>:
push   %rax
add    $0x1,%edi
call   1030 <print_arguments@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 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = load i8**, i8*** %5
%9 = call i32 @print_arguments(i32 %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 @print_arguments(i32 %3, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ spin();
unsigned long nop(unsigned long val) {
  spin();
  return val;
}


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

x86 assembly (clang, -O2):
<nop>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <spin@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @nop(i64 returned %0) {
%2 = tail call i32 (...) @spin()
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ towerOfHanoi(int);
int main() {
  towerOfHanoi(5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <towerOfHanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @towerOfHanoi(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @towerOfHanoi(i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_dword(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
void eeconfig_update_user(uint32_t val) {
  eeprom_update_dword((uint32_t *)19, val);
}


x86 assembly (clang, -O0):
<eeconfig_update_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x13,%edi
call   1030 <eeprom_update_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_update_user>:
mov    %edi,%esi
mov    $0x13,%edi
jmp    1030 <eeprom_update_dword@plt>

LLVM IR (-O0):
define void @eeconfig_update_user(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @eeprom_update_dword(i32* inttoptr (i64 19 to i32*), i32 %3)
ret void
}

LLVM IR (-O2):
define void @eeconfig_update_user(i32 %0) {
%2 = tail call i32 @eeprom_update_dword(i32* inttoptr (i64 19 to i32*), i32 %0)
ret void
}
int main() {
  int n = 1234567890;
  float f = 1234567890;
  double d = 1234567890;
  short s = 1234567890;
  showbyte(&n, sizeof(n));
  showbyte(&f, sizeof(f));
  showbyte(&d, sizeof(d));
  showbyte(&s, sizeof(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x499602d2,-0x8(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movw   $0x2d2,-0x1a(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <showbyte@plt>
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <showbyte@plt>
lea    -0x18(%rbp),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <showbyte@plt>
lea    -0x1a(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <showbyte@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x499602d2,0xc(%rsp)
49
movl   $0x4e932c06,0x8(%rsp)
4e
movabs $0x41d26580b4800000,%rax
65 d2 41
mov    %rax,0x10(%rsp)
movw   $0x2d2,0x6(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <showbyte@plt>
lea    0x8(%rsp),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <showbyte@plt>
lea    0x10(%rsp),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <showbyte@plt>
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <showbyte@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
%5 = alloca i16
store i32 0, i32* %1
store i32 1234567890, i32* %2
store float 0x41D26580C0000000, float* %3
store double 0x41D26580B4800000, double* %4
store i16 722, i16* %5
%6 = call i32 (i32*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (i32*, i64, ...)*)(i32* %2, i64 4)
%7 = call i32 (float*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (float*, i64, ...)*)(float* %3, i64 4)
%8 = call i32 (double*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (double*, i64, ...)*)(double* %4, i64 8)
%9 = call i32 (i16*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (i16*, i64, ...)*)(i16* %5, i64 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca i16
%5 = bitcast i32* %1 to i8*
store i32 1234567890, i32* %1
%6 = bitcast float* %2 to i8*
store float 0x41D26580C0000000, float* %2
%7 = bitcast double* %3 to i8*
store double 0x41D26580B4800000, double* %3
%8 = bitcast i16* %4 to i8*
store i16 722, i16* %4
%9 = call i32 (i32*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (i32*, i64, ...)*)(i32* %1, i64 4)
%10 = call i32 (float*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (float*, i64, ...)*)(float* %2, i64 4)
%11 = call i32 (double*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (double*, i64, ...)*)(double* %3, i64 8)
%12 = call i32 (i16*, i64, ...) bitcast (i32 (...)* @showbyte to i32 (i16*, i64, ...)*)(i16* %4, i64 2)
ret i32 0
}
void INT_Excep_PERIB_INTB196(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB196() {
ret void
}
int _getpid() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_getpid() {
ret i32 -1
}
void OSTimeTickHook(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cbmarch_pp_write(int, int /*<<< orphan*/);
void cbm_pp_write(int HandleDevice, __u_char Byte) {
  ;
  cbmarch_pp_write(HandleDevice, Byte);
  return;
}


x86 assembly (clang, -O0):
<cbm_pp_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <cbmarch_pp_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_pp_write>:
jmp    1030 <cbmarch_pp_write@plt>

LLVM IR (-O0):
define void @cbm_pp_write(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 @cbmarch_pp_write(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @cbm_pp_write(i32 %0, i32 %1) {
%3 = tail call i32 @cbmarch_pp_write(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void write_uint16(uint32_t offset, uint16_t value) {}


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

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

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

LLVM IR (-O2):
define void @write_uint16(i32 %0, i32 %1) {
ret void
}
void genld() {}


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

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

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

LLVM IR (-O2):
define void @genld() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *malloc_verify(size_t size) {
  void *p;
  p = malloc(size);
  if (!p) {
    fprintf(stderr, "blockrage: malloc failed!\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<malloc_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <malloc_verify+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_verify>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <malloc_verify+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"blockrage: malloc failed!\0A\00"
define i8* @malloc_verify(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"blockrage: malloc failed!\0A\00"
define noalias i8* @malloc_verify(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int omap_vout_vrfb_buffer_setup(struct omap_vout_device *vout,
                                unsigned int *count, unsigned int startindex) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.omap_vout_device = type opaque
define i32 @omap_vout_vrfb_buffer_setup(%struct.omap_vout_device* %0, i32* %1, i32 %2) {
%4 = alloca %struct.omap_vout_device*
%5 = alloca i32*
%6 = alloca i32
store %struct.omap_vout_device* %0, %struct.omap_vout_device** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.omap_vout_device = type opaque
define i32 @omap_vout_vrfb_buffer_setup(%struct.omap_vout_device* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ part1();
int /*<<< orphan*/ part2();
int /*<<< orphan*/ part3();
int /*<<< orphan*/ part4();
int /*<<< orphan*/ part5();
int /*<<< orphan*/ part6();
int /*<<< orphan*/ part7();
int main(int argc, char **argv) {
  part1();
  part2();
  part3();
  part4();
  part5();
  part6();
  part7();
  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   1060 <part1@plt>
mov    $0x0,%al
call   1090 <part2@plt>
mov    $0x0,%al
call   1050 <part3@plt>
mov    $0x0,%al
call   1080 <part4@plt>
mov    $0x0,%al
call   1040 <part5@plt>
mov    $0x0,%al
call   1070 <part6@plt>
mov    $0x0,%al
call   1030 <part7@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <part1@plt>
xor    %eax,%eax
call   1090 <part2@plt>
xor    %eax,%eax
call   1050 <part3@plt>
xor    %eax,%eax
call   1080 <part4@plt>
xor    %eax,%eax
call   1040 <part5@plt>
xor    %eax,%eax
call   1070 <part6@plt>
xor    %eax,%eax
call   1030 <part7@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 (...) @part1()
%7 = call i32 (...) @part2()
%8 = call i32 (...) @part3()
%9 = call i32 (...) @part4()
%10 = call i32 (...) @part5()
%11 = call i32 (...) @part6()
%12 = call i32 (...) @part7()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @part1()
%4 = tail call i32 (...) @part2()
%5 = tail call i32 (...) @part3()
%6 = tail call i32 (...) @part4()
%7 = tail call i32 (...) @part5()
%8 = tail call i32 (...) @part6()
%9 = tail call i32 (...) @part7()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fb_hTimeDecodeSerial(double, int /*<<< orphan*/, int *,
                                        int /*<<< orphan*/, int);
int fb_Minute(double serial) {
  int minute;
  fb_hTimeDecodeSerial(serial, 0, &minute, 0, 1);
  return minute;
}


x86 assembly (clang, -O0):
<fb_Minute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edx,%edx
lea    -0xc(%rbp),%rsi
mov    $0x1,%ecx
mov    %edx,%edi
call   1030 <fb_hTimeDecodeSerial@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_Minute>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <fb_hTimeDecodeSerial@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fb_Minute(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fb_hTimeDecodeSerial(double %0, i32 0, i32* %2, i32 0, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
unsigned long getdiskspace(char const *, unsigned long, int /*<<< orphan*/);
unsigned long getdisksize(const char *path, unsigned long unit) {
  return getdiskspace(path, unit, 0);
}


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

x86 assembly (clang, -O2):
<getdisksize>:
xor    %edx,%edx
jmp    1030 <getdiskspace@plt>

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

LLVM IR (-O2):
define i64 @getdisksize(i8* %0, i64 %1) {
%3 = tail call i64 @getdiskspace(i8* %0, i64 %1, i32 0)
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ r;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, int *, int);
float modbus_get_float(const uint16_t *src) {
  float r = 0.0f;
  uint32_t i;
  i = (((uint32_t)src[1]) << 16) + src[0];
  memcpy(&r, &i, sizeof(r));
  return r;
}


x86 assembly (clang, -O0):
<modbus_get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbus_get_float>:
push   %rax
movl   $0x0,(%rsp)
mov    0x4(%rdi),%eax
shl    $0x10,%eax
add    (%rdi),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @modbus_get_float(i32* %0) {
%2 = alloca i32*
%3 = alloca float
%4 = alloca i32
store i32* %0, i32** %2
store float 0.000000e+00, float* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
store i32 %12, i32* %4
%13 = call i32 @memcpy(float* %3, i32* %4, i32 4)
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @modbus_get_float(i32* nocapture %0) {
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32, i32* %0
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = call i32 @memcpy(float* %2, i32* %3, i32 4)
%12 = load float, float* %2
ret float %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpat1(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x30));
}


x86 assembly (clang, -O0):
<read_pxpat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x30,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpat1>:
shl    $0x8,%edi
mov    $0xb0010030,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpat1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 48
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpat1(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 48
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void script_process_categories_header() {
  printf("\n\t<ul id='categ' class='categories'>\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"\0A\09<ul id='categ' class='categories'>\0A\00"
define void @script_process_categories_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"\0A\09<ul id='categ' class='categories'>\00"
define void @script_process_categories_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
struct skynet_context {
  int dummy;
};

/* Variables and functions */
int skynet_harbor_message_isremote(int);
int skynet_isremote(struct skynet_context *ctx, uint32_t handle, int *harbor) {
  int ret = skynet_harbor_message_isremote(handle);
  if (harbor) {
    *harbor = (int)(handle >> 24);
  }
  return ret;
}


x86 assembly (clang, -O0):
<skynet_isremote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <skynet_harbor_message_isremote@plt>
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <skynet_isremote+0x35>
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skynet_isremote>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %esi,%edi
call   1030 <skynet_harbor_message_isremote@plt>
test   %rbx,%rbx
je     1129 <skynet_isremote+0x19>
sar    $0x18,%ebp
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.skynet_context = type { i32 }
define i32 @skynet_isremote(%struct.skynet_context* %0, i32 %1, i32* %2) {
%4 = alloca %struct.skynet_context*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store %struct.skynet_context* %0, %struct.skynet_context** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %5
%9 = call i32 @skynet_harbor_message_isremote(i32 %8)
store i32 %9, i32* %7
%10 = load i32*, i32** %6
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* %5
%14 = ashr i32 %13, 24
%15 = load i32*, i32** %6
store i32 %14, i32* %15
br label %16
16: ; preds = %12, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
%struct.skynet_context = type { i32 }
define i32 @skynet_isremote(%struct.skynet_context* nocapture readnone %0, i32 %1, i32* writeonly %2) {
%4 = tail call i32 @skynet_harbor_message_isremote(i32 %1)
%5 = icmp eq i32* %2, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = ashr i32 %1, 24
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %3
ret i32 %4
}
void UartPrintfCritical(const char *format, ...) { (void)format; }


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

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

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

LLVM IR (-O2):
define void @UartPrintfCritical(i8* nocapture %0, ...) {
ret void
}
int fcntl(fd, cmd, arg)
int fd;
int cmd;
int arg;
{
  int rc = 0;
  return rc;
}


x86 assembly (clang, -O0):
<fcntl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fcntl(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
store i32 0, i32* %7
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @fcntl(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ branch_if(int);
void zpiracy(void) { branch_if(true); }


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

x86 assembly (clang, -O2):
<zpiracy>:
mov    $0x1,%edi
jmp    1030 <branch_if@plt>

LLVM IR (-O0):
define void @zpiracy() {
%1 = call i32 @branch_if(i32 1)
ret void
}

LLVM IR (-O2):
define void @zpiracy() {
%1 = tail call i32 @branch_if(i32 1)
ret void
}
/* Type definitions */
struct radix_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct radix_node *);
void delete_radix_node(struct radix_node *node) { free(node); }


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

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

LLVM IR (-O2):
%struct.radix_node = type { i32 }
define void @delete_radix_node(%struct.radix_node* nocapture %0) {
%2 = tail call i32 @free(%struct.radix_node* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello() {
  printf("Hello World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rand();
float math_random(float min, float max) {
  return (rand() % (int)((max + 1) - min)) + min;
}


x86 assembly (clang, -O0):
<math_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movss  0xecf(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
addss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_random>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
movss  (%rsp),%xmm0
addss  0xed0(%rip),%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%ecx
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @math_random(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call i32 (...) @rand()
%6 = load float, float* %4
%7 = fadd float %6, 1.000000e+00
%8 = load float, float* %3
%9 = fsub float %7, %8
%10 = fptosi float %9 to i32
%11 = srem i32 %5, %10
%12 = sitofp i32 %11 to float
%13 = load float, float* %3
%14 = fadd float %12, %13
ret float %14
}

LLVM IR (-O2):
define float @math_random(float %0, float %1) {
%3 = tail call i32 (...) @rand()
%4 = fadd float %1, 1.000000e+00
%5 = fsub float %4, %0
%6 = fptosi float %5 to i32
%7 = srem i32 %3, %6
%8 = sitofp i32 %7 to float
%9 = fadd float %8, %0
ret float %9
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
long long rlb_tv_usec(const struct timeval *tv) {
  long long us;
  us = tv->tv_sec;
  us *= 1000000;
  us += tv->tv_usec;
  return us;
}


x86 assembly (clang, -O0):
<rlb_tv_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlb_tv_usec>:
imul   $0xf4240,(%rdi),%rax
add    0x8(%rdi),%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @rlb_tv_usec(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = mul nsw i64 %7, 1000000
store i64 %8, i64* %3
%9 = load %struct.timeval*, %struct.timeval** %2
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%11 = load i64, i64* %10
%12 = load i64, i64* %3
%13 = add nsw i64 %12, %11
store i64 %13, i64* %3
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @rlb_tv_usec(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char const *);
int strlen(char const *);
const char *set_tag(const char *tag, const char *s) {
  if (strlen(s) >= 128 - 1)
    fatal_error("%s too long", tag);
  return s;
}


x86 assembly (clang, -O0):
<set_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x7f,%eax
jl     1152 <set_tag+0x32>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tag>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0x7f,%eax
jl     1146 <set_tag+0x26>
lea    0xec2(%rip),%rdi
mov    %r14,%rsi
call   1040 <fatal_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s too long\00"
define i8* @set_tag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @strlen(i8* %5)
%7 = icmp sge i32 %6, 127
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @fatal_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s too long\00"
define i8* @set_tag(i8* %0, i8* returned %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp sgt i32 %3, 126
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* %1
}
void *gc_immediate_i(void *o) { return o; }


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

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

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

LLVM IR (-O2):
define i8* @gc_immediate_i(i8* readnone returned %0) {
ret i8* %0
}
int test_imm_CCuint8_reg(unsigned char val) {
  return ((val) & (-0xCC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CCuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff34,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_CCuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 52
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ setLastError(char *);
int Test() {
  setLastError("TestFunction");
  return 999;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"TestFunction\00"
define i32 @Test() {
%1 = call i32 @setLastError(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 999
}

LLVM IR (-O2):
@.str = [13 x i8] c"TestFunction\00"
define i32 @Test() {
%1 = tail call i32 @setLastError(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 999
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("helloworld"); }


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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"helloworld\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ report(int /*<<< orphan*/, char *, char const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void log_open_entry(const char *path) {
  report(LOG_ERR, "Unable to open watched file \"%s\": %s", path,
         strerror(errno));
}


x86 assembly (clang, -O0):
<log_open_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xea2(%rip),%rsi
call   1030 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open_entry>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <report@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [37 x i8] c"Unable to open watched file \22%s\22: %s\00"
@errno = global i32 0
define void @log_open_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_ERR
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i32 @strerror(i32 %5)
%7 = call i32 @report(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [37 x i8] c"Unable to open watched file \22%s\22: %s\00"
@errno = global i32 0
define void @log_open_entry(i8* %0) {
%2 = load i32, i32* @LOG_ERR
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @report(i32 %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int adds32(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x = 0, y = 0;
  int result = 0;
  scanf("%d%d", &x, &y);
  result = adds32(x, y);
  printf("\n%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xea5(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <adds32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xeb9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <adds32@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @adds32(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Wel come to depik"); }


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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Wel come to depik\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int bitonic(int *, int);
int test_bitonic() {
  int input[] = {1, 11, 2, 10, 4, 5, 2, 1};
  return 6 == bitonic(input, 8);
}


x86 assembly (clang, -O0):
<test_bitonic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1030 <bitonic@plt>
mov    %eax,%ecx
mov    $0x6,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bitonic>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <bitonic@plt>
xor    %ecx,%ecx
cmp    $0x6,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_bitonic.input = [8 x i32] [i32 1, i32 11, i32 2, i32 10, i32 4, i32 5, i32 2, i32 1]
define i32 @test_bitonic() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @bitonic(i32* %3, i32 8)
%5 = icmp eq i32 6, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_bitonic.input = [8 x i32] [i32 1, i32 11, i32 2, i32 10, i32 4, i32 5, i32 2, i32 1]
define i32 @test_bitonic() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @bitonic(i32* %3, i32 8)
%5 = icmp eq i32 %4, 6
%6 = zext i1 %5 to i32
ret i32 %6
}
extern int check_disk_change(struct block_device *x) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.block_device = type opaque
define i32 @check_disk_change(%struct.block_device* %0) {
%2 = alloca %struct.block_device*
%3 = alloca i32
store %struct.block_device* %0, %struct.block_device** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.block_device = type opaque
define i32 @check_disk_change(%struct.block_device* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
struct phnctr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_phnctr(struct phnctr *ctr) { free_object(31, (short *)ctr); }


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

x86 assembly (clang, -O2):
<free_phnctr>:
mov    %rdi,%rsi
mov    $0x1f,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.phnctr = type { i32 }
define void @free_phnctr(%struct.phnctr* %0) {
%2 = alloca %struct.phnctr*
store %struct.phnctr* %0, %struct.phnctr** %2
%3 = load %struct.phnctr*, %struct.phnctr** %2
%4 = bitcast %struct.phnctr* %3 to i16*
%5 = call i32 @free_object(i32 31, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.phnctr = type { i32 }
define void @free_phnctr(%struct.phnctr* %0) {
%2 = bitcast %struct.phnctr* %0 to i16*
%3 = tail call i32 @free_object(i32 31, i16* %2)
ret void
}
void mmo_printbuf(const char *buf, int count, const char *comment) {}


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

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

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

LLVM IR (-O2):
define void @mmo_printbuf(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int isatty(int file) { svcPanic(); }


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
%2 = tail call i32 (...) @svcPanic()
ret i32 undef
}