xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ helper_double_25_recursive(double *, int);
void helper_double_25(double *buf) { helper_double_25_recursive(buf, 25); }


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

x86 assembly (clang, -O2):
<helper_double_25>:
mov    $0x19,%esi
jmp    1030 <helper_double_25_recursive@plt>

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

LLVM IR (-O2):
define void @helper_double_25(double* %0) {
%2 = tail call i32 @helper_double_25_recursive(double* %0, i32 25)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
scalar_t__ pthread_self();
void *execucaoThread(void *arg) {
  printf("Nova thread criada. TID == %u\n", (unsigned int)pthread_self());
}


x86 assembly (clang, -O0):
<execucaoThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execucaoThread>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Nova thread criada. TID == %u\0A\00"
define i8* @execucaoThread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @pthread_self()
%5 = trunc i64 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [31 x i8] c"Nova thread criada. TID == %u\0A\00"
define noalias i8* @execucaoThread(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 10;
  int b = 11;
  int tmp = a;
  a = b;
  b = tmp;
  printf("a=%d, b=%d\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebb(%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    $0xb,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11, i32 10)
ret i32 0
}
/* Variables and functions */
int ata_init();
int SLIC_driver_init(void) {
  int tmp;
  {
    tmp = ata_init();
    return (tmp);
  }
}


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

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

LLVM IR (-O0):
define i32 @SLIC_driver_init() {
%1 = alloca i32
%2 = call i32 (...) @ata_init()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @SLIC_driver_init() {
%1 = tail call i32 (...) @ata_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void thread_uninit(void) { pthread_exit(NULL); }


x86 assembly (clang, -O0):
<thread_uninit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_uninit>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define void @thread_uninit() {
%1 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
define void @thread_uninit() {
%1 = tail call i32 @pthread_exit(i32* null)
ret void
}
int search(int key, int all[], int length) {
  int ret = -1;
  int i;
  for (i = 0; i < length; i++) {
    if (all[i] == key) {
      ret = i;
      break;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <search+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jne    1147 <search+0x47>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115a <search+0x5a>
jmp    114c <search+0x4c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <search+0x1c>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <search+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edi,(%rsi,%rcx,4)
je     111f <search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void GFX_SetMode(int mode) {
  fprintf(stderr, "Setting mode %d\n", mode);
  switch (mode) {
  case 0:
    break;
  case 1:
    break;
  default:
    fprintf(stderr, "unknown mode %d\n", mode);
    break;
  }
}


x86 assembly (clang, -O0):
<GFX_SetMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1157 <GFX_SetMode+0x47>
jmp    1146 <GFX_SetMode+0x36>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     115c <GFX_SetMode+0x4c>
jmp    1161 <GFX_SetMode+0x51>
jmp    1179 <GFX_SetMode+0x69>
jmp    1179 <GFX_SetMode+0x69>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GFX_SetMode>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ec3(%rip),%r14
mov    (%r14),%edi
lea    0xed9(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
cmp    $0x2,%ebx
jae    113b <GFX_SetMode+0x2b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    (%r14),%edi
lea    0xecc(%rip),%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Setting mode %d\0A\00"
@.str.1 = [17 x i8] c"unknown mode %d\0A\00"
define void @GFX_SetMode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
switch i32 %6, label %9 [
i32 0, label %7
i32 1, label %8
]
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %8, %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Setting mode %d\0A\00"
@.str.1 = [17 x i8] c"unknown mode %d\0A\00"
define void @GFX_SetMode(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = icmp ult i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %1, %5
ret void
}
/* Variables and functions */
double gsw_rho(double, double, int);
double gsw_sigma4(double sa, double ct) {
  return (gsw_rho(sa, ct, 4000e0) - 1000e0);
}


x86 assembly (clang, -O0):
<gsw_sigma4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0xfa0,%edi
call   1030 <gsw_rho@plt>
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_sigma4>:
push   %rax
mov    $0xfa0,%edi
call   1030 <gsw_rho@plt>
addsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gsw_sigma4(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @gsw_rho(double %5, double %6, i32 4000)
%8 = fsub double %7, 1.000000e+03
ret double %8
}

LLVM IR (-O2):
define double @gsw_sigma4(double %0, double %1) {
%3 = tail call double @gsw_rho(double %0, double %1, i32 4000)
%4 = fadd double %3, -1.000000e+03
ret double %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool IsEven(uint32_t val) {
  if (val % 2)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<IsEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <IsEven+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <IsEven+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEven>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @IsEven(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
int ret_zero() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ret_zero() {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *umem_alloc(size_t size, int flags) {
  void *ptr = NULL;
  do {
    ptr = malloc(size);
  } while (ptr == NULL && (flags & 0x0100));
  return (ptr);
}


x86 assembly (clang, -O0):
<umem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jne    1155 <umem_alloc+0x45>
mov    -0xc(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1127 <umem_alloc+0x17>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umem_alloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <malloc@plt>
test   $0x100,%ebp
je     1135 <umem_alloc+0x25>
test   %rax,%rax
je     1120 <umem_alloc+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @umem_alloc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
store i64 %0, i64* %3
store i32 %1, i32* %4
store i8* null, i8** %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %3
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
br label %9
9: ; preds = %6
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %4
%14 = and i32 %13, 256
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @umem_alloc(i64 %0, i32 %1) {
%3 = and i32 %1, 256
%4 = icmp ne i32 %3, 0
br label %5
5: ; preds = %5, %2
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
%8 = and i1 %4, %7
br i1 %8, label %5, label %9
9: ; preds = %5
ret i8* %6
}
/* Type definitions */
struct Hero {
  int dummy;
};
struct Ability {
  int dummy;
};

/* Variables and functions */
float damage_RollAttack(struct Hero *);
float JiBenBianFa_damage(struct Ability *self, struct Hero *attacker,
                         struct Hero *target) {
  return (damage_RollAttack(attacker) + (float)102.0) * 1.74;
}


x86 assembly (clang, -O0):
<JiBenBianFa_damage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <damage_RollAttack@plt>
movss  0xed3(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebb(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JiBenBianFa_damage>:
push   %rax
mov    %rsi,%rdi
call   1030 <damage_RollAttack@plt>
addss  0xedf(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xedb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define float @JiBenBianFa_damage(%struct.Ability* %0, %struct.Hero* %1, %struct.Hero* %2) {
%4 = alloca %struct.Ability*
%5 = alloca %struct.Hero*
%6 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %4
store %struct.Hero* %1, %struct.Hero** %5
store %struct.Hero* %2, %struct.Hero** %6
%7 = load %struct.Hero*, %struct.Hero** %5
%8 = call float @damage_RollAttack(%struct.Hero* %7)
%9 = fadd float %8, 1.020000e+02
%10 = fpext float %9 to double
%11 = fmul double %10, 1.740000e+00
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define float @JiBenBianFa_damage(%struct.Ability* nocapture readnone %0, %struct.Hero* %1, %struct.Hero* nocapture readnone %2) {
%4 = tail call float @damage_RollAttack(%struct.Hero* %1)
%5 = fadd float %4, 1.020000e+02
%6 = fpext float %5 to double
%7 = fmul double %6, 1.740000e+00
%8 = fptrunc double %7 to float
ret float %8
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SysCtlDeepSleepPowerSet(uint32_t ui32Config) {
  (*((volatile unsigned long *)(0x400FE18C))) = ui32Config;
}


x86 assembly (clang, -O0):
<SysCtlDeepSleepPowerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe18c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlDeepSleepPowerSet>:
mov    %rdi,0x400fe18c
40
ret

LLVM IR (-O0):
define void @SysCtlDeepSleepPowerSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782604 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlDeepSleepPowerSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782604 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sysapi_sleep_in_msecs(int msecs) { usleep(msecs * 1000); }


x86 assembly (clang, -O0):
<sysapi_sleep_in_msecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysapi_sleep_in_msecs>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sysapi_sleep_in_msecs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @sysapi_sleep_in_msecs(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int null_get_buff_fill() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @null_get_buff_fill() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_3203X(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_3203X() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_port(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void io_set_interrupt_type(uint8_t port, uint8_t value) {
  set_port(port, value, 0x08, 0x09);
}


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

x86 assembly (clang, -O2):
<io_set_interrupt_type>:
mov    $0x8,%edx
mov    $0x9,%ecx
jmp    1030 <set_port@plt>

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

LLVM IR (-O2):
define void @io_set_interrupt_type(i32 %0, i32 %1) {
%3 = tail call i32 @set_port(i32 %0, i32 %1, i32 8, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int func(char *str) {
  char buffer[128];
  int *ret;
  ret = (int *)(buffer + 144);
  strcpy(buffer, str);
  (*ret) = (int)buffer;
  return 1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rax
add    $0x90,%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %eax,%ecx
mov    -0x98(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x88,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    $0x1,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @func(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca i32*
store i8* %0, i8** %2
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds i8, i8* %5, i64 144
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %4
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%12 = ptrtoint i8* %11 to i32
%13 = load i32*, i32** %4
store i32 %12, i32* %13
ret i32 1
}

LLVM IR (-O2):
define i32 @func(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret i32 1
}
int isupper(int a) { return (64 < a && a < 91) ? 1 : 0; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x40,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jge    1124 <isupper+0x24>
cmpl   $0x5b,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 64, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 91
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
char *strrchr(sp, c)
register char *sp, c;
{
  register char *r;
  r = 0;
  do {
    if (*sp == c)
      r = sp;
  } while (*sp++);
  return (r);
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <strrchr+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <strrchr+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1116 <strrchr+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
cmp    %sil,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ null, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = select i1 %7, i8* %4, i8* %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %8
}
int symlink(const char *oldpath, const char *newpath) {
  int result;
  asm("movl $83, %%eax;"
      "int $0x80;"
      : "=a"(result)
      : "b"(oldpath), "c"(newpath));
  return result;
}


x86 assembly (clang, -O0):
<symlink>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x18(%rbp),%rcx
mov    $0x53,%eax
int    $0x80
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlink>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x53,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 asm "movl $$83, %eax;int $$0x80;", "={ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @symlink(i8* readnone %0, i8* readnone %1) {
%3 = tail call i32 asm "movl $$83, %eax;int $$0x80;", "={ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void c_exit(int arg0) { exit(arg0); }


x86 assembly (clang, -O0):
<c_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<c_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @c_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
char *md5_file(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("md5 value : %s\n", md5_file("/home/hbr/box/cgi/md5-file/test"));
  return 1;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <md5_file@plt>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"md5 value : %s\0A\00"
@.str.1 = [32 x i8] c"/home/hbr/box/cgi/md5-file/test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* @md5_file(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"md5 value : %s\0A\00"
@.str.1 = [32 x i8] c"/home/hbr/box/cgi/md5-file/test\00"
define i32 @main() {
%1 = tail call i8* @md5_file(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ bedrock_exit();
int /*<<< orphan*/ bedrock_yield();
int /*<<< orphan*/ puts(char *);
__attribute__((noreturn)) void shouter_handler() {
  puts("Hello, world!");
  bedrock_yield();
  puts("Encore!");
  bedrock_yield();
  puts("YEAH!");
  bedrock_exit();
}


x86 assembly (clang, -O0):
<shouter_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1050 <bedrock_yield@plt>
lea    0xec0(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1050 <bedrock_yield@plt>
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1030 <bedrock_exit@plt>

x86 assembly (clang, -O2):
<shouter_handler>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <bedrock_yield@plt>
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <bedrock_yield@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <bedrock_exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [8 x i8] c"Encore!\00"
@.str.2 = [6 x i8] c"YEAH!\00"
define void @shouter_handler() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @bedrock_yield()
%3 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @bedrock_yield()
%5 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @bedrock_exit()
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [8 x i8] c"Encore!\00"
@.str.2 = [6 x i8] c"YEAH!\00"
define void @shouter_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @bedrock_yield()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @bedrock_yield()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @bedrock_exit()
unreachable
}
/* Variables and functions */
int attribute_open(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ rn_newString(char *);
int drv_attribute_open(int p, char *suri, char *sname) {
  return attribute_open(p, rn_newString(suri), rn_newString(sname));
}


x86 assembly (clang, -O0):
<drv_attribute_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rn_newString@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <rn_newString@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
call   1040 <attribute_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_attribute_open>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1030 <rn_newString@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <rn_newString@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <attribute_open@plt>

LLVM IR (-O0):
define i32 @drv_attribute_open(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i32 @rn_newString(i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @rn_newString(i8* %10)
%12 = call i32 @attribute_open(i32 %7, i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @drv_attribute_open(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @rn_newString(i8* %1)
%5 = tail call i32 @rn_newString(i8* %2)
%6 = tail call i32 @attribute_open(i32 %0, i32 %4, i32 %5)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwprintw(int /*<<< orphan*/ *, int, int, char const *, float);
int r_mvwprintw(WINDOW *win, int y, int x, const char *fmt, float r) {
  return (mvwprintw(win, y, x, fmt, r));
}


x86 assembly (clang, -O0):
<r_mvwprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
movss  -0x1c(%rbp),%xmm0
call   1030 <mvwprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_mvwprintw>:
jmp    1030 <mvwprintw@plt>

LLVM IR (-O0):
define i32 @r_mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3, float %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca float
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store float %4, float* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load float, float* %10
%16 = call i32 @mvwprintw(i32* %11, i32 %12, i32 %13, i8* %14, float %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @r_mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3, float %4) {
%6 = tail call i32 @mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3, float %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void could_not_open(const char *filename) {
  fprintf(stderr, "Could not open file: %s\n", filename);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Could not open file: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @could_not_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Could not open file: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @could_not_open(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned short height;
};
typedef TYPE_1__ XArc;

/* Variables and functions */
void set_XArc_height(void *_p, unsigned short _v) {
  ((XArc *)_p)->height = (unsigned short)_v;
}


x86 assembly (clang, -O0):
<set_XArc_height>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XArc_height>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XArc_height(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XArc_height(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
foo(void) {
  int i, x, y, z;
  x = 0;
  y = 1;
  i = 0;
  while (i < 2)
    i++;
  x = i;
  y = 2 * x;
  z = x + y;
  y = x + z;
  x = 9;
  y = 10;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <foo+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <foo+0x19>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x9,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
int /*<<< orphan*/ put_word(int, int);
int /*<<< orphan*/ write_ndless3x_loader(int /*<<< orphan*/, int);
__attribute__((always_)) void patch_NCAS_3_6_0_546_extra(void) {
  write_ndless3x_loader(0, 1);
  put_byte(0x1008E1FB, 0xEA);
  put_word(0x10135DF4, 0xE12FFF1E);
}


x86 assembly (clang, -O0):
<patch_NCAS_3_6_0_546_extra>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <write_ndless3x_loader@plt>
mov    $0x1008e1fb,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10135df4,%edi
mov    $0xe12fff1e,%esi
call   1050 <put_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_NCAS_3_6_0_546_extra>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <write_ndless3x_loader@plt>
mov    $0x1008e1fb,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10135df4,%edi
mov    $0xe12fff1e,%esi
pop    %rax
jmp    1050 <put_word@plt>

LLVM IR (-O0):
define void @patch_NCAS_3_6_0_546_extra() {
%1 = call i32 @write_ndless3x_loader(i32 0, i32 1)
%2 = call i32 @put_byte(i32 269017595, i32 234)
%3 = call i32 @put_word(i32 269704692, i32 -516948194)
ret void
}

LLVM IR (-O2):
define void @patch_NCAS_3_6_0_546_extra() {
%1 = tail call i32 @write_ndless3x_loader(i32 0, i32 1)
%2 = tail call i32 @put_byte(i32 269017595, i32 234)
%3 = tail call i32 @put_word(i32 269704692, i32 -516948194)
ret void
}
/* Variables and functions */
scalar_t__ isConsonant(char const *);
int doubleConsonant(const char *z) { return isConsonant(z) && z[0] == z[1]; }


x86 assembly (clang, -O0):
<doubleConsonant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <isConsonant@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114e <doubleConsonant+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleConsonant>:
push   %rbx
mov    %rdi,%rbx
call   1030 <isConsonant@plt>
test   %rax,%rax
je     112a <doubleConsonant+0x1a>
mov    (%rbx),%cl
xor    %eax,%eax
cmp    0x1(%rbx),%cl
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @doubleConsonant(i8* %0) {
%2 = tail call i64 @isConsonant(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %5, %7
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %11
}
void f2(int a) {
  if (a) {
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <f2+0x16>
jmp    1116 <f2+0x16>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VT_Transmit(char);
void VT_ColorSet(char fg_bg, char color) {
  VT_Transmit('\x1B');
  VT_Transmit('[');
  VT_Transmit(fg_bg);
  VT_Transmit(color);
  VT_Transmit('m');
}


x86 assembly (clang, -O0):
<VT_ColorSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x1b,%edi
call   1030 <VT_Transmit@plt>
mov    $0x5b,%edi
call   1030 <VT_Transmit@plt>
movsbl -0x1(%rbp),%edi
call   1030 <VT_Transmit@plt>
movsbl -0x2(%rbp),%edi
call   1030 <VT_Transmit@plt>
mov    $0x6d,%edi
call   1030 <VT_Transmit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VT_ColorSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1b,%edi
call   1030 <VT_Transmit@plt>
mov    $0x5b,%edi
call   1030 <VT_Transmit@plt>
mov    %ebp,%edi
call   1030 <VT_Transmit@plt>
mov    %ebx,%edi
call   1030 <VT_Transmit@plt>
mov    $0x6d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <VT_Transmit@plt>

LLVM IR (-O0):
define void @VT_ColorSet(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 @VT_Transmit(i8 signext 27)
%6 = call i32 @VT_Transmit(i8 signext 91)
%7 = load i8, i8* %3
%8 = call i32 @VT_Transmit(i8 signext %7)
%9 = load i8, i8* %4
%10 = call i32 @VT_Transmit(i8 signext %9)
%11 = call i32 @VT_Transmit(i8 signext 109)
ret void
}

LLVM IR (-O2):
define void @VT_ColorSet(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @VT_Transmit(i8 signext 27)
%4 = tail call i32 @VT_Transmit(i8 signext 91)
%5 = tail call i32 @VT_Transmit(i8 signext %0)
%6 = tail call i32 @VT_Transmit(i8 signext %1)
%7 = tail call i32 @VT_Transmit(i8 signext 109)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ times;
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct timespec *, int /*<<< orphan*/, int);
int utimensat(int /*<<< orphan*/, char *, struct timespec *,
              int /*<<< orphan*/);
int main(void) {
  int ret;
  struct timespec times[2];
  (void)memset(times, 0, sizeof(times));
  ret = utimensat(0, "/tmp", times, 0);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdx
xor    %ecx,%ecx
lea    0xeb4(%rip),%rsi
mov    %ecx,%edi
call   1030 <utimensat@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    0xec0(%rip),%rsi
xor    %edi,%edi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1030 <utimensat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [5 x i8] c"/tmp\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x %struct.timespec]
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x %struct.timespec], [2 x %struct.timespec]* %3, i64 0, i64 0
%5 = call i32 @memset(%struct.timespec* %4, i32 0, i32 8)
%6 = getelementptr inbounds [2 x %struct.timespec], [2 x %struct.timespec]* %3, i64 0, i64 0
%7 = call i32 @utimensat(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.timespec* %6, i32 0)
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@.str = [5 x i8] c"/tmp\00"
define i32 @main() {
%1 = alloca [2 x %struct.timespec]
%2 = bitcast [2 x %struct.timespec]* %1 to i8*
%3 = getelementptr inbounds [2 x %struct.timespec], [2 x %struct.timespec]* %1, i64 0, i64 0
%4 = call i32 @memset(%struct.timespec* %3, i32 0, i32 8)
%5 = call i32 @utimensat(i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %struct.timespec* %3, i32 0)
ret i32 %5
}
unsigned int leading_zero_num8(unsigned int x) {
  union {
    unsigned int as_int[2];
    double as_double;
  } y;
  unsigned int nr;
  nr = 0;
  y.as_double = (double)x + 0.5;
  nr = 1054 - (y.as_int[0] >> 20);
  return nr;
}


x86 assembly (clang, -O0):
<leading_zero_num8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
shr    $0x14,%ecx
mov    $0x41e,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leading_zero_num8>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
addsd  0xef1(%rip),%xmm0
movq   %xmm0,%rcx
shr    $0x14,%ecx
mov    $0x41e,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @leading_zero_num8(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = uitofp i32 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = bitcast %union.anon* %3 to double*
store double %7, double* %8
%9 = bitcast %union.anon* %3 to [2 x i32]*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%11 = load i32, i32* %10
%12 = lshr i32 %11, 20
%13 = sub i32 1054, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @leading_zero_num8(i32 %0) {
%2 = uitofp i32 %0 to double
%3 = fadd double %2, 5.000000e-01
%4 = bitcast double %3 to i64
%5 = trunc i64 %4 to i32
%6 = lshr i32 %5, 20
%7 = sub nsw i32 1054, %6
ret i32 %7
}
/* Variables and functions */
int strlcpy(char *, char const *, unsigned int);
int strncpy(char *dst, const char *src, unsigned int max_size) {
  return strlcpy(dst, src, max_size);
}


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

x86 assembly (clang, -O2):
<strncpy>:
jmp    1030 <strlcpy@plt>

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

LLVM IR (-O2):
define i32 @strncpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlcpy(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ astrcpy(char const *);
char *strxupper(int /*<<< orphan*/);
char *astrupper(const char *s) { return strxupper(astrcpy(s)); }


x86 assembly (clang, -O0):
<astrupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <astrcpy@plt>
mov    %eax,%edi
call   1030 <strxupper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<astrupper>:
push   %rax
call   1040 <astrcpy@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <strxupper@plt>

LLVM IR (-O0):
define i8* @astrupper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @astrcpy(i8* %3)
%5 = call i8* @strxupper(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @astrupper(i8* %0) {
%2 = tail call i32 @astrcpy(i8* %0)
%3 = tail call i8* @strxupper(i32 %2)
ret i8* %3
}