xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: prte [-w | -W] -- command [arg ..]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: prte [-w | -W] -- command [arg ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Usage: prte [-w | -W] -- command [arg ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned char);
void add_m32_imm8(void *_m32, unsigned char imm8) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x83);
  put8(0x05);
  put32((unsigned long)(m32));
  put8(imm8);
}


x86 assembly (clang, -O0):
<add_m32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x83,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_m32_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x83,%edi
call   1030 <put8@plt>
mov    $0x5,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
call   1040 <put32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @add_m32_imm8(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i8 zeroext -125)
%9 = call i32 @put8(i8 zeroext 5)
%10 = load i64*, i64** %5
%11 = ptrtoint i64* %10 to i64
%12 = call i32 @put32(i64 %11)
%13 = load i8, i8* %4
%14 = call i32 @put8(i8 zeroext %13)
ret void
}

LLVM IR (-O2):
define void @add_m32_imm8(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -125)
%4 = tail call i32 @put8(i8 zeroext 5)
%5 = ptrtoint i8* %0 to i64
%6 = tail call i32 @put32(i64 %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n == 2570)
    printf("A0A");
  else
    printf("22");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa0a,-0x8(%rbp)
jne    115d <main+0x3d>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa0a,0x4(%rsp)
lea    0xec2(%rip),%rax
lea    0xebf(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"A0A\00"
@.str.2 = [3 x i8] c"22\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 2570
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int a = 5;
  switch (a) {
  case 4:
    printf("%d\n", 4);
  case 5:
    printf("%d\n", 5);
  case 6:
    printf("%d\n", 6);
  default:
    printf("default");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4,%eax
je     115c <main+0x4c>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     116f <main+0x5f>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
je     1182 <main+0x72>
jmp    1195 <main+0x85>
lea    0xe9d(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe77(%rip),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [8 x i8] c"default\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void squashfs_finish_page(struct squashfs_page_actor *actor) {}


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

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

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

LLVM IR (-O2):
%struct.squashfs_page_actor = type opaque
define void @squashfs_finish_page(%struct.squashfs_page_actor* nocapture %0) {
ret void
}
int fun501() { return 501; }


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

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

LLVM IR (-O0):
define i32 @fun501() {
ret i32 501
}

LLVM IR (-O2):
define i32 @fun501() {
ret i32 501
}
double calculate_total(double purchases, double sales_tax) {
  double total = purchases + sales_tax;
  return total;
}


x86 assembly (clang, -O0):
<calculate_total>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_total>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_total(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @calculate_total(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
scalar_t__ SDL_sqrt(double);
float SDL_sqrtf(float x) { return (float)SDL_sqrt((double)x); }


x86 assembly (clang, -O0):
<SDL_sqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <SDL_sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_sqrtf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <SDL_sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @SDL_sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @SDL_sqrt(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @SDL_sqrtf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @SDL_sqrt(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
int main() {
  printf(&1 ["\021%six\012\0"], (1)["have"] + "fun" - 0x60);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsbl 0xee3(%rip),%eax
cltq
lea    0xede(%rip),%rsi
add    %rax,%rsi
add    $0xffffffffffffffa0,%rsi
lea    0xec3(%rip),%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"\11%six\0A\00\00"
@.str.1 = [5 x i8] c"have\00"
@.str.2 = [4 x i8] c"fun\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 1)
%3 = sext i8 %2 to i32
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -96
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 1), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\11%six\0A\00\00"
@.str.2 = [4 x i8] c"fun\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 1), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 1))
ret i32 0
}
/* Type definitions */
struct Cyc_AP_T {
  int dummy;
};

/* Variables and functions */
struct Cyc_AP_T *Cyc_mk(int);
struct Cyc_AP_T *Cyc_set(struct Cyc_AP_T *, long);
struct Cyc_AP_T *Cyc_AP_new(long n) {
  int _T0;
  struct Cyc_AP_T *_T1;
  long _T2;
  struct Cyc_AP_T *_T3;
  _T0 = (int)sizeof(long);
  _T1 = Cyc_mk(_T0);
  _T2 = n;
  _T3 = Cyc_set(_T1, _T2);
  return _T3;
}


x86 assembly (clang, -O0):
<Cyc_AP_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <Cyc_mk@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <Cyc_set@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_AP_new>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1040 <Cyc_mk@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <Cyc_set@plt>

LLVM IR (-O0):
%struct.Cyc_AP_T = type { i32 }
define %struct.Cyc_AP_T* @Cyc_AP_new(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca %struct.Cyc_AP_T*
%5 = alloca i64
%6 = alloca %struct.Cyc_AP_T*
store i64 %0, i64* %2
store i32 8, i32* %3
%7 = load i32, i32* %3
%8 = call %struct.Cyc_AP_T* @Cyc_mk(i32 %7)
store %struct.Cyc_AP_T* %8, %struct.Cyc_AP_T** %4
%9 = load i64, i64* %2
store i64 %9, i64* %5
%10 = load %struct.Cyc_AP_T*, %struct.Cyc_AP_T** %4
%11 = load i64, i64* %5
%12 = call %struct.Cyc_AP_T* @Cyc_set(%struct.Cyc_AP_T* %10, i64 %11)
store %struct.Cyc_AP_T* %12, %struct.Cyc_AP_T** %6
%13 = load %struct.Cyc_AP_T*, %struct.Cyc_AP_T** %6
ret %struct.Cyc_AP_T* %13
}

LLVM IR (-O2):
%struct.Cyc_AP_T = type { i32 }
define %struct.Cyc_AP_T* @Cyc_AP_new(i64 %0) {
%2 = tail call %struct.Cyc_AP_T* @Cyc_mk(i32 8)
%3 = tail call %struct.Cyc_AP_T* @Cyc_set(%struct.Cyc_AP_T* %2, i64 %0)
ret %struct.Cyc_AP_T* %3
}
/* Type definitions */
struct iovec {
  size_t iov_len;
  void *iov_base;
};

/* Variables and functions */
int sock_writev(int, struct iovec *, int);
int sock_write(int s, void *buf, size_t size) {
  struct iovec iov;
  int ret;
  iov.iov_base = buf;
  iov.iov_len = size;
  ret = sock_writev(s, &iov, 1);
  return (ret);
}


x86 assembly (clang, -O0):
<sock_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1030 <sock_writev@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_write>:
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %rdx,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <sock_writev@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.iovec = type { i64, i8* }
define i32 @sock_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.iovec
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %5
%10 = getelementptr inbounds %struct.iovec, %struct.iovec* %7, i32 0, i32 1
store i8* %9, i8** %10
%11 = load i64, i64* %6
%12 = getelementptr inbounds %struct.iovec, %struct.iovec* %7, i32 0, i32 0
store i64 %11, i64* %12
%13 = load i32, i32* %4
%14 = call i32 @sock_writev(i32 %13, %struct.iovec* %7, i32 1)
store i32 %14, i32* %8
%15 = load i32, i32* %8
ret i32 %15
}

LLVM IR (-O2):
%struct.iovec = type { i64, i8* }
define i32 @sock_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca %struct.iovec
%5 = bitcast %struct.iovec* %4 to i8*
%6 = getelementptr inbounds %struct.iovec, %struct.iovec* %4, i64 0, i32 1
store i8* %1, i8** %6
%7 = getelementptr inbounds %struct.iovec, %struct.iovec* %4, i64 0, i32 0
store i64 %2, i64* %7
%8 = call i32 @sock_writev(i32 %0, %struct.iovec* %4, i32 1)
ret i32 %8
}
/* Variables and functions */
char *preprocAutospace(char *);
char *preprocBackticks(char *);
char *preprocVars(char *);
char *preprocLine(char *line) {
  line = preprocVars(line);
  line = preprocBackticks(line);
  line = preprocAutospace(line);
  return line;
}


x86 assembly (clang, -O0):
<preprocLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <preprocVars@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <preprocBackticks@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <preprocAutospace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<preprocLine>:
push   %rax
call   1040 <preprocVars@plt>
mov    %rax,%rdi
call   1050 <preprocBackticks@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <preprocAutospace@plt>

LLVM IR (-O0):
define i8* @preprocLine(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @preprocVars(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @preprocBackticks(i8* %5)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @preprocAutospace(i8* %7)
store i8* %8, i8** %2
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @preprocLine(i8* %0) {
%2 = tail call i8* @preprocVars(i8* %0)
%3 = tail call i8* @preprocBackticks(i8* %2)
%4 = tail call i8* @preprocAutospace(i8* %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void set_to_int(sigset_t *set, int sig) {
  sigemptyset(set);
  sigaddset(set, sig);
}


x86 assembly (clang, -O0):
<set_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sigaddset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_to_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <sigemptyset@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sigaddset@plt>

LLVM IR (-O0):
define void @set_to_int(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 = call i32 @sigemptyset(i32* %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @sigaddset(i32* %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @set_to_int(i32* %0, i32 %1) {
%3 = tail call i32 @sigemptyset(i32* %0)
%4 = tail call i32 @sigaddset(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EA_A7_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_pi7(void) { m68ki_write_8(EA_A7_PI_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_pi7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_st_8_pi7>:
push   %rax
xor    %eax,%eax
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_st_8_pi7() {
%1 = call i32 (...) @EA_A7_PI_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_pi7() {
%1 = tail call i32 (...) @EA_A7_PI_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
void check_error(const char *txt, const char *file, int line) {
  fprintf(stderr, "CHECK(%s) FAILED at %s:%i\n", txt, file, line);
  abort();
}


x86 assembly (clang, -O0):
<check_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<check_error>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"CHECK(%s) FAILED at %s:%i\0A\00"
define void @check_error(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 i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"CHECK(%s) FAILED at %s:%i\0A\00"
define void @check_error(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void obj_B_euFunc(void) { printf("In the Obj B\nI can put a Thread here\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"In the Obj B\0AI can put a Thread here\0A\00"
define void @obj_B_euFunc() {
%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"In the Obj B\0AI can put a Thread here\00"
define void @obj_B_euFunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int go(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "usage: x86_amd64_features <feature>\n");
    exit(3);
  }
  return go(argv[1]);
}


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)
cmpl   $0x2,-0x8(%rbp)
je     116f <main+0x3f>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <go@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1140 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1030 <go@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: x86_amd64_features <feature>\0A\00"
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 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 3)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @go(i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: x86_amd64_features <feature>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 3)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @go(i8* %10)
ret i32 %11
}
/* Variables and functions */
int fttyslot(int);
int ttyslot() {
  int slot;
  slot = fttyslot(0);
  if (slot == 0)
    slot = fttyslot(1);
  if (slot == 0)
    slot = fttyslot(2);
  return slot;
}


x86 assembly (clang, -O0):
<ttyslot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <fttyslot@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1139 <ttyslot+0x29>
mov    $0x1,%edi
call   1030 <fttyslot@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1150 <ttyslot+0x40>
mov    $0x2,%edi
call   1030 <fttyslot@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyslot>:
push   %rax
xor    %edi,%edi
call   1030 <fttyslot@plt>
test   %eax,%eax
jne    112a <ttyslot+0x1a>
mov    $0x1,%edi
call   1030 <fttyslot@plt>
test   %eax,%eax
je     112c <ttyslot+0x1c>
pop    %rcx
ret
mov    $0x2,%edi
pop    %rax
jmp    1030 <fttyslot@plt>

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

LLVM IR (-O2):
define i32 @ttyslot() {
%1 = tail call i32 @fttyslot(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 @fttyslot(i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @fttyslot(i32 2)
br label %8
8: ; preds = %0, %6, %3
%9 = phi i32 [ %7, %6 ], [ %4, %3 ], [ %1, %0 ]
ret i32 %9
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void speckey_inverse(uint16_t *left, uint16_t *right) {
  *right ^= *left;
  *right = (((*right) >> (2)) | ((*right) << (16 - 2)));
  *left -= *right;
  *left = (((*left) << (7)) | ((*left) >> (16 - 7)));
}


x86 assembly (clang, -O0):
<speckey_inverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sar    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0xe,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x7,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x9,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<speckey_inverse>:
mov    (%rsi),%eax
xor    (%rdi),%eax
mov    %eax,%ecx
sar    $0x2,%ecx
shl    $0xe,%eax
or     %ecx,%eax
mov    %eax,(%rsi)
mov    (%rdi),%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shl    $0x7,%eax
sar    $0x9,%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @speckey_inverse(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %8, %6
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = ashr i32 %11, 2
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = shl i32 %14, 14
%16 = or i32 %12, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = load i32*, i32** %3
%21 = load i32, i32* %20
%22 = sub nsw i32 %21, %19
store i32 %22, i32* %20
%23 = load i32*, i32** %3
%24 = load i32, i32* %23
%25 = shl i32 %24, 7
%26 = load i32*, i32** %3
%27 = load i32, i32* %26
%28 = ashr i32 %27, 9
%29 = or i32 %25, %28
%30 = load i32*, i32** %3
store i32 %29, i32* %30
ret void
}

LLVM IR (-O2):
define void @speckey_inverse(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
%6 = ashr i32 %5, 2
%7 = shl i32 %5, 14
%8 = or i32 %6, %7
store i32 %8, i32* %1
%9 = load i32, i32* %0
%10 = sub nsw i32 %9, %8
%11 = shl i32 %10, 7
%12 = ashr i32 %10, 9
%13 = or i32 %11, %12
store i32 %13, i32* %0
ret void
}
/* Variables and functions */
bool isValid(int x, int y) {
  if (x < 0 || 4 <= x)
    return false;
  if (y < 0 || 4 <= y)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<isValid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1122 <isValid+0x22>
mov    $0x4,%eax
cmp    -0x8(%rbp),%eax
jg     112e <isValid+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1159 <isValid+0x59>
cmpl   $0x0,-0xc(%rbp)
jl     1146 <isValid+0x46>
mov    $0x4,%eax
cmp    -0xc(%rbp),%eax
jg     1152 <isValid+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1159 <isValid+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValid>:
or     %esi,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isValid(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 4
%5 = zext i1 %4 to i32
ret i32 %5
}
void mvnscher(double ub[], double lb[], double sig0[], double *eps0, int *n0,
              int inf0[], double *prob, double *bound, int *ifault) {
  double eps;
  int n;
  void mulnor(double[], double[], double[], double, int, int[], double *,
              double *, int *);
  eps = *eps0;
  n = *n0;
  mulnor(ub, lb, sig0, eps, n, inf0, prob, bound, ifault);
}


x86 assembly (clang, -O0):
<mvnscher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsd  -0x38(%rbp),%xmm0
mov    -0x3c(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <mulnor@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvnscher>:
sub    $0x18,%rsp
mov    %r9,%rax
mov    0x20(%rsp),%r9
movups 0x28(%rsp),%xmm1
movsd  (%rcx),%xmm0
mov    (%r8),%ecx
movups %xmm1,(%rsp)
mov    %rax,%r8
call   1030 <mulnor@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @mvnscher(double* %0, double* %1, double* %2, double* %3, i32* %4, i32* %5, double* %6, double* %7, i32* %8) {
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32*
%19 = alloca double
%20 = alloca i32
store double* %0, double** %10
store double* %1, double** %11
store double* %2, double** %12
store double* %3, double** %13
store i32* %4, i32** %14
store i32* %5, i32** %15
store double* %6, double** %16
store double* %7, double** %17
store i32* %8, i32** %18
%21 = load double*, double** %13
%22 = load double, double* %21
store double %22, double* %19
%23 = load i32*, i32** %14
%24 = load i32, i32* %23
store i32 %24, i32* %20
%25 = load double*, double** %10
%26 = load double*, double** %11
%27 = load double*, double** %12
%28 = load double, double* %19
%29 = load i32, i32* %20
%30 = load i32*, i32** %15
%31 = load double*, double** %16
%32 = load double*, double** %17
%33 = load i32*, i32** %18
ret void
}

LLVM IR (-O2):
define void @mvnscher(double* %0, double* %1, double* %2, double* nocapture %3, i32* nocapture %4, i32* %5, double* %6, double* %7, i32* %8) {
%10 = load double, double* %3
%11 = load i32, i32* %4
tail call void @mulnor(double* %0, double* %1, double* %2, double %10, i32 %11, i32* %5, double* %6, double* %7, i32* %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *filename) {
  FILE *file;
  file = fopen(filename, "r");
  if (file) {
    fclose(file);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <file_exists+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <file_exists+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int SIGFPE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
void trap_handler(int sig) {
  assert(sig == SIGFPE);
  _exit(0);
}


x86 assembly (clang, -O0):
<trap_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<trap_handler>:
push   %rax
mov    0x2ec0(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@SIGFPE = global i32 0
define void @trap_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGFPE
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGFPE = global i32 0
define void @trap_handler(i32 %0) {
%2 = load i32, i32* @SIGFPE
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @_exit(i32 0)
unreachable
}
double normalize_output(double x) {
  double raw_lbound = -1.0;
  double raw_ubound = 1.0;
  double norm_lbound = 0.0;
  double norm_ubound = 1.0;
  return (((x - raw_lbound) * (norm_ubound - norm_lbound)) /
          (raw_ubound - raw_lbound));
}


x86 assembly (clang, -O0):
<normalize_output>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_output>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @normalize_output(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %2
store double -1.000000e+00, double* %3
store double 1.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 1.000000e+00, double* %6
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = fmul double %9, %12
%14 = load double, double* %4
%15 = load double, double* %3
%16 = fsub double %14, %15
%17 = fdiv double %13, %16
ret double %17
}

LLVM IR (-O2):
define double @normalize_output(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fmul double %2, 5.000000e-01
ret double %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int class;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
void set_XVisualInfo_class(void *_p, int _v) {
  ((XVisualInfo *)_p)->class = (int)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XVisualInfo_class(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %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 i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XVisualInfo_class(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char const *);
int ft_strlen(char *);
char *ft_strcat(char *s1, const char *s2) {
  ft_strcpy(s1 + ft_strlen(s1), s2);
  return (s1);
}


x86 assembly (clang, -O0):
<ft_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ft_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @ft_strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @ft_strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ft_strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @ft_strcpy(i8* %5, i8* %1)
ret i8* %0
}
RX0AX1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[x0]) = (((short *)11111111)[x1]); }


x86 assembly (clang, -O0):
<RX0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,2),%dx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AX1>:
movslq %ecx,%rax
movzwl 0xa98ac7(%rax,%rax,1),%eax
movslq %edx,%rcx
mov    %ax,(%r8,%rcx,2)
ret

LLVM IR (-O0):
define i32 @RX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = load i16*, i16** %12
%21 = load i32, i32* %10
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i16, i16* %20, i64 %22
store i16 %19, i16* %23
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @RX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i16, i16* %4, i64 %10
store i16 %9, i16* %11
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigusr1_hdlr(int num, siginfo_t *info, void *unused) {
  printf("SIGUSR1 recived\n");
}


x86 assembly (clang, -O0):
<sigusr1_hdlr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"SIGUSR1 recived\0A\00"
define void @sigusr1_hdlr(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"SIGUSR1 recived\00"
define void @sigusr1_hdlr(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct hashtable *);
void hashtable_destroy(struct hashtable *h) { free(h); }


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

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

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

LLVM IR (-O2):
%struct.hashtable = type { i32 }
define void @hashtable_destroy(%struct.hashtable* nocapture %0) {
%2 = tail call i32 @free(%struct.hashtable* %0)
ret void
}
/* Variables and functions */
int strlen(char *);
int length(char *s) { return strlen(s); }


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

x86 assembly (clang, -O2):
<length>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @length(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void close_keyboard(struct termios *init_term) {
  tcsetattr(STDIN_FILENO, TCSANOW, init_term);
}


x86 assembly (clang, -O0):
<close_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1030 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_keyboard>:
mov    %rdi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcsetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
define void @close_keyboard(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @STDIN_FILENO
%4 = load i32, i32* @TCSANOW
%5 = load %struct.termios*, %struct.termios** %2
%6 = call i32 @tcsetattr(i32 %3, i32 %4, %struct.termios* %5)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
define void @close_keyboard(%struct.termios* %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @TCSANOW
%4 = tail call i32 @tcsetattr(i32 %2, i32 %3, %struct.termios* %0)
ret void
}