xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xc8() {
  Assert_real((isspace(200) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1005, ("isspace should be 0 for 0xc8"));
}


x86 assembly (clang, -O0):
<t_isspace_0xc8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3ed,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xc8>:
push   %rax
mov    $0xc8,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ed,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc8\00"
define void @t_isspace_0xc8() {
%1 = call i64 @isspace(i32 200)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xc8\00"
define void @t_isspace_0xc8() {
%1 = tail call i64 @isspace(i32 200)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1005, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void *foo(void *data) {
  int *x = data;
  *x = 7;
  return x;
}


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

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
movl   $0x7,(%rdi)
ret

LLVM IR (-O0):
define i8* @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 7, i32* %6
%7 = load i32*, i32** %3
%8 = bitcast i32* %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @foo(i8* returned writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 7, i32* %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg2(void) { printf("Which nobody can deny!\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Which nobody can deny!\0A\00"
define void @msg2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Which nobody can deny!\00"
define void @msg2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int _modsuchar(signed char x, signed char y) {
  return ((int)((unsigned char)x) % (int)y);
}


x86 assembly (clang, -O0):
<_modsuchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_modsuchar>:
movzbl %dil,%eax
xor    %edx,%edx
idiv   %si
movzwl %dx,%eax
ret

LLVM IR (-O0):
define i32 @_modsuchar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = srem i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_modsuchar(i8 signext %0, i8 signext %1) {
%3 = zext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = srem i16 %3, %4
%6 = zext i16 %5 to i32
ret i32 %6
}
/* Variables and functions */
unsigned int __arch_hweight32(unsigned int);
__attribute__((always_)) unsigned int __arch_hweight8(unsigned int w) {
  return __arch_hweight32(w & 0xff);
}


x86 assembly (clang, -O0):
<__arch_hweight8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <__arch_hweight32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__arch_hweight8>:
movzbl %dil,%edi
jmp    1030 <__arch_hweight32@plt>

LLVM IR (-O0):
define i32 @__arch_hweight8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @__arch_hweight32(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @__arch_hweight8(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @__arch_hweight32(i32 %2)
ret i32 %3
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *qe_basename(const char *filename) {
  const char *p;
  p = strrchr(filename, '/');
  if (!p) {
    return filename;
  } else {
    p++;
    return p;
  }
}


x86 assembly (clang, -O0):
<qe_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <qe_basename+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <qe_basename+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qe_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @qe_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
char *strchr(char *, int);
char *xstrchr(char *s, int c) {
  if (c == 0)
    return NULL;
  return strchr(s, c);
}


x86 assembly (clang, -O0):
<xstrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <xstrchr+0x26>
movq   $0x0,-0x8(%rbp)
jmp    1146 <xstrchr+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrchr>:
test   %esi,%esi
je     1119 <xstrchr+0x9>
jmp    1030 <strchr@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @xstrchr(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %7
}
int test_imm_12int64_lowword_reg(long long val) {
  return ((val) & (0x12 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_12int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 18
%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_12int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 18
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double pow(double, double);
double ml_pow(double x, double y) { return pow(x, y); }


x86 assembly (clang, -O0):
<ml_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_pow>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @ml_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_u16(int /*<<< orphan*/);
int /*<<< orphan*/ plcvm_lpm_u16();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_u2_c16(void) { plcvm_push(plcvm_get_u16(plcvm_lpm_u16())); }


x86 assembly (clang, -O0):
<cb_ldm_u2_c16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <plcvm_lpm_u16@plt>
mov    %eax,%edi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_u2_c16>:
push   %rax
xor    %eax,%eax
call   1040 <plcvm_lpm_u16@plt>
mov    %eax,%edi
call   1030 <plcvm_get_u16@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_u2_c16() {
%1 = call i32 (...) @plcvm_lpm_u16()
%2 = call i32 @plcvm_get_u16(i32 %1)
%3 = call i32 @plcvm_push(i32 %2)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_u2_c16() {
%1 = tail call i32 (...) @plcvm_lpm_u16()
%2 = tail call i32 @plcvm_get_u16(i32 %1)
%3 = tail call i32 @plcvm_push(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_handler_exit(int signo) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @sig_handler_exit(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ COND_LS();
int /*<<< orphan*/ EA_AY_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sls_8_pd(void) {
  m68ki_write_8(EA_AY_PD_8(), COND_LS() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sls_8_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_LS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sls_8_pd>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_LS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sls_8_pd() {
%1 = call i32 (...) @EA_AY_PD_8()
%2 = call i64 (...) @COND_LS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sls_8_pd() {
%1 = tail call i32 (...) @EA_AY_PD_8()
%2 = tail call i64 (...) @COND_LS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int f238(int *);
int f239(int *p) { return f238(p); }


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

x86 assembly (clang, -O2):
<f239>:
jmp    1030 <f238@plt>

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

LLVM IR (-O2):
define i32 @f239(i32* %0) {
%2 = tail call i32 @f238(i32* %0)
ret i32 %2
}
/* Variables and functions */
int sprintf(char *, char *, int, int);
int ssds_field_name(int fd, int class_num, int field_num, char *sp) {
  int ret;
  ret = sprintf(sp, "FNAM%d.%d", class_num, field_num);
  return ret;
}


x86 assembly (clang, -O0):
<ssds_field_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_field_name>:
mov    %edx,%eax
mov    %esi,%edx
lea    0xee5(%rip),%rsi
mov    %rcx,%rdi
mov    %eax,%ecx
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"FNAM%d.%d\00"
define i32 @ssds_field_name(i32 %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
__attribute__((ms_abi)) int foo(int x, int y, int z) {
  printf("%d %d %d\n", x, y, z);
  return x + y + z;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %rsi
push   %rdi
sub    $0xb0,%rsp
movaps %xmm15,-0x20(%rbp)
movaps %xmm14,-0x30(%rbp)
movaps %xmm13,-0x40(%rbp)
movaps %xmm12,-0x50(%rbp)
movaps %xmm11,-0x60(%rbp)
movaps %xmm10,-0x70(%rbp)
movaps %xmm9,-0x80(%rbp)
movaps %xmm8,-0x90(%rbp)
ff
movaps %xmm7,-0xa0(%rbp)
movaps %xmm6,-0xb0(%rbp)
mov    %ecx,-0xb4(%rbp)
mov    %edx,-0xb8(%rbp)
mov    %r8d,-0xbc(%rbp)
mov    -0xb4(%rbp),%esi
mov    -0xb8(%rbp),%edx
mov    -0xbc(%rbp),%ecx
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xb4(%rbp),%eax
add    -0xb8(%rbp),%eax
add    -0xbc(%rbp),%eax
movaps -0xb0(%rbp),%xmm6
movaps -0xa0(%rbp),%xmm7
movaps -0x90(%rbp),%xmm8
ff
movaps -0x80(%rbp),%xmm9
movaps -0x70(%rbp),%xmm10
movaps -0x60(%rbp),%xmm11
movaps -0x50(%rbp),%xmm12
movaps -0x40(%rbp),%xmm13
movaps -0x30(%rbp),%xmm14
movaps -0x20(%rbp),%xmm15
add    $0xb0,%rsp
pop    %rdi
pop    %rsi
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rsi
push   %rdi
push   %rbp
push   %rbx
sub    $0xa0,%rsp
movaps %xmm15,0x90(%rsp)
movaps %xmm14,0x80(%rsp)
movaps %xmm13,0x70(%rsp)
movaps %xmm12,0x60(%rsp)
movaps %xmm11,0x50(%rsp)
movaps %xmm10,0x40(%rsp)
movaps %xmm9,0x30(%rsp)
movaps %xmm8,0x20(%rsp)
movaps %xmm7,0x10(%rsp)
movaps %xmm6,(%rsp)
mov    %r8d,%r14d
mov    %edx,%ebp
mov    %ecx,%ebx
lea    0xe96(%rip),%rdi
mov    %ecx,%esi
mov    %r8d,%ecx
call   1030 <printf@plt>
add    %ebx,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
movaps (%rsp),%xmm6
movaps 0x10(%rsp),%xmm7
movaps 0x20(%rsp),%xmm8
movaps 0x30(%rsp),%xmm9
movaps 0x40(%rsp),%xmm10
movaps 0x50(%rsp),%xmm11
movaps 0x60(%rsp),%xmm12
movaps 0x70(%rsp),%xmm13
movaps 0x80(%rsp),%xmm14
movaps 0x90(%rsp),%xmm15
add    $0xa0,%rsp
pop    %rbx
pop    %rbp
pop    %rdi
pop    %rsi
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define win64cc i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
const char *get_region_name_TL(int region_code) {
  switch (region_code) {
  case 6:
    return "Dili";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<get_region_name_TL>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
jne    1128 <get_region_name_TL+0x28>
jmp    1118 <get_region_name_TL+0x18>
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <get_region_name_TL+0x30>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_region_name_TL>:
xor    %eax,%eax
cmp    $0x6,%edi
lea    0xef4(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Dili\00"
define i8* @get_region_name_TL(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 6, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"Dili\00"
define i8* @get_region_name_TL(i32 %0) {
%2 = icmp eq i32 %0, 6
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void chain_generic_stats(FILE *f __attribute__((unused)),
                         void (*func)(FILE *, const char *, ...)
                             __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @chain_generic_stats(i32* nocapture %0, void (i32*, i8*, ...)* nocapture %1) {
ret void
}
int cairo_code_draw_lushSyncLabel_get_width() { return 43; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_lushSyncLabel_get_width() {
ret i32 43
}

LLVM IR (-O2):
define i32 @cairo_code_draw_lushSyncLabel_get_width() {
ret i32 43
}
int is_spc(char c) { return (((signed char)c) <= 32); }


x86 assembly (clang, -O0):
<is_spc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_spc>:
xor    %eax,%eax
cmp    $0x21,%dil
setl   %al
ret

LLVM IR (-O0):
define i32 @is_spc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_spc(i8 signext %0) {
%2 = icmp slt i8 %0, 33
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
void Default_FPU_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_FPU_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_FPU_IRQHandler+0x9>
jmp    1109 <Default_FPU_IRQHandler+0x9>

x86 assembly (clang, -O2):
<Default_FPU_IRQHandler>:
jmp    1100 <Default_FPU_IRQHandler>

LLVM IR (-O0):
define void @Default_FPU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_FPU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: ls [-al] [path]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: ls [-al] [path]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"Usage: ls [-al] [path]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_variadic(int *, int *);
void f_variadic_inp_unp(void) {
  int t = 5;
  int u;
  int *vp = &u;
  int *tp = &t;
  doStuff_variadic(tp, vp);
}


x86 assembly (clang, -O0):
<f_variadic_inp_unp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <doStuff_variadic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_variadic_inp_unp>:
push   %rax
movl   $0x5,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1030 <doStuff_variadic@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f_variadic_inp_unp() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 5, i32* %1
store i32* %2, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32*, i32** %3
%7 = call i32 @doStuff_variadic(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @f_variadic_inp_unp() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
%5 = call i32 @doStuff_variadic(i32* %1, i32* %2)
ret void
}
void RTStrIsValidEncoding(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrIsValidEncoding() {
ret void
}
int get_k(double p_min) {
  int k = 0;
  double tmp;
  do {
    k++;
    tmp = (k + 1) * 10.0 - 5.0;
    tmp -= (k * 5.0) / (k + 2);
  } while (tmp < p_min);
  return k - 1;
}


x86 assembly (clang, -O0):
<get_k>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm0
mulsd  %xmm0,%xmm1
mov    -0xc(%rbp),%eax
add    $0x2,%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     1110 <get_k+0x10>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_k>:
mov    $0xffffffff,%eax
movsd  0xef3(%rip),%xmm1
movsd  0xef3(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x2(%rax),%ecx
lea    0x3(%rax),%edx
xorps  %xmm3,%xmm3
cvtsi2sd %edx,%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
xorps  %xmm4,%xmm4
cvtsi2sd %ecx,%xmm4
mulsd  %xmm2,%xmm4
lea    0x4(%rax),%ecx
xorps  %xmm5,%xmm5
cvtsi2sd %ecx,%xmm5
divsd  %xmm5,%xmm4
addsd  %xmm3,%xmm4
add    $0x1,%eax
ucomisd %xmm4,%xmm0
ja     1120 <get_k+0x20>
ret

LLVM IR (-O0):
define i32 @get_k(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store double %0, double* %2
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e+01, double -5.000000e+00)
store double %11, double* %4
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 5.000000e+00
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 2
%17 = sitofp i32 %16 to double
%18 = fdiv double %14, %17
%19 = load double, double* %4
%20 = fsub double %19, %18
store double %20, double* %4
br label %21
21: ; preds = %5
%22 = load double, double* %4
%23 = load double, double* %2
%24 = fcmp olt double %22, %23
br i1 %24, label %5, label %25
25: ; preds = %21
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
ret i32 %27
}

LLVM IR (-O2):
define i32 @get_k(double %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %4, %2 ]
%4 = add nuw nsw i32 %3, 1
%5 = add nuw nsw i32 %3, 2
%6 = sitofp i32 %5 to double
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.000000e+01, double -5.000000e+00)
%8 = sitofp i32 %4 to double
%9 = fmul double %8, 5.000000e+00
%10 = add nuw nsw i32 %3, 3
%11 = sitofp i32 %10 to double
%12 = fdiv double %9, %11
%13 = fsub double %7, %12
%14 = fcmp olt double %13, %0
br i1 %14, label %2, label %15
15: ; preds = %2
ret i32 %3
}
int test_imm_84uint32_mem(unsigned int *val) {
  return ((*val) & (0x84 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_84uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 132
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int Min(int i, int j) {
  if (i < j) {
    return i;
  } else {
    return j;
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<Min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <Min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int from_configure;
};
struct TYPE_4__ {
  TYPE_1__ xunmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xunmap_from_configure(void *_p, int _v) {
  ((XEvent *)_p)->xunmap.from_configure = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xunmap_from_configure>:
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_XEvent_xunmap_from_configure>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xunmap_from_configure(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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xunmap_from_configure(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Section4First(int number) { printf("\n4.- | %d |", number / 1000); }


x86 assembly (clang, -O0):
<Section4First>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section4First>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x26,%rsi
add    %eax,%esi
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\0A4.- | %d |\00"
define void @Section4First(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0A4.- | %d |\00"
define void @Section4First(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *getfile(int);
int /*<<< orphan*/ luaL_argerror(int, char *);
FILE *getnonullfile(int arg) {
  FILE *f = getfile(arg);
  if (!(f))
    luaL_argerror(arg, "invalid file handle");
  return f;
}


x86 assembly (clang, -O0):
<getnonullfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getfile@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <getnonullfile+0x31>
mov    -0x4(%rbp),%edi
lea    0xeb4(%rip),%rsi
call   1030 <luaL_argerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnonullfile>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <getfile@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <getnonullfile+0x20>
lea    0xec7(%rip),%rsi
mov    %ebp,%edi
call   1030 <luaL_argerror@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"invalid file handle\00"
define i32* @getnonullfile(i32 %0) {
%2 = tail call i32* @getfile(i32 %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @luaL_argerror(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
unsigned int syscall_zero_dispatch(void *data) {
  puts("This is not a real syscall!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"This is not a real syscall!\0A\00"
define i32 @syscall_zero_dispatch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"This is not a real syscall!\0A\00"
define i32 @syscall_zero_dispatch(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int condition_alphabetSmall(char c) { return (c >= 'a') && (c <= 'z'); }


x86 assembly (clang, -O0):
<condition_alphabetSmall>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <condition_alphabetSmall+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_alphabetSmall>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @condition_alphabetSmall(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @condition_alphabetSmall(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct diGraph {
  int dummy;
};
struct dgNode {
  int dummy;
};

/* Variables and functions */
struct dgNode *dgFindNode(struct diGraph *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
struct dgNode *dgFindNumberedNode(struct diGraph *dg, int id) {
  char buf[16];
  sprintf(buf, "%d", id);
  return dgFindNode(dg, buf);
}


x86 assembly (clang, -O0):
<dgFindNumberedNode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <dgFindNode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgFindNumberedNode>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <dgFindNode@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dgNode = type { i32 }
%struct.diGraph = type { i32 }
@.str = [3 x i8] c"%d\00"
define %struct.dgNode* @dgFindNumberedNode(%struct.diGraph* %0, i32 %1) {
%3 = alloca %struct.diGraph*
%4 = alloca i32
%5 = alloca [16 x i8]
store %struct.diGraph* %0, %struct.diGraph** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.diGraph*, %struct.diGraph** %3
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%11 = call %struct.dgNode* @dgFindNode(%struct.diGraph* %9, i8* %10)
ret %struct.dgNode* %11
}

LLVM IR (-O2):
%struct.dgNode = type { i32 }
%struct.diGraph = type { i32 }
@.str = [3 x i8] c"%d\00"
define %struct.dgNode* @dgFindNumberedNode(%struct.diGraph* %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call %struct.dgNode* @dgFindNode(%struct.diGraph* %0, i8* %4)
ret %struct.dgNode* %6
}
void actualiser() {}


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

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

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

LLVM IR (-O2):
define void @actualiser() {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
double fpu_frndint(double a) {
  int64_t b;
  double c;
  b = (int64_t)a;
  c = (double)b;
  return c;
}


x86 assembly (clang, -O0):
<fpu_frndint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpu_frndint>:
cvttsd2si %xmm0,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

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

LLVM IR (-O2):
define double @fpu_frndint(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
ret double %3
}
/* Variables and functions */
scalar_t__ get_ptr();
int /*<<< orphan*/ printf(char *, scalar_t__, int);
void print_ptr() { printf("%p, %d\n", get_ptr(), (int)get_ptr()); }


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

x86 assembly (clang, -O2):
<print_ptr>:
push   %rbx
xor    %eax,%eax
call   1040 <get_ptr@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <get_ptr@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%p, %d\0A\00"
define void @print_ptr() {
%1 = call i64 (...) @get_ptr()
%2 = call i64 (...) @get_ptr()
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %1, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%p, %d\0A\00"
define void @print_ptr() {
%1 = tail call i64 (...) @get_ptr()
%2 = tail call i64 (...) @get_ptr()
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %1, i32 %3)
ret void
}
void BT_SetThreadTag(void *tag) { return; }


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

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

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

LLVM IR (-O2):
define void @BT_SetThreadTag(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int _sys_write(int, char const *, int, int *);
int errno;
int write(int fd, const char *buf, int sz) {
  int nwritten;
  int r = _sys_write(fd, buf, sz, &nwritten);
  if (r != 0) {
    errno = r;
    return -1;
  }
  return nwritten;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x18(%rbp),%rcx
call   1030 <_sys_write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     115a <write+0x4a>
mov    -0x1c(%rbp),%ecx
mov    0x2e94(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <write+0x50>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rax
lea    0x4(%rsp),%rcx
call   1030 <_sys_write@plt>
test   %eax,%eax
je     112f <write+0x1f>
mov    0x2eba(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @_sys_write(i32 %0, i8* %1, i32 %2, i32* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %3
store i32 %6, i32* @errno
br label %11
9: ; preds = %3
%10 = load i32, i32* %4
br label %11
11: ; preds = %9, %8
%12 = phi i32 [ -1, %8 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ SerialDataEnd();
int /*<<< orphan*/ SerialWriteChar(int);
void SerialPingIn() {
  SerialWriteChar((0XCC));
  SerialDataEnd();
}


x86 assembly (clang, -O0):
<SerialPingIn>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcc,%edi
call   1040 <SerialWriteChar@plt>
mov    $0x0,%al
call   1030 <SerialDataEnd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialPingIn>:
push   %rax
mov    $0xcc,%edi
call   1040 <SerialWriteChar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SerialDataEnd@plt>

LLVM IR (-O0):
define void @SerialPingIn() {
%1 = call i32 @SerialWriteChar(i32 204)
%2 = call i32 (...) @SerialDataEnd()
ret void
}

LLVM IR (-O2):
define void @SerialPingIn() {
%1 = tail call i32 @SerialWriteChar(i32 204)
%2 = tail call i32 (...) @SerialDataEnd()
ret void
}
void drawline(int n, int m, char *s) {
  (void)n;
  (void)m;
  (void)s;
}


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

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

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

LLVM IR (-O2):
define void @drawline(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
int IsCharacterNumber(char character) {
  return character >= '0' && character <= '9';
}


x86 assembly (clang, -O0):
<IsCharacterNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <IsCharacterNumber+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsCharacterNumber>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsCharacterNumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsCharacterNumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void forever_hlt(void) {
  for (;;) {
    __asm__ __volatile__("hlt");
  }
}


x86 assembly (clang, -O0):
<forever_hlt>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <forever_hlt+0x9>
hlt
jmp    1109 <forever_hlt+0x9>

x86 assembly (clang, -O2):
<forever_hlt>:
hlt
jmp    1100 <forever_hlt>

LLVM IR (-O0):
define void @forever_hlt() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @forever_hlt() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}