xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uart_put_onechar_boot_phase(int /*<<< orphan*/);
void uart_put_char_boot_phase(uint8_t *data, uint32_t size) {
  uint32_t index = 0;
  for (index = 0; index < size; index++)
    uart_put_onechar_boot_phase(*(data++));
}


x86 assembly (clang, -O0):
<uart_put_char_boot_phase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1165 <uart_put_char_boot_phase+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <uart_put_onechar_boot_phase@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <uart_put_char_boot_phase+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_put_char_boot_phase>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1142 <uart_put_char_boot_phase+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edi
call   1030 <uart_put_onechar_boot_phase@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <uart_put_char_boot_phase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @uart_put_char_boot_phase(i32* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %6
%9 = tail call i32 @uart_put_onechar_boot_phase(i32 %8)
%10 = add nuw nsw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll1(struct __test_metadata *);
void wrapper_epoll1(struct __test_metadata *_metadata,
                    struct __fixture_variant_metadata *variant) {
  epoll1(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll1>:
jmp    1030 <epoll1@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll1(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll1(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll1(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll1(%struct.__test_metadata* %0)
ret void
}
void ntkDNSResolution(char *domain) { return; }


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

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

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

LLVM IR (-O2):
define void @ntkDNSResolution(i8* nocapture %0) {
ret void
}
void fc24(int n) {
  {
    typedef int(*b)[n];
    goto a;
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc24(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
br label %12
5: ; No predecessors!
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %5, %1
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc24(i32 %0) {
ret void
}
void htexta_(ang) float *ang;
{ htextang(*ang); }


x86 assembly (clang, -O0):
<htexta_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <htextang@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htexta_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
jmp    1030 <htextang@plt>

LLVM IR (-O0):
define void @htexta_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = call i32 (double, ...) bitcast (i32 (...)* @htextang to i32 (double, ...)*)(double %5)
ret void
}

LLVM IR (-O2):
define void @htexta_(float* nocapture %0) {
%2 = load float, float* %0
%3 = fpext float %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @htextang to i32 (double, ...)*)(double %3)
ret void
}
void wratchet_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @wratchet_cleanup() {
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
char *strndup(char *, size_t);
char *piece_substr(char *s, size_t start, size_t length) {
  if (s == 0 || strlen(s) == 0)
    return 0;
  return strndup(s + start, length);
}


x86 assembly (clang, -O0):
<piece_substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1152 <piece_substr+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    115f <piece_substr+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    1174 <piece_substr+0x54>
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strndup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_substr>:
test   %rdi,%rdi
je     1125 <piece_substr+0x15>
cmpb   $0x0,(%rdi)
je     1125 <piece_substr+0x15>
add    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <strndup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @piece_substr(i8* %0, i64 %1, i64 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %0, i64 %1
%10 = tail call i8* @strndup(i8* %9, i64 %2)
br label %11
11: ; preds = %3, %5, %8
%12 = phi i8* [ %10, %8 ], [ null, %5 ], [ null, %3 ]
ret i8* %12
}
extern __attribute__((always_)) void bar() {}


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

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nl();
int /*<<< orphan*/ ot(char *);
void ol(char *ptr) {
  ot(ptr);
  nl();
}


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

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

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

LLVM IR (-O2):
define void @ol(i8* %0) {
%2 = tail call i32 @ot(i8* %0)
%3 = tail call i32 (...) @nl()
ret void
}
void gnttab_transfer_page_to_dom() {}


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

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

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

LLVM IR (-O2):
define void @gnttab_transfer_page_to_dom() {
ret void
}
void SobelRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @SobelRow_Any_SSE2() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl32(uint32_t a, uint8_t n) { return ((a << n) | (a >> (32 - n))); }


x86 assembly (clang, -O0):
<rotl32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl32>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl32(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 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl32(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int putchar(int character) {
  char c = (char)character;
  asm volatile("movb   %0, %%bl        \n"
               "movw   $1, %%ax        \n"
               "int    $0x80           \n"
               :
               : "q"(c)
               : "%bl");
  return character;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
mov    %al,%bl
mov    $0x1,%ax
int    $0x80
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%eax
mov    %al,%bl
mov    $0x1,%ax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
%2 = trunc i32 %0 to i8
tail call void asm sideeffect "movb $0, %bl \0Amovw $$1, %ax \0Aint $$0x80 \0A", "q,~{bl},~{dirflag},~{fpsr},~{flags}"(i8 %2)
ret i32 %0
}
/* Variables and functions */
int bar(int, int);
int foo(int a, int b) { return bar(a, b); }


x86 assembly (clang, -O0):
<foo>:
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 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(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 @bar(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @bar(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ TestThreadStackAllocation();
int main(int argc, char *argv[]) {
  TestThreadStackAllocation();
  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    $0x0,%al
call   1030 <TestThreadStackAllocation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TestThreadStackAllocation@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @TestThreadStackAllocation()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TestThreadStackAllocation()
ret i32 0
}
/* Type definitions */
struct headerd {
  int dummy;
};
struct header {
  int dummy;
};

/* Variables and functions */
int encontraMaiorValorLSE(struct header **);
int insereEsquerdaLDE(struct headerd **, int);
int insereInicioMaiorValorLDE(struct headerd **headerd,
                              struct header **header) {
  int psq = encontraMaiorValorLSE(header);
  return insereEsquerdaLDE(headerd, psq);
}


x86 assembly (clang, -O0):
<insereInicioMaiorValorLDE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <encontraMaiorValorLSE@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <insereEsquerdaLDE@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insereInicioMaiorValorLDE>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <encontraMaiorValorLSE@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <insereEsquerdaLDE@plt>

LLVM IR (-O0):
%struct.headerd = type { i32 }
%struct.header = type { i32 }
define i32 @insereInicioMaiorValorLDE(%struct.headerd** %0, %struct.header** %1) {
%3 = alloca %struct.headerd**
%4 = alloca %struct.header**
%5 = alloca i32
store %struct.headerd** %0, %struct.headerd*** %3
store %struct.header** %1, %struct.header*** %4
%6 = load %struct.header**, %struct.header*** %4
%7 = call i32 @encontraMaiorValorLSE(%struct.header** %6)
store i32 %7, i32* %5
%8 = load %struct.headerd**, %struct.headerd*** %3
%9 = load i32, i32* %5
%10 = call i32 @insereEsquerdaLDE(%struct.headerd** %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.headerd = type { i32 }
%struct.header = type { i32 }
define i32 @insereInicioMaiorValorLDE(%struct.headerd** %0, %struct.header** %1) {
%3 = tail call i32 @encontraMaiorValorLSE(%struct.header** %1)
%4 = tail call i32 @insereEsquerdaLDE(%struct.headerd** %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ umem_do_abort();
int /*<<< orphan*/ umem_panic(char *, char const *, char const *, int);
int __umem_assert_failed(const char *assertion, const char *file, int line) {
  umem_panic("Assertion failed: %s, file %s, line %d\n", assertion, file, line);
  umem_do_abort();
  return (0);
}


x86 assembly (clang, -O0):
<__umem_assert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1040 <umem_panic@plt>
mov    $0x0,%al
call   1030 <umem_do_abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__umem_assert_failed>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1040 <umem_panic@plt>
xor    %eax,%eax
call   1030 <umem_do_abort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Assertion failed: %s, file %s, line %d\0A\00"
define i32 @__umem_assert_failed(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @umem_panic(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = call i32 (...) @umem_do_abort()
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Assertion failed: %s, file %s, line %d\0A\00"
define i32 @__umem_assert_failed(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @umem_panic(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%5 = tail call i32 (...) @umem_do_abort()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, ("hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s "
                   "skip] [file ...]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [77 x i8] c"hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [77 x i8] c"hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *jsonZcb(char *, int);
char *jsonZcbChanRsp(int channel) { return (jsonZcb("chanrsp", channel)); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"chanrsp\00"
define i8* @jsonZcbChanRsp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @jsonZcb(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"chanrsp\00"
define i8* @jsonZcbChanRsp(i32 %0) {
%2 = tail call i8* @jsonZcb(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Init...\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Init...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Init...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo() {
  printf("%s %s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/geminy/aidear/refs/heads/master/snippets/"
         "makefile/gnumake/gcc/foo.c",
         __func__);
  bar();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xf6c(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <bar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xf6f(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/geminy/aidear/refs/heads/master/snippets/makefile/gnumake/gcc/foo.c\00"
@__func__.foo = [4 x i8] c"foo\00"
define void @foo() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.foo, i64 0, i64 0))
%2 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/geminy/aidear/refs/heads/master/snippets/makefile/gnumake/gcc/foo.c\00"
@__func__.foo = [4 x i8] c"foo\00"
define void @foo() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.foo, i64 0, i64 0))
%2 = tail call i32 (...) @bar()
ret void
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  int /*<<< orphan*/ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int semop(int, struct sembuf *, int);
int P(int semid, int sem_index) {
  struct sembuf buf;
  buf.sem_num = sem_index;
  buf.sem_op = -1;
  buf.sem_flg = SEM_UNDO;
  if (semop(semid, &buf, 1) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    115d <P+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <P+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define i32 @P(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sembuf
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 1
store i32 -1, i32* %9
%10 = load i32, i32* @SEM_UNDO
%11 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %6, i32 0, i32 2
store i32 %10, i32* %11
%12 = load i32, i32* %4
%13 = call i32 @semop(i32 %12, %struct.sembuf* %6, i32 1)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define i32 @P(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 -1, i32* %6
%7 = load i32, i32* @SEM_UNDO
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i32 %7, i32* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
%10 = icmp eq i32 %9, -1
%11 = sext i1 %10 to i32
ret i32 %11
}
int factorial(int n) {
  if (n <= 0) {
    return 1;
  }
  return factorial(n) * n;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <factorial+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1140 <factorial+0x30>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
test   %edi,%edi
jle    1112 <factorial+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <factorial+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @factorial(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %4, label %3
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 1
}
void gdk_drag_context_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_context_new() {
ret void
}
void initialize_count_array(int count_array[], int max_count) {
  for (int count = 0; count < max_count; ++count)
    count_array[count] = 0;
}


x86 assembly (clang, -O0):
<initialize_count_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <initialize_count_array+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initialize_count_array+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_count_array>:
test   %esi,%esi
jle    1126 <initialize_count_array+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @initialize_count_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @initialize_count_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
void io_pin_pulse(char *pin) {}


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

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

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

LLVM IR (-O2):
define void @io_pin_pulse(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int comparePropertyNamesAscending(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

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

LLVM IR (-O0):
define i32 @comparePropertyNamesAscending(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @comparePropertyNamesAscending(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
__attribute__((vector_size(16))) int fb(void) {
  return (__attribute__((vector_size(16))) int){1, 0, 1, 0};
}


x86 assembly (clang, -O0):
<fb>:
push   %rbp
mov    %rsp,%rbp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,-0x10(%rbp)
movdqa -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb>:
movaps 0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define <4 x i32> @fb() {
%1 = alloca <4 x i32>
store <4 x i32> <i32 1, i32 0, i32 1, i32 0>, <4 x i32>* %1
%2 = load <4 x i32>, <4 x i32>* %1
ret <4 x i32> %2
}

LLVM IR (-O2):
define <4 x i32> @fb() {
ret <4 x i32> <i32 1, i32 0, i32 1, i32 0>
}
double casimir_epsilon(double xi, double omegap, double gamma_) {
  return 1 + omegap * omegap / (xi * (xi + gamma_));
}


x86 assembly (clang, -O0):
<casimir_epsilon>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
addsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<casimir_epsilon>:
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
addsd  0xee8(%rip),%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @casimir_epsilon(double %0, double %1, double %2) {
%4 = fmul double %1, %1
%5 = fadd double %0, %2
%6 = fmul double %5, %0
%7 = fdiv double %4, %6
%8 = fadd double %7, 1.000000e+00
ret double %8
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int findHeight(struct node *);
int /*<<< orphan*/ printLevel(struct node *, int);
void printGivenLevel(struct node *root) {
  int h = findHeight(root);
  int i;
  for (i = 1; i <= h; i++)
    printLevel(root, i);
}


x86 assembly (clang, -O0):
<printGivenLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <findHeight@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1165 <printGivenLevel+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <printLevel@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <printGivenLevel+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printGivenLevel>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <findHeight@plt>
test   %eax,%eax
jle    115d <printGivenLevel+0x3d>
mov    %eax,%r15d
neg    %r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printLevel@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <printGivenLevel+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @printGivenLevel(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca i32
%4 = alloca i32
store %struct.node* %0, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call i32 @findHeight(%struct.node* %5)
store i32 %6, i32* %3
store i32 1, i32* %4
br label %7
7: ; preds = %15, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load %struct.node*, %struct.node** %2
%13 = load i32, i32* %4
%14 = call i32 @printLevel(%struct.node* %12, i32 %13)
br label %15
15: ; preds = %11
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @printGivenLevel(%struct.node* %0) {
%2 = tail call i32 @findHeight(%struct.node* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = tail call i32 @printLevel(%struct.node* %0, i32 %5)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %2
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
void _Jv_Free() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_Free() {
ret void
}
int main() {
  int x;
  int *p;
  x = 4;
  p = &x;
  *p = 0;
  return *p;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void c4(int i) { assert(i != 42); }


x86 assembly (clang, -O0):
<c4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c4>:
xor    %eax,%eax
cmp    $0x2a,%edi
setne  %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @c4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 42
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @c4(i32 %0) {
%2 = icmp ne i32 %0, 42
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
double power(double x, long n) {
  long i;
  double the_result;
  the_result = 1;
  for (i = 0; i < n; i++)
    the_result *= x;
  return the_result;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1150 <power+0x50>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1122 <power+0x22>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %rdi,%rdi
jle    111e <power+0x1e>
lea    -0x1(%rdi),%rcx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%rcx
jae    1127 <power+0x27>
movsd  0xee4(%rip),%xmm1
jmp    1166 <power+0x66>
movsd  0xeda(%rip),%xmm0
ret
and    $0xfffffffffffffff8,%rdi
movsd  0xecd(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffffffffffff8,%rdi
jne    1140 <power+0x40>
test   %rax,%rax
je     117a <power+0x7a>
nopl   0x0(%rax,%rax,1)
mulsd  %xmm0,%xmm1
add    $0xffffffffffffffff,%rax
jne    1170 <power+0x70>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @power(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
%5 = alloca i64
%6 = alloca double
store double %0, double* %3
store i64 %1, i64* %4
store double 1.000000e+00, double* %6
store i64 0, i64* %5
br label %7
7: ; preds = %15, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load double, double* %3
%13 = load double, double* %6
%14 = fmul double %13, %12
store double %14, double* %6
br label %15
15: ; preds = %11
%16 = load i64, i64* %5
%17 = add nsw i64 %16, 1
store i64 %17, i64* %5
br label %7
18: ; preds = %7
%19 = load double, double* %6
ret double %19
}

LLVM IR (-O2):
define double @power(double %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi double [ 1.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = fmul double %11, %0
%14 = fmul double %13, %0
%15 = fmul double %14, %0
%16 = fmul double %15, %0
%17 = fmul double %16, %0
%18 = fmul double %17, %0
%19 = fmul double %18, %0
%20 = fmul double %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi double [ undef, %4 ], [ %20, %10 ]
%25 = phi double [ 1.000000e+00, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi double [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = fmul double %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi double [ 1.000000e+00, %2 ], [ %24, %23 ], [ %30, %27 ]
ret double %34
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char str[16];
  alarm(10);
  write(1, "Pwn me if you can:\n", 19);
  read(0, str, 256);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <alarm@plt>
mov    $0x1,%edi
lea    0xeab(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1050 <read@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0xa,%edi
call   1040 <alarm@plt>
lea    0xebb(%rip),%rsi
mov    $0x1,%edi
mov    $0x13,%edx
call   1030 <write@plt>
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1050 <read@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Pwn me if you can:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = call i32 @alarm(i32 10)
%4 = call i32 @write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 19)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call i32 @read(i32 0, i8* %5, i32 256)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Pwn me if you can:\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @alarm(i32 10)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 19)
%5 = call i32 @read(i32 0, i8* %2, i32 256)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void CameraIntUnregister(unsigned long ulBase) {
  IntDisable(179);
  IntUnregister(179);
}


x86 assembly (clang, -O0):
<CameraIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xb3,%edi
call   1030 <IntDisable@plt>
mov    $0xb3,%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraIntUnregister>:
push   %rax
mov    $0xb3,%edi
call   1030 <IntDisable@plt>
mov    $0xb3,%edi
pop    %rax
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @CameraIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @IntDisable(i32 179)
%4 = call i32 @IntUnregister(i32 179)
ret void
}

LLVM IR (-O2):
define void @CameraIntUnregister(i64 %0) {
%2 = tail call i32 @IntDisable(i32 179)
%3 = tail call i32 @IntUnregister(i32 179)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xe5() {
  Assert_real((isxdigit(229) == 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_isxdigit.c",
              1150, ("isxdigit should be 0 for 0xe5"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xe5>:
push   %rax
mov    $0xe5,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x47e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe5\00"
define void @t_isxdigit_0xe5() {
%1 = call i64 @isxdigit(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe5\00"
define void @t_isxdigit_0xe5() {
%1 = tail call i64 @isxdigit(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void buf_free(void *buf) { free(buf); }


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

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

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

LLVM IR (-O2):
define void @buf_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *dm(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<dm>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @dm(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int CORE_SYS_PASS(int id) {
  if (id == 0) {
    printf("CORE: program gracefully exited");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<CORE_SYS_PASS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <CORE_SYS_PASS+0x28>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CORE_SYS_PASS>:
test   %edi,%edi
je     1125 <CORE_SYS_PASS+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"CORE: program gracefully exited\00"
define i32 @CORE_SYS_PASS(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [32 x i8] c"CORE: program gracefully exited\00"
define i32 @CORE_SYS_PASS(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret i32 undef
}
int f(int n) { return n > 10; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xb,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}