xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x7a() {
  Assert_real((isspace(122) == 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",
              615, ("isspace should be 0 for z"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x7a>:
push   %rax
mov    $0x7a,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x267,%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 = [26 x i8] c"isspace should be 0 for z\00"
define void @t_isspace_0x7a() {
%1 = call i64 @isspace(i32 122)
%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 615, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isspace should be 0 for z\00"
define void @t_isspace_0x7a() {
%1 = tail call i64 @isspace(i32 122)
%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 615, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int cp15_read_control();
unsigned int cp15_is_mmu_enabled(void) {
  unsigned int control;
  control = cp15_read_control();
  return ((control & (1 << 0)) != 0);
}


x86 assembly (clang, -O0):
<cp15_is_mmu_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <cp15_read_control@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp15_is_mmu_enabled>:
push   %rax
xor    %eax,%eax
call   1030 <cp15_read_control@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cp15_is_mmu_enabled() {
%1 = alloca i32
%2 = call i32 (...) @cp15_read_control()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cp15_is_mmu_enabled() {
%1 = tail call i32 (...) @cp15_read_control()
%2 = and i32 %1, 1
ret i32 %2
}
int opt_g(int n) { return n + 1; }


x86 assembly (clang, -O0):
<opt_g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_g>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @opt_g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @opt_g(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
double uint64_to_double(uint32_t lowv, uint32_t highv) {
  union {
    uint64_t val;
    double fv;
  } a;
  a.val = (uint64_t)highv << 32 | lowv;
  return a.fv;
}


x86 assembly (clang, -O0):
<uint64_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { double }
define double @uint64_to_double(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %union.anon
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = shl i32 %6, 32
%8 = load i32, i32* %3
%9 = or i32 %7, %8
%10 = bitcast %union.anon* %5 to i32*
store i32 %9, i32* %10
%11 = bitcast %union.anon* %5 to double*
%12 = load double, double* %11
ret double %12
}

LLVM IR (-O2):
define double @uint64_to_double(i32 %0, i32 %1) {
ret double poison
}
/* Variables and functions */
int /*<<< orphan*/ crypto_postfork();
void subsys_crypto_postfork(void) { crypto_postfork(); }


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

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

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

LLVM IR (-O2):
define void @subsys_crypto_postfork() {
%1 = tail call i32 (...) @crypto_postfork()
ret void
}
/* Type definitions */
struct window {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ io_repaint();
void _io_repaint_win(struct window *win) { io_repaint(); }


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

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

LLVM IR (-O0):
%struct.window = type { i32 }
define void @_io_repaint_win(%struct.window* %0) {
%2 = alloca %struct.window*
store %struct.window* %0, %struct.window** %2
%3 = call i32 (...) @io_repaint()
ret void
}

LLVM IR (-O2):
%struct.window = type { i32 }
define void @_io_repaint_win(%struct.window* nocapture readnone %0) {
%2 = tail call i32 (...) @io_repaint()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ deal_with_declarator(char *);
char *read_to_first_identifier(char *);
int main(int argc, char *argv[]) {
  assert(argc >= 2);
  char *input = argv[1];
  input = read_to_first_identifier(input);
  deal_with_declarator(input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <read_to_first_identifier@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <deal_with_declarator@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
setge  %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    0x8(%rbx),%rdi
call   1040 <read_to_first_identifier@plt>
mov    %rax,%rdi
call   1050 <deal_with_declarator@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = call i8* @read_to_first_identifier(i8* %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i32 @deal_with_declarator(i8* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i8* @read_to_first_identifier(i8* %7)
%9 = tail call i32 @deal_with_declarator(i8* %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int stub1(int, int);
void result(int x, int y, int (*p)(int, int)) {
  int result;
  result = (*p)(x, y);
  printf("%d\n", result);
}


x86 assembly (clang, -O0):
<result>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<result>:
push   %rax
call   *%rdx
lea    0xee6(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @result(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdefp(int v) { ngen("%s\t%d", ".quad", v); }


x86 assembly (clang, -O0):
<cgdefp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdefp>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [6 x i8] c".quad\00"
define void @cgdefp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [6 x i8] c".quad\00"
define void @cgdefp(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void foo() {
  register int zmm_var asm("zmm9");
  __asm__ __volatile__("vxorpd %%zmm0, %%zmm0, %%zmm7\n" : : : "zmm7");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
vxorpd %zmm0,%zmm0,%zmm7
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
vxorpd %zmm0,%zmm0,%zmm7
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo() {
tail call void asm sideeffect "vxorpd %zmm0, %zmm0, %zmm7\0A", "~{zmm7},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int XQLength() {}


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

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

LLVM IR (-O0):
define i32 @XQLength() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XQLength() {
ret i32 undef
}
unsigned xrop3_120_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_120_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_120_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_120_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_120_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
int hputdec(hstring, keyword, dec)
char *hstring;
char *keyword;
double dec;
{
  char value[30];
  dec2str(value, 30, dec, 2);
  return (hputs(hstring, keyword, value));
}


x86 assembly (clang, -O0):
<hputdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    $0x1e,%esi
mov    $0x2,%edx
mov    $0x1,%al
call   1040 <dec2str@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1030 <hputs@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputdec>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1e,%esi
mov    $0x2,%edx
mov    $0x1,%al
call   1040 <dec2str@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <hputs@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @hputdec(i8* %0, i8* %1, double %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca [30 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store double %2, double* %6
%8 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%9 = load double, double* %6
%10 = call i32 (i8*, i32, double, i32, ...) bitcast (i32 (...)* @dec2str to i32 (i8*, i32, double, i32, ...)*)(i8* %8, i32 30, double %9, i32 2)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%14 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputs to i32 (i8*, i8*, i8*, ...)*)(i8* %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @hputdec(i8* %0, i8* %1, double %2) {
%4 = alloca [30 x i8]
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i32, double, i32, ...) bitcast (i32 (...)* @dec2str to i32 (i8*, i32, double, i32, ...)*)(i8* %5, i32 30, double %2, i32 2)
%7 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputs to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %5)
ret i32 %7
}
unsigned int genRandom() { return 4; }


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

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

LLVM IR (-O0):
define i32 @genRandom() {
ret i32 4
}

LLVM IR (-O2):
define i32 @genRandom() {
ret i32 4
}
unsigned long flat_get_relocate_addr(unsigned long relval) {
  return relval & 0x0fffffff;
}


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

x86 assembly (clang, -O2):
<flat_get_relocate_addr>:
mov    %rdi,%rax
and    $0xfffffff,%eax
ret

LLVM IR (-O0):
define i64 @flat_get_relocate_addr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 268435455
ret i64 %4
}

LLVM IR (-O2):
define i64 @flat_get_relocate_addr(i64 %0) {
%2 = and i64 %0, 268435455
ret i64 %2
}
float *getMass(float *array, int *node, int *n) {
  return array + node[2] * n[0] * n[1] + node[1] * n[0] + node[0];
}


x86 assembly (clang, -O0):
<getMass>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
mov    -0x18(%rbp),%rdx
imul   0x4(%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x18(%rbp),%rdx
imul   (%rdx),%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMass>:
movslq 0x8(%rsi),%rax
movslq (%rdx),%rcx
imul   %rcx,%rax
movslq 0x4(%rdx),%rdx
imul   %rax,%rdx
lea    (%rdi,%rdx,4),%rax
movslq 0x4(%rsi),%rdx
imul   %rcx,%rdx
lea    (%rax,%rdx,4),%rax
movslq (%rsi),%rcx
lea    (%rax,%rcx,4),%rax
ret

LLVM IR (-O0):
define float* @getMass(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = mul nsw i32 %10, %13
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = mul nsw i32 %14, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %7, i64 %19
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = load i32*, i32** %6
%25 = getelementptr inbounds i32, i32* %24, i64 0
%26 = load i32, i32* %25
%27 = mul nsw i32 %23, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %20, i64 %28
%30 = load i32*, i32** %5
%31 = getelementptr inbounds i32, i32* %30, i64 0
%32 = load i32, i32* %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %29, i64 %33
ret float* %34
}

LLVM IR (-O2):
define float* @getMass(float* readnone %0, i32* nocapture %1, i32* nocapture %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = load i32, i32* %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, %5
%8 = getelementptr inbounds i32, i32* %2, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %0, i64 %11
%13 = getelementptr inbounds i32, i32* %1, i64 1
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds float, float* %12, i64 %16
%18 = load i32, i32* %1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds float, float* %17, i64 %19
ret float* %20
}
void handle_XCPU(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_XCPU(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ digitalWrite(int, int);
void digital_write(int pin_number, int digital_value) {
  digitalWrite(pin_number, digital_value);
}


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

x86 assembly (clang, -O2):
<digital_write>:
jmp    1030 <digitalWrite@plt>

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

LLVM IR (-O2):
define void @digital_write(i32 %0, i32 %1) {
%3 = tail call i32 @digitalWrite(i32 %0, i32 %1)
ret void
}
int foo6(double b, double c) { return b != c; }


x86 assembly (clang, -O0):
<foo6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo6>:
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @foo6(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 = fcmp une double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo6(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ OME_initialize(int, char const *const *);
int OME_thread_main();
int main(int argc, const char *const *argv) {
  OME_initialize(argc, argv);
  return OME_thread_main();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <OME_initialize@plt>
mov    $0x0,%al
call   1030 <OME_thread_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <OME_initialize@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <OME_thread_main@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @OME_initialize(i32 %6, i8** %7)
%9 = call i32 (...) @OME_thread_main()
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @OME_initialize(i32 %0, i8** %1)
%4 = tail call i32 (...) @OME_thread_main()
ret i32 %4
}
int test_imm_B2int32_reg(int val) { return ((val) & (0xB2 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_B2int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xb2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B2int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 178
%5 = icmp ne i32 %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_B2int32_reg(i32 %0) {
%2 = and i32 %0, 178
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double EvalAngCor_alpha0_5minus_0plus_15097_L5(double);
double funcAngCor_alpha0_5minus_0plus_15097_L5(double *x, double *par) {
  double result;
  result = par[0] * EvalAngCor_alpha0_5minus_0plus_15097_L5(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngCor_alpha0_5minus_0plus_15097_L5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngCor_alpha0_5minus_0plus_15097_L5@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngCor_alpha0_5minus_0plus_15097_L5>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngCor_alpha0_5minus_0plus_15097_L5@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngCor_alpha0_5minus_0plus_15097_L5(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngCor_alpha0_5minus_0plus_15097_L5(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngCor_alpha0_5minus_0plus_15097_L5(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngCor_alpha0_5minus_0plus_15097_L5(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x78() {
  Assert_real((iscntrl(120) == 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_iscntrl.c",
              605, ("iscntrl should be 0 for x"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x78>:
push   %rax
mov    $0x78,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x25d,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for x\00"
define void @t_iscntrl_0x78() {
%1 = call i64 @iscntrl(i32 120)
%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 605, i8* getelementptr inbounds ([26 x i8], [26 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for x\00"
define void @t_iscntrl_0x78() {
%1 = tail call i64 @iscntrl(i32 120)
%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 605, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int v[4] = {0x0A, 0xBB, 0x4B, 0x18};
  for (int i = 0; i < 4; i++)
    printf("%02X", v[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1168 <main+0x58>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.v = [4 x i32] [i32 10, i32 187, i32 75, i32 24]
@.str = [5 x i8] c"%02X\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 187)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 75)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 24)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int peek(FILE *in) {
  int c;
  c = getc(in);
  ungetc(c, in);
  return c;
}


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

x86 assembly (clang, -O2):
<peek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @peek(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @ungetc(i32 %2, i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int *);
int main(int argc, const char *argv[]) {
  int a = 10;
  int b = 5;
  swap(&a, &b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <swap@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x5,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <swap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 5, i32* %7
%8 = call i32 @swap(i32* %6, i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 5, i32* %4
%7 = call i32 @swap(i32* %3, i32* %4)
ret i32 0
}
extern void call_many_times_bv(void (*f)(char *s)) {
  char buf[8] = {1, 2, 3, 4, 0, 0, 0, 0};
  int x;
  for (x = 0; x < 1000000; x++) {
    buf[0] = (x & 63) + 1;
    f(buf);
  }
}


x86 assembly (clang, -O0):
<call_many_times_bv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xeed(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf4240,-0x14(%rbp)
jge    114f <call_many_times_bv+0x4f>
mov    -0x14(%rbp),%eax
and    $0x3f,%eax
add    $0x1,%eax
mov    %al,-0x10(%rbp)
mov    -0x8(%rbp),%rax
lea    -0x10(%rbp),%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <call_many_times_bv+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_many_times_bv>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x4030201,0x8(%rsp)
03 04
xor    %ebp,%ebp
lea    0x8(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
and    $0x3f,%al
add    $0x1,%al
mov    %al,0x8(%rsp)
mov    %r14,%rdi
call   *%rbx
add    $0x1,%ebp
cmp    $0xf4240,%ebp
jne    1120 <call_many_times_bv+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.call_many_times_bv.buf = [8 x i8] c"\01\02\03\04\00\00\00\00"
define void @call_many_times_bv(void (i8*)* %0) {
%2 = alloca void (i8*)*
%3 = alloca [8 x i8]
%4 = alloca i32
store void (i8*)* %0, void (i8*)** %2
%5 = bitcast [8 x i8]* %3 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1000000
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 63
%12 = add nsw i32 %11, 1
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
store i8 %13, i8* %14
%15 = load void (i8*)*, void (i8*)** %2
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
br label %17
17: ; preds = %9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @call_many_times_bv(void (i8*)* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 67305985, i64* %2
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 0, %1 ], [ %9, %4 ]
%6 = trunc i32 %5 to i8
%7 = and i8 %6, 63
%8 = add nuw nsw i8 %7, 1
store i8 %8, i8* %3
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, 1000000
br i1 %10, label %11, label %4
11: ; preds = %4
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void hack_puts(uint8_t *buf, uint16_t val) {
  buf[0] = (uint8_t)(((val) >> 8) & 0xff);
  buf[1] = (uint8_t)(val & 0xff);
}


x86 assembly (clang, -O0):
<hack_puts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hack_puts>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %rcx,(%rdi)
movzbl %al,%eax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @hack_puts(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %3
%15 = getelementptr inbounds i64, i64* %14, i64 1
store i64 %13, i64* %15
ret void
}

LLVM IR (-O2):
define void @hack_puts(i64* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = zext i32 %4 to i64
store i64 %5, i64* %0
%6 = and i32 %1, 255
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %7, i64* %8
ret void
}
void module_generate(int fd) { ; }


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

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

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

LLVM IR (-O2):
define void @module_generate(i32 %0) {
ret void
}
/* Variables and functions */
int GET32(int);
int /*<<< orphan*/ PUT32(int, unsigned int);
void uart_putc(unsigned int c) {
  while (1) {
    if (GET32(0x20215054) & 0x20) {
      break;
    }
  }
  PUT32(0x20215040, c);
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
and    $0x20,%eax
cmp    $0x0,%eax
je     1146 <uart_putc+0x26>
jmp    114b <uart_putc+0x2b>
jmp    112b <uart_putc+0xb>
mov    -0x4(%rbp),%esi
mov    $0x20215040,%edi
call   1030 <PUT32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
test   $0x20,%al
je     1130 <uart_putc+0x10>
mov    $0x20215040,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @uart_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %8
%4 = call i32 @GET32(i32 539054164)
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i32, i32* %2
%11 = call i32 @PUT32(i32 539054144, i32 %10)
ret void
}

LLVM IR (-O2):
define void @uart_putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @GET32(i32 539054164)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @PUT32(i32 539054144, i32 %0)
ret void
}
/* Type definitions */
typedef char u_int32_t;

/* Variables and functions */
int light_isdigit(int c) { return ((u_int32_t)c - '0' <= '9' - '0'); }


x86 assembly (clang, -O0):
<light_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
sub    $0x30,%eax
cmp    $0x9,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @light_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
%7 = icmp sle i32 %6, 9
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @light_isdigit(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = icmp slt i8 %2, 58
%4 = zext i1 %3 to i32
ret i32 %4
}
int of_finddevice(const char *dev) {
  struct {
    const char *name;
    int num_args;
    int num_returns;
    const char *device;
    int handle;
  } args;
  args.name = "finddevice";
  args.num_args = 1;
  args.num_returns = 1;
  args.device = dev;
  of(&args);
  return args.handle;
}


x86 assembly (clang, -O0):
<of_finddevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1030 <of@plt>
mov    -0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_finddevice>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rax
mov    %rax,0x8(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x10(%rsp)
mov    %rdi,0x18(%rsp)
lea    0x8(%rsp),%rdi
xor    %eax,%eax
call   1030 <of@plt>
mov    0x20(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32, i8*, i32 }
@.str = [11 x i8] c"finddevice\00"
define i32 @of_finddevice(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon
store i8* %0, i8** %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 1
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 2
store i32 1, i32* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 3
store i8* %7, i8** %8
%9 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %3)
%10 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 4
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i32, i8*, i32 }
@.str = [11 x i8] c"finddevice\00"
define i32 @of_finddevice(i8* %0) {
%2 = alloca %struct.anon
%3 = bitcast %struct.anon* %2 to i8*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 0
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 1
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 2
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 3
store i8* %0, i8** %7
%8 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @of to i32 (%struct.anon*, ...)*)(%struct.anon* %2)
%9 = getelementptr inbounds %struct.anon, %struct.anon* %2, i64 0, i32 4
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DEBUG;
int /*<<< orphan*/ LOG_MAKEPRI(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void exit_error(char *error_text) {
  fprintf(stderr, "failed - %s\n", error_text);
  (void)(LOG_MAKEPRI(LOG_USER, LOG_DEBUG), "failed - %s", error_text);
  _exit(1);
}


x86 assembly (clang, -O0):
<exit_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    0x2e6b(%rip),%rax
mov    (%rax),%esi
call   1050 <LOG_MAKEPRI@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1050 <LOG_MAKEPRI@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"failed - %s\0A\00"
@LOG_USER = global i32 0
@LOG_DEBUG = global i32 0
@.str.1 = [12 x i8] c"failed - %s\00"
define void @exit_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @LOG_USER
%7 = load i32, i32* @LOG_DEBUG
%8 = call i32 @LOG_MAKEPRI(i32 %6, i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"failed - %s\0A\00"
@LOG_USER = global i32 0
@LOG_DEBUG = global i32 0
define void @exit_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @LOG_USER
%5 = load i32, i32* @LOG_DEBUG
%6 = tail call i32 @LOG_MAKEPRI(i32 %4, i32 %5)
%7 = tail call i32 @_exit(i32 1)
unreachable
}
unsigned xrop3_58_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_58_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_58_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_58_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
int bit_is_on(const unsigned int mask, int index) {
  return (mask & (1 << index)) != 0;
}


x86 assembly (clang, -O0):
<bit_is_on>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_is_on>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bit_is_on(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @bit_is_on(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
int fff() {
  int iii;
  iii = 0;
  return iii;
}


x86 assembly (clang, -O0):
<fff>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fff() {
ret i32 0
}
double ls_costN_nm3_twice(double x) { return x + x; }


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

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

LLVM IR (-O0):
define double @ls_costN_nm3_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_costN_nm3_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}