xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setsid(void) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setsid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setsid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setsid() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setsid() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ _check_for(int, int, int, int /*<<< orphan*/, char *);
char *offset();
int /*<<< orphan*/ printf(char *, char *, char *);
void test_syscalls_without_x32(int msb) {
  printf("%-*s"
         "Checking for absence of x32 system calls\n",
         offset(),
         "["
         "RUN"
         "]");
  _check_for(msb, 0 | 0x40000000, 999 | 0x40000000, -ENOSYS, "-ENOSYS");
}


x86 assembly (clang, -O0):
<test_syscalls_without_x32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <offset@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
lea    0xedb(%rip),%rdx
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
xor    %ecx,%ecx
mov    0x2e84(%rip),%rax
sub    (%rax),%ecx
mov    $0x40000000,%esi
mov    $0x400003e7,%edx
lea    0xebd(%rip),%r8
call   1040 <_check_for@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_syscalls_without_x32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <offset@plt>
lea    0xebb(%rip),%rdi
lea    0xee2(%rip),%rdx
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
sub    (%rax),%ebp
lea    0xed0(%rip),%r8
mov    %ebx,%edi
mov    $0x40000000,%esi
mov    $0x400003e7,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_check_for@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"%-*sChecking for absence of x32 system calls\0A\00"
@.str.1 = [6 x i8] c"[RUN]\00"
@ENOSYS = global i32 0
@.str.2 = [8 x i8] c"-ENOSYS\00"
define void @test_syscalls_without_x32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* (...) @offset()
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = load i32, i32* @ENOSYS
%7 = sub nsw i32 0, %6
%8 = call i32 @_check_for(i32 %5, i32 1073741824, i32 1073742823, i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"%-*sChecking for absence of x32 system calls\0A\00"
@.str.1 = [6 x i8] c"[RUN]\00"
@ENOSYS = global i32 0
@.str.2 = [8 x i8] c"-ENOSYS\00"
define void @test_syscalls_without_x32(i32 %0) {
%2 = tail call i8* (...) @offset()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @ENOSYS
%5 = sub nsw i32 0, %4
%6 = tail call i32 @_check_for(i32 %0, i32 1073741824, i32 1073742823, i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int isBigEndian(void) {
  short int word = 0x0100;
  char *byte = (char *)&word;
  return (byte[0]);
}


x86 assembly (clang, -O0):
<isBigEndian>:
push   %rbp
mov    %rsp,%rbp
movw   $0x100,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isBigEndian() {
%1 = alloca i16
%2 = alloca i8*
store i16 256, i16* %1
%3 = bitcast i16* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isBigEndian() {
ret i32 0
}
/* Variables and functions */
char *malloc_copy_string(char const *);
char *single_path_relocation(const char *from, const char *to) {
  return malloc_copy_string(to);
}


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

x86 assembly (clang, -O2):
<single_path_relocation>:
mov    %rsi,%rdi
jmp    1030 <malloc_copy_string@plt>

LLVM IR (-O0):
define i8* @single_path_relocation(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @malloc_copy_string(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @single_path_relocation(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i8* @malloc_copy_string(i8* %1)
ret i8* %3
}
void I2STxRxEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000810))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) |=
      0x00000001 | 0x00000002;
}


x86 assembly (clang, -O0):
<I2STxRxEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0x10(%rax)
mov    -0x8(%rbp),%rax
movq   $0x1,0x810(%rax)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
or     $0x3,%rcx
mov    %rcx,0xc00(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxRxEnable>:
movq   $0x1,0x10(%rdi)
movq   $0x1,0x810(%rdi)
orq    $0x3,0xc00(%rdi)
03
ret

LLVM IR (-O0):
define void @I2STxRxEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
%6 = load i64, i64* %2
%7 = add i64 %6, 2064
%8 = inttoptr i64 %7 to i64*
store volatile i64 1, i64* %8
%9 = load i64, i64* %2
%10 = add i64 %9, 3072
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, 3
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @I2STxRxEnable(i64 %0) {
%2 = add i64 %0, 16
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
%4 = add i64 %0, 2064
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
%6 = add i64 %0, 3072
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, 3
store volatile i64 %9, i64* %7
ret void
}
float Sleef_pownf_u10(float x, int y) {
  return (float)__builtin_pow((double)x, (double)y);
}


x86 assembly (clang, -O0):
<Sleef_pownf_u10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
call   1030 <pow@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_pownf_u10>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtsi2sd %edi,%xmm1
call   1030 <pow@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Sleef_pownf_u10(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = call double @pow(double %6, double %8)
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @Sleef_pownf_u10(float %0, i32 %1) {
%3 = fpext float %0 to double
%4 = sitofp i32 %1 to double
%5 = tail call double @pow(double %3, double %4)
%6 = fptrunc double %5 to float
ret float %6
}
void leave(int i) {
  exit("hullo");
  exit(i);
}


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %eax,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<leave>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hullo\00"
define void @leave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"hullo\00"
define void @leave(i32 %0) {
tail call void @exit(i32 ptrtoint ([6 x i8]* @.str to i32))
unreachable
}
int __mp_setmark(void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__mp_setmark(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsstr(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninitvar_wcsstr(void) {
  wchar_t *cs;
  wchar_t *ct;
  (void)wcsstr(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcsstr>:
jmp    1030 <wcsstr@plt>

LLVM IR (-O0):
define void @uninitvar_wcsstr() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcsstr(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcsstr() {
%1 = tail call i32 @wcsstr(i32* undef, i32* undef)
ret void
}
void xfs_forget_acl(struct inode *inode, const char *name) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @xfs_forget_acl(%struct.inode* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double input_1;
  scanf("%lf", &input_1);
  printf("%.12lf", input_1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xeb9(%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
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.12lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}
void foo_2_2_2_1_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_2_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void padding(char ch, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    putchar(ch);
  }
}


x86 assembly (clang, -O0):
<padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <padding+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <padding+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padding>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <padding+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <padding+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @padding(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @padding(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imTestRegression();
int /*<<< orphan*/ printf(char *);
int main() {
  printf(
      "Voilà maintenant on va executer un test pour tester tout les fonctions");
  imTestRegression();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [72 x i8] c"Voil\C3\A0 maintenant on va executer un test pour tester tout les fonctions\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @imTestRegression()
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"Voil\C3\A0 maintenant on va executer un test pour tester tout les fonctions\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @imTestRegression()
ret i32 0
}
int test_imm_66int64_lowword_reg(long long val) {
  return ((val) & (0x66 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_66int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 102
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ExitMessage(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned short, char const *);
void ExitMessageJob(const char *m, unsigned short id) {
  char tmp[101];
  snprintf(tmp, 101, "Job(%hu) -> %s", id, m);
  ExitMessage(tmp);
}


x86 assembly (clang, -O0):
<ExitMessageJob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x8(%rbp),%r8
mov    $0x65,%esi
lea    0xeb5(%rip),%rdx
movzwl %ax,%ecx
call   1030 <snprintf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <ExitMessage@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExitMessageJob>:
push   %rbx
sub    $0x70,%rsp
mov    %esi,%ecx
mov    %rdi,%r8
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x65,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ExitMessage@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Job(%hu) -> %s\00"
define void @ExitMessageJob(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca [101 x i8]
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%7 = load i16, i16* %4
%8 = load i8*, i8** %3
%9 = call i32 @snprintf(i8* %6, i32 101, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i16 zeroext %7, i8* %8)
%10 = getelementptr inbounds [101 x i8], [101 x i8]* %5, i64 0, i64 0
%11 = call i32 @ExitMessage(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Job(%hu) -> %s\00"
define void @ExitMessageJob(i8* %0, i16 zeroext %1) {
%3 = alloca [101 x i8]
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 101, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i16 zeroext %1, i8* %0)
%6 = call i32 @ExitMessage(i8* %4)
ret void
}
int test_imm_D7uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xD7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D7uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14090240
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int open(char const *, int, int);
int _dl_open(char const *path, int flags, int mode) {
  return open(path, flags, mode);
}


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

x86 assembly (clang, -O2):
<_dl_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @_dl_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void cons2prim_prep(double *cons, const double *x) {}


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

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

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

LLVM IR (-O2):
define void @cons2prim_prep(double* nocapture %0, double* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int /*<<< orphan*/);
int is_blank_string(const char *s) {
  char *ss = (char *)s;
  while (*ss != 0) {
    if (!isspace(*(ss++)))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_blank_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <is_blank_string+0x55>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1160 <is_blank_string+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116c <is_blank_string+0x5c>
jmp    1124 <is_blank_string+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank_string>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <is_blank_string+0x28>
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <is_blank_string+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_blank_string(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @isspace(i32 %7)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
extern int __attribute__((always_)) gui_ksys_wait_event(void) {
  int value;
  __asm__ __volatile__("int $0x40" : "=a"(value) : "a"(10));
  return (value);
}


x86 assembly (clang, -O0):
<gui_ksys_wait_event>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
int    $0x40
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_wait_event>:
mov    $0xa,%eax
int    $0x40
ret

LLVM IR (-O0):
define i32 @gui_ksys_wait_event() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 10)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gui_ksys_wait_event() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 10)
ret i32 %1
}
int q(int a, int b) { return b * a; }


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

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

LLVM IR (-O0):
define i32 @q(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @q(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
int gcd(int m, int n) {
  int r;
  do {
    r = m % n;
    m = n;
    n = r;
  } while (r != 0);
  return m;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ match(char);
int /*<<< orphan*/ popSub();
int /*<<< orphan*/ term();
void subtract() {
  match('-');
  term();
  popSub();
}


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1030 <term@plt>
mov    $0x0,%al
call   1050 <popSub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract>:
push   %rax
mov    $0x2d,%edi
call   1040 <match@plt>
xor    %eax,%eax
call   1030 <term@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <popSub@plt>

LLVM IR (-O0):
define void @subtract() {
%1 = call i32 @match(i8 signext 45)
%2 = call i32 (...) @term()
%3 = call i32 (...) @popSub()
ret void
}

LLVM IR (-O2):
define void @subtract() {
%1 = tail call i32 @match(i8 signext 45)
%2 = tail call i32 (...) @term()
%3 = tail call i32 (...) @popSub()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GyrosHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GyrosUpdated() { UAVObjUpdated(GyrosHandle()); }


x86 assembly (clang, -O0):
<GyrosUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GyrosHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyrosUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <GyrosHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @GyrosUpdated() {
%1 = call i32 (...) @GyrosHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GyrosUpdated() {
%1 = tail call i32 (...) @GyrosHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_dobldobl_drop_variable_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc(307, &k, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_dobldobl_drop_variable_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x133,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_dobldobl_drop_variable_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x133,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_dobldobl_drop_variable_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 307, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_dobldobl_drop_variable_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 307, i32* %2, i32* undef, double* undef)
ret i32 %3
}
int region_create(name)
char *name;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @region_create(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int tor_memcmp(char const *, char const *, int);
int _compare_digests(const void **_a, const void **_b) {
  return tor_memcmp((const char *)*_a, (const char *)*_b, 20);
}


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

x86 assembly (clang, -O2):
<_compare_digests>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    $0x14,%edx
jmp    1030 <tor_memcmp@plt>

LLVM IR (-O0):
define i32 @_compare_digests(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @tor_memcmp(i8* %6, i8* %8, i32 20)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_compare_digests(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @tor_memcmp(i8* %3, i8* %4, i32 20)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ system(char *);
double show_game_balance(double balance) {
  printf("Current Balance: %.2lf\n\n", balance);
  system("pause");
  system("cls");
}


x86 assembly (clang, -O0):
<show_game_balance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <system@plt>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_game_balance>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
lea    0xedf(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Current Balance: %.2lf\0A\0A\00"
@.str.1 = [6 x i8] c"pause\00"
@.str.2 = [4 x i8] c"cls\00"
define double @show_game_balance(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = load double, double* %2
ret double %8
}

LLVM IR (-O2):
@.str = [25 x i8] c"Current Balance: %.2lf\0A\0A\00"
@.str.1 = [6 x i8] c"pause\00"
@.str.2 = [4 x i8] c"cls\00"
define double @show_game_balance(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %0)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret double undef
}
void ADCSequenceDisable(unsigned long ulBase, unsigned long ulSequenceNum) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~(1 << ulSequenceNum);
}


x86 assembly (clang, -O0):
<ADCSequenceDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceDisable>:
mov    %rsi,%rcx
mov    $0xfffffffe,%eax
rol    %cl,%eax
cltq
and    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @ADCSequenceDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = sext i32 %8 to i64
%10 = load i64, i64* %3
%11 = add i64 %10, 0
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @ADCSequenceDisable(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %0 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %6
store volatile i64 %9, i64* %7
ret void
}
void SYSTEM_CALL(r, s) int *r;
char *s;
{ *r = ((system(s) == 0) != 0); }


x86 assembly (clang, -O0):
<SYSTEM_CALL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYSTEM_CALL>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <system@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @SYSTEM_CALL(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %5)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = load i32*, i32** %3
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @SYSTEM_CALL(i32* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
long long __normal___divdi3(long long, long long);
long long __attribute__((no_instrument_function))
__wrap___divdi3(long long a, long long b) {
  return __normal___divdi3(a, b);
}


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

x86 assembly (clang, -O2):
<__wrap___divdi3>:
jmp    1030 <__normal___divdi3@plt>

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

LLVM IR (-O2):
define i64 @__wrap___divdi3(i64 %0, i64 %1) {
%3 = tail call i64 @__normal___divdi3(i64 %0, i64 %1)
ret i64 %3
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_window_ask_refresh(int);
void config_change_buffers(void *data, struct t_config_option *option) {
  (void)data;
  (void)option;
  gui_window_ask_refresh(1);
}


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

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

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @config_change_buffers(i8* %0, %struct.t_config_option* %1) {
%3 = alloca i8*
%4 = alloca %struct.t_config_option*
store i8* %0, i8** %3
store %struct.t_config_option* %1, %struct.t_config_option** %4
%5 = load i8*, i8** %3
%6 = load %struct.t_config_option*, %struct.t_config_option** %4
%7 = call i32 @gui_window_ask_refresh(i32 1)
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_buffers(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 @gui_window_ask_refresh(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *my_malloc(int sz, const char *err_string) {
  void *p = malloc(sz);
  if (p == NULL) {
    fprintf(stderr, "-- malloc failure allocating %s\n", err_string);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1179 <my_malloc+0x49>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <my_malloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"-- malloc failure allocating %s\0A\00"
define noalias i8* @my_malloc(i32 %0, i8* %1) {
%3 = tail call i8* @malloc(i32 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Amstrad_PPI_Refresh();
int /*<<< orphan*/ ppi_write_port(int /*<<< orphan*/, int);
void PPI_WritePortA(int Data) {
  ppi_write_port(0, Data);
  Amstrad_PPI_Refresh();
}


x86 assembly (clang, -O0):
<PPI_WritePortA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <ppi_write_port@plt>
mov    $0x0,%al
call   1040 <Amstrad_PPI_Refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PPI_WritePortA>:
push   %rax
mov    %edi,%esi
xor    %edi,%edi
call   1030 <ppi_write_port@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Amstrad_PPI_Refresh@plt>

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

LLVM IR (-O2):
define void @PPI_WritePortA(i32 %0) {
%2 = tail call i32 @ppi_write_port(i32 0, i32 %0)
%3 = tail call i32 (...) @Amstrad_PPI_Refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
char *xalloc(size_t);
char *strdupn(char *s, size_t len) {
  char *ret;
  ret = xalloc(len + 1);
  memcpy(ret, s, len);
  ret[len] = '\0';
  return ret;
}


x86 assembly (clang, -O0):
<strdupn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <xalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupn>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <xalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdupn(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @xalloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdupn(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @xalloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}
long char_putpointp(px, py, level)
long level;
{
  long char_setcursor(), char_putpoint();
  if (char_setcursor(px, py) == 0)
    return (0);
  if (char_putpoint(level) == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<char_putpointp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1040 <char_setcursor@plt>
cmp    $0x0,%rax
jne    1156 <char_putpointp+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1180 <char_putpointp+0x60>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <char_putpoint@plt>
cmp    $0x0,%rax
jne    1178 <char_putpointp+0x58>
movq   $0x0,-0x8(%rbp)
jmp    1180 <char_putpointp+0x60>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_putpointp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <char_setcursor@plt>
test   %rax,%rax
je     1147 <char_putpointp+0x27>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <char_putpoint@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @char_putpointp(i32 %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 (i32, i32, ...) bitcast (i64 (...)* @char_setcursor to i64 (i32, i32, ...)*)(i32 %8, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i64 0, i64* %4
br label %19
13: ; preds = %3
%14 = load i64, i64* %7
%15 = call i64 (i64, ...) bitcast (i64 (...)* @char_putpoint to i64 (i64, ...)*)(i64 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i64 0, i64* %4
br label %19
18: ; preds = %13
store i64 1, i64* %4
br label %19
19: ; preds = %18, %17, %12
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
define i64 @char_putpointp(i32 %0, i32 %1, i64 %2) {
%4 = tail call i64 (i32, i32, ...) bitcast (i64 (...)* @char_setcursor to i64 (i32, i32, ...)*)(i32 %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 (i64, ...) bitcast (i64 (...)* @char_putpoint to i64 (i64, ...)*)(i64 %2)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
br label %10
10: ; preds = %6, %3
%11 = phi i64 [ 0, %3 ], [ %9, %6 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ fflush(void *);
void stdio_file_handler_flush(void *file) { fflush(file); }


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

x86 assembly (clang, -O2):
<stdio_file_handler_flush>:
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
define void @stdio_file_handler_flush(i8* nocapture %0) {
%2 = tail call i32 @fflush(i8* %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int exists(char *filename) {
  struct stat st;
  return stat(filename, &st) == 0;
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void invalid_parse() {}


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

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

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

LLVM IR (-O2):
define void @invalid_parse() {
ret void
}
/* Variables and functions */
float _acosf(float);
float acosf(float x) { return _acosf(x); }


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

x86 assembly (clang, -O2):
<acosf>:
jmp    1030 <_acosf@plt>

LLVM IR (-O0):
define float @acosf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @_acosf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @acosf(float %0) {
%2 = tail call float @_acosf(float %0)
ret float %2
}
int fun_2(int i, char *a) { return a[0] + a[100] + a[1]; }


x86 assembly (clang, -O0):
<fun_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x64(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_2>:
movsbl (%rsi),%eax
movsbl 0x64(%rsi),%ecx
add    %eax,%ecx
movsbl 0x1(%rsi),%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fun_2(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %1, i64 100
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, %4
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %8, %11
ret i32 %12
}