xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *mystrdup(char *str) {
  char *dest = malloc(strlen(str) + 1);
  if (dest)
    strcpy(dest, str);
  return dest;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <mystrdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <mystrdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
int leftmost_one(unsigned x) {
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return (x >> 1) + (x && 1);
}


x86 assembly (clang, -O0):
<leftmost_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1165 <leftmost_one+0x65>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1165 <leftmost_one+0x65>
mov    -0xc(%rbp),%eax
mov    -0x5(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftmost_one>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x10,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    %eax
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @leftmost_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = lshr i32 %23, 1
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %1
br label %28
28: ; preds = %27, %1
%29 = phi i1 [ false, %1 ], [ true, %27 ]
%30 = zext i1 %29 to i32
%31 = add i32 %24, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @leftmost_one(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 16
%11 = or i32 %10, %9
%12 = lshr i32 %11, 1
%13 = icmp ne i32 %11, 0
%14 = zext i1 %13 to i32
%15 = add nuw i32 %12, %14
ret i32 %15
}
int Sort_Double_Increase(const void *a, const void *b) {
  if ((*(double *)(a)) <= (*(double *)(b)))
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<Sort_Double_Increase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1132 <Sort_Double_Increase+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1139 <Sort_Double_Increase+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sort_Double_Increase>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setb   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @Sort_Double_Increase(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp ole double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @Sort_Double_Increase(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ugt double %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_default(int i) {
  switch (i) {
  default:
    printf("x %d\n", i);
  }
}


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

x86 assembly (clang, -O2):
<test_default>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"x %d\0A\00"
define void @test_default(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void CDAudio_Pause(void) {}


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

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

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

LLVM IR (-O2):
define void @CDAudio_Pause() {
ret void
}
/* Variables and functions */
char const *_xdg_mime_unalias_mime_type(char const *);
int /*<<< orphan*/ xdg_mime_init();
const char *xdg_mime_unalias_mime_type(const char *mime_type) {
  xdg_mime_init();
  return _xdg_mime_unalias_mime_type(mime_type);
}


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

x86 assembly (clang, -O2):
<xdg_mime_unalias_mime_type>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <xdg_mime_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <_xdg_mime_unalias_mime_type@plt>

LLVM IR (-O0):
define i8* @xdg_mime_unalias_mime_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @xdg_mime_init()
%4 = load i8*, i8** %2
%5 = call i8* @_xdg_mime_unalias_mime_type(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @xdg_mime_unalias_mime_type(i8* %0) {
%2 = tail call i32 (...) @xdg_mime_init()
%3 = tail call i8* @_xdg_mime_unalias_mime_type(i8* %0)
ret i8* %3
}
void ipu_pre_disable(int id) { return; }


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

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

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

LLVM IR (-O2):
define void @ipu_pre_disable(i32 %0) {
ret void
}
/* Variables and functions */
int atoi(char const *);
int /*<<< orphan*/ process_something(int);
int main(int argc, char const *argv[]) {
  process_something(2);
  process_something(atoi(argv[1]));
  return 0;
}


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    $0x2,%edi
call   1030 <process_something@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <process_something@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2,%edi
call   1030 <process_something@plt>
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <process_something@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @process_something(i32 2)
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
%11 = call i32 @process_something(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @process_something(i32 2)
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
%7 = tail call i32 @process_something(i32 %6)
ret i32 0
}
void inc_rt_prio_smp(struct rt_rq *rt_rq, int prio, int prev_prio) {}


x86 assembly (clang, -O0):
<inc_rt_prio_smp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rt_rq = type opaque
define void @inc_rt_prio_smp(%struct.rt_rq* %0, i32 %1, i32 %2) {
%4 = alloca %struct.rt_rq*
%5 = alloca i32
%6 = alloca i32
store %struct.rt_rq* %0, %struct.rt_rq** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.rt_rq = type opaque
define void @inc_rt_prio_smp(%struct.rt_rq* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int dobulk(int, void *, size_t, char *);
int send_bulk(int EndPt, void *pvBuf, size_t cbBuf) {
  return dobulk(EndPt, pvBuf, cbBuf, "send_bulk");
}


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

x86 assembly (clang, -O2):
<send_bulk>:
lea    0xee9(%rip),%rcx
jmp    1030 <dobulk@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"send_bulk\00"
define i32 @send_bulk(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @dobulk(i32 %0, i8* %1, i64 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x6f() {
  Assert_real((isgraph(111)),
              "/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_isgraph.c",
              560, ("isgraph should be 1 for o"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x6f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6f,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x230,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x6f>:
push   %rax
mov    $0x6f,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x230,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for o\00"
define void @t_isgraph_0x6f() {
%1 = call i32 @isgraph(i32 111)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 560, 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for o\00"
define void @t_isgraph_0x6f() {
%1 = tail call i32 @isgraph(i32 111)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RamRead32A(int, unsigned long *);
void MeasureWait(void) {
  unsigned long SlWaitTimerSt;
  SlWaitTimerSt = 1;
  while (SlWaitTimerSt) {
    RamRead32A(0x0004 + 0x0000 + 0x0478, &SlWaitTimerSt);
  }
}


x86 assembly (clang, -O0):
<MeasureWait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x1,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <MeasureWait+0x2e>
mov    $0x47c,%edi
lea    -0x8(%rbp),%rsi
call   1030 <RamRead32A@plt>
jmp    1120 <MeasureWait+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MeasureWait>:
push   %rbx
sub    $0x10,%rsp
movq   $0x1,0x8(%rsp)
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x47c,%edi
mov    %rbx,%rsi
call   1030 <RamRead32A@plt>
cmpq   $0x0,0x8(%rsp)
jne    1130 <MeasureWait+0x20>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @MeasureWait() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 1, i64* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @RamRead32A(i32 1148, i64* %1)
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dilate_1D(unsigned char *, int, int, unsigned int);
int /*<<< orphan*/ erode_1D(unsigned char *, int, int, unsigned int);
int closing_1D(unsigned char *image_data, int width, int height,
               unsigned int closing_by_k) {
  dilate_1D(image_data, width, height, closing_by_k);
  erode_1D(image_data, width, height, closing_by_k);
  return 1;
}


x86 assembly (clang, -O0):
<closing_1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <dilate_1D@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <erode_1D@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closing_1D>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
call   1030 <dilate_1D@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1040 <erode_1D@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @closing_1D(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @dilate_1D(i8* %9, i32 %10, i32 %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @erode_1D(i8* %14, i32 %15, i32 %16, i32 %17)
ret i32 1
}

LLVM IR (-O2):
define i32 @closing_1D(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @dilate_1D(i8* %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @erode_1D(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int _execve(char *name, char **argv, char **env) {
  (void)name;
  (void)argv;
  (void)env;
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_execve>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
double poly_ctypes(int, double *);
double identity_poly(int N, double args[N]) {
  return -args[N - 2] * (poly_ctypes(N - 2, &args[0]) + args[N - 1]);
}


x86 assembly (clang, -O0):
<identity_poly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%rsi
call   1030 <poly_ctypes@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identity_poly>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movslq %edi,%r14
add    $0xfffffffe,%edi
movsd  -0x10(%rsi,%r14,8),%xmm0
xorpd  0xed1(%rip),%xmm0
movapd %xmm0,(%rsp)
call   1030 <poly_ctypes@plt>
addsd  -0x8(%rbx,%r14,8),%xmm0
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @identity_poly(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = load double*, double** %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %7, i64 %10
%12 = load double, double* %11
%13 = fneg double %12
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 2
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = call double @poly_ctypes(i32 %15, double* %17)
%19 = load double*, double** %4
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %19, i64 %22
%24 = load double, double* %23
%25 = fadd double %18, %24
%26 = fmul double %13, %25
ret double %26
}

LLVM IR (-O2):
define double @identity_poly(i32 %0, double* %1) {
%3 = add nsw i32 %0, -2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds double, double* %1, i64 %4
%6 = load double, double* %5
%7 = fneg double %6
%8 = tail call double @poly_ctypes(i32 %3, double* %1)
%9 = add nsw i32 %0, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds double, double* %1, i64 %10
%12 = load double, double* %11
%13 = fadd double %8, %12
%14 = fmul double %13, %7
ret double %14
}
/* Variables and functions */
double pow(double, double);
double convert_it_4(double x) { return pow(x, 10.5); }


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

x86 assembly (clang, -O2):
<convert_it_4>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it_4(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 1.050000e+01)
ret double %4
}

LLVM IR (-O2):
define double @convert_it_4(double %0) {
%2 = tail call double @pow(double %0, double 1.050000e+01)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int _stub(int /*<<< orphan*/);
int __wrap_kill(int pid, int sig) { return _stub(EINVAL); }


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

x86 assembly (clang, -O2):
<__wrap_kill>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_stub@plt>

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @__wrap_kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = call i32 @_stub(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @__wrap_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = tail call i32 @_stub(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(void *, size_t, int, void *);
void default_write(void *stream, void *in, size_t count) {
  fwrite(in, count, 1, stream);
}


x86 assembly (clang, -O0):
<default_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_write>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define void @default_write(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i8* %0)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char *, int, int);
int /*<<< orphan*/ xerrf(char *, char *);
int wopen(char *ofile) {
  int ofd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
  if (ofd < 0)
    xerrf("Opening file '%s' for writing failed:", ofile);
  return ofd;
}


x86 assembly (clang, -O0):
<wopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
mov    0x2ea7(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1172 <wopen+0x52>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <xerrf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wopen>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   1040 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1160 <wopen+0x40>
lea    0xea8(%rip),%rdi
mov    %rbx,%rsi
call   1030 <xerrf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str = [38 x i8] c"Opening file '%s' for writing failed:\00"
define i32 @wopen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = load i32, i32* @O_CREAT
%7 = or i32 %5, %6
%8 = load i32, i32* @O_TRUNC
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %4, i32 %9, i32 420)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i32 @xerrf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@.str = [38 x i8] c"Opening file '%s' for writing failed:\00"
define i32 @wopen(i8* %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6, i32 420)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @xerrf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %11
11: ; preds = %9, %1
ret i32 %7
}
int misc_read(void) {
  { return (0); }
}


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

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

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

LLVM IR (-O2):
define i32 @misc_read() {
ret i32 0
}
int main() {
  switch (2) {
  case 0:
    return 1;
  case 1:
  default:
    return 4;
  }
  return 5;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
int allocateLoop(int a, int *p) {
  int n = 0;
  int *q;
  while (n != a) {
    q = (int *)malloc(2 * sizeof(int));
    *q = n;
    *(q + 1) = p;
    p = q;
    n = n + 1;
  }
  return p;
}


x86 assembly (clang, -O0):
<allocateLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     116c <allocateLoop+0x5c>
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <allocateLoop+0x16>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateLoop>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
je     113d <allocateLoop+0x2d>
mov    %edi,%r14d
xor    %ebp,%ebp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %ebp,(%rax)
mov    %ebx,0x4(%rax)
add    $0x1,%ebp
mov    %rax,%rbx
cmp    %ebp,%r14d
jne    1120 <allocateLoop+0x10>
mov    %rax,%rbx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @allocateLoop(i32 %0, i32* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i32* [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %12, %4 ], [ 0, %2 ]
%7 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = ptrtoint i32* %5 to i64
%10 = trunc i64 %9 to i32
%11 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %10, i32* %11
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = bitcast i8* %7 to i32*
br label %16
16: ; preds = %14, %2
%17 = phi i32* [ %1, %2 ], [ %15, %14 ]
%18 = ptrtoint i32* %17 to i64
%19 = trunc i64 %18 to i32
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x32() {
  Assert_real((isspace(50) == 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",
              255, ("isspace should be 0 for 2"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x32>:
push   %rax
mov    $0x32,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xff,%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 2\00"
define void @t_isspace_0x32() {
%1 = call i64 @isspace(i32 50)
%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 255, 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 2\00"
define void @t_isspace_0x32() {
%1 = tail call i64 @isspace(i32 50)
%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 255, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_usr1(int sig) { printf("USR1\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"USR1\0A\00"
define void @catch_usr1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"USR1\00"
define void @catch_usr1(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void closeFile(FILE *f) {
  if (f) {
    fflush(f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<closeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <closeFile+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFile>:
test   %rdi,%rdi
je     1137 <closeFile+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <fflush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @closeFile(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @fflush(i32* %0)
%5 = tail call i32 @fclose(i32* %0)
br label %6
6: ; preds = %3, %1
ret void
}
void *xmalloc(s)
unsigned long s;
{
  void *p = (void *)malloc(s);
  if (!p) {
    const char *meld = "out of memory in alloca\n";
    write(2, meld, strlen(meld));
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119d <xmalloc+0x5d>
lea    0xe95(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
mov    $0x2,%edi
mov    $0x0,%al
call   1030 <write@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rsi
mov    $0x18,%edx
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"out of memory in alloca\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i8*
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* %11)
%13 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* %10, i64 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"out of memory in alloca\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 24)
tail call void @exit(i32 1)
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printarray(double *array, int lenarray) {
  for (int i = 0; i < lenarray; i++) {
    printf("%1.2f\n", array[i]);
  }
}


x86 assembly (clang, -O0):
<printarray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printarray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printarray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <printarray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printarray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%1.2f\0A\00"
define void @printarray(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%1.2f\0A\00"
define void @printarray(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void init_fft4() {}


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

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

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

LLVM IR (-O2):
define void @init_fft4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yyerror(char *);
void unrecognized_char(char c) {
  char buf[32] = "Unrecognized character: ?";
  buf[24] = c;
  yyerror(buf);
}


x86 assembly (clang, -O0):
<unrecognized_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <yyerror@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unrecognized_char>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %dil,0x18(%rsp)
mov    %rsp,%rdi
call   1030 <yyerror@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.unrecognized_char.buf = [32 x i8] c"Unrecognized character: ?\00\00\00\00\00\00\00"
define void @unrecognized_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca [32 x i8]
store i8 %0, i8* %2
%4 = bitcast [32 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 24
store i8 %5, i8* %6
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = call i32 @yyerror(i8* %7)
ret void
}

LLVM IR (-O2):
@__const.unrecognized_char.buf = [32 x i8] c"Unrecognized character: ?\00\00\00\00\00\00\00"
define void @unrecognized_char(i8 signext %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 24
store i8 %0, i8* %4
%5 = call i32 @yyerror(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(void *, size_t);
void *malloc(int);
void *ft_memalloc(size_t size) {
  void *result;
  if (size == 0)
    return (NULL);
  result = malloc(sizeof(void *) * size);
  if (result == NULL)
    return (NULL);
  ft_bzero(result, size);
  return (result);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <ft_memalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1184 <ft_memalloc+0x64>
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <ft_memalloc+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1184 <ft_memalloc+0x64>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     114d <ft_memalloc+0x2d>
mov    %rdi,%r14
lea    0x0(,%rdi,8),%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     114d <ft_memalloc+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <ft_bzero@plt>
jmp    114f <ft_memalloc+0x2f>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = trunc i64 %0 to i32
%5 = shl i32 %4, 3
%6 = tail call i8* @malloc(i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @ft_bzero(i8* %6, i64 %0)
br label %10
10: ; preds = %3, %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ], [ null, %3 ]
ret i8* %11
}
int test_imm_56uint16_mem(unsigned short *val) {
  return ((*val) & (0x56 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_56uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 86
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void UI_method_get_closer(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_method_get_closer() {
ret void
}
void PI_toplevel(void) {}


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

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

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

LLVM IR (-O2):
define void @PI_toplevel() {
ret void
}
/* Variables and functions */
float __addsf3(float, int /*<<< orphan*/);
int /*<<< orphan*/ __negsf2(float);
float __subsf3(float a_fp, float b_fp) {
  return __addsf3(a_fp, __negsf2(b_fp));
}


x86 assembly (clang, -O0):
<__subsf3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <__negsf2@plt>
movss  -0xc(%rbp),%xmm0
mov    %eax,%edi
call   1040 <__addsf3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__subsf3>:
push   %rax
movss  %xmm0,0x4(%rsp)
movaps %xmm1,%xmm0
call   1030 <__negsf2@plt>
movss  0x4(%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <__addsf3@plt>

LLVM IR (-O0):
define float @__subsf3(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @__negsf2(float %6)
%8 = call float @__addsf3(float %5, i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @__subsf3(float %0, float %1) {
%3 = tail call i32 @__negsf2(float %1)
%4 = tail call float @__addsf3(float %0, i32 %3)
ret float %4
}