xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void resetear_pic() {
  outb(0x20 + 0, 0x11);
  outb(0x20 + 1, 0x20);
  outb(0x20 + 1, 0x04);
  outb(0x20 + 1, 0x01);
  outb(0x20 + 1, 0xFF);
  outb(0xA0 + 0, 0x11);
  outb(0xA0 + 1, 0x28);
  outb(0xA0 + 1, 0x02);
  outb(0xA0 + 1, 0x01);
  outb(0xA0 + 1, 0xFF);
}


x86 assembly (clang, -O0):
<resetear_pic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetear_pic>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @resetear_pic() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 33, i32 32)
%3 = call i32 @outb(i32 33, i32 4)
%4 = call i32 @outb(i32 33, i32 1)
%5 = call i32 @outb(i32 33, i32 255)
%6 = call i32 @outb(i32 160, i32 17)
%7 = call i32 @outb(i32 161, i32 40)
%8 = call i32 @outb(i32 161, i32 2)
%9 = call i32 @outb(i32 161, i32 1)
%10 = call i32 @outb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @resetear_pic() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 33, i32 32)
%3 = tail call i32 @outb(i32 33, i32 4)
%4 = tail call i32 @outb(i32 33, i32 1)
%5 = tail call i32 @outb(i32 33, i32 255)
%6 = tail call i32 @outb(i32 160, i32 17)
%7 = tail call i32 @outb(i32 161, i32 40)
%8 = tail call i32 @outb(i32 161, i32 2)
%9 = tail call i32 @outb(i32 161, i32 1)
%10 = tail call i32 @outb(i32 161, i32 255)
ret void
}
int xmlUCSIsGujarati(int code) {
  return (((code >= 0x0A80) && (code <= 0x0AFF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsGujarati>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsGujarati+0x26>
cmpl   $0xaff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsGujarati>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xa80,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsGujarati(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 2688
%4 = zext i1 %3 to i32
ret i32 %4
}
main() {
  short s;
  long l;
  char c;
  return (l << c) + (s << l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movsbl -0x11(%rbp),%ecx
mov    %ecx,%ecx
shl    %cl,%rax
movswl -0x6(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i64
%4 = alloca i8
store i32 0, i32* %1
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = zext i32 %7 to i64
%9 = shl i64 %5, %8
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
%14 = shl i32 %11, %13
%15 = sext i32 %14 to i64
%16 = add nsw i64 %9, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
unsigned secondary(unsigned u) {
  return ((u >> (sizeof(unsigned) * 4)) + 1) & ((1 << 17) - 1);
}


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

x86 assembly (clang, -O2):
<secondary>:
shr    $0x10,%edi
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @secondary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = add i32 %4, 1
%6 = and i32 %5, 131071
ret i32 %6
}

LLVM IR (-O2):
define i32 @secondary(i32 %0) {
%2 = lshr i32 %0, 16
%3 = add nuw nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcoll(const char *s, const char *t) { return strcmp(s, t); }


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

x86 assembly (clang, -O2):
<strcoll>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pb(int);
run(unsigned long long n) {
  n--;
  while (1) {
    pb((int)(n & 1));
    if (n < 2)
      break;
    n = (n - 2) / 2;
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
mov    %eax,%edi
call   1030 <pb@plt>
cmpq   $0x2,-0x10(%rbp)
jae    1147 <run+0x37>
jmp    115c <run+0x4c>
mov    -0x10(%rbp),%rax
sub    $0x2,%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <run+0x18>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
mov    %ebx,%edi
and    $0x1,%edi
call   1030 <pb@plt>
cmp    $0x2,%rbx
jb     114e <run+0x3e>
nopl   0x0(%rax,%rax,1)
add    $0xfffffffffffffffe,%rbx
mov    %rbx,%r14
shr    %r14
mov    %r14d,%edi
and    $0x1,%edi
call   1030 <pb@plt>
cmp    $0x3,%rbx
mov    %r14,%rbx
ja     1130 <run+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @run(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = add i64 %4, -1
store i64 %5, i64* %3
br label %6
6: ; preds = %1, %14
%7 = load i64, i64* %3
%8 = and i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i32 @pb(i32 %9)
%11 = load i64, i64* %3
%12 = icmp ult i64 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %6
br label %18
14: ; preds = %6
%15 = load i64, i64* %3
%16 = sub i64 %15, 2
%17 = udiv i64 %16, 2
store i64 %17, i64* %3
br label %6
18: ; preds = %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @run(i64 %0) {
%2 = add i64 %0, -1
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 1
%5 = tail call i32 @pb(i32 %4)
%6 = icmp ult i64 %2, 2
br i1 %6, label %15, label %7
7: ; preds = %1, %7
%8 = phi i64 [ %10, %7 ], [ %2, %1 ]
%9 = add i64 %8, -2
%10 = lshr i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = and i32 %11, 1
%13 = tail call i32 @pb(i32 %12)
%14 = icmp ult i64 %9, 4
br i1 %14, label %15, label %7
15: ; preds = %7, %1
ret i32 undef
}
void _Jv_remI() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_remI() {
ret void
}
void gtk_aspect_frame_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_aspect_frame_get_type() {
ret void
}
/* Variables and functions */
scalar_t__ gfx_gxm_config_read(int);
unsigned long gu1_get_cpu_register_base(void) {
  unsigned long base;
  base = (unsigned long)gfx_gxm_config_read(0xB8);
  base = (base & 0x03) << 30;
  return (base);
}


x86 assembly (clang, -O0):
<gu1_get_cpu_register_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb8,%edi
call   1030 <gfx_gxm_config_read@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
shl    $0x1e,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu1_get_cpu_register_base>:
push   %rax
mov    $0xb8,%edi
call   1030 <gfx_gxm_config_read@plt>
shl    $0x1e,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @gu1_get_cpu_register_base() {
%1 = alloca i64
%2 = call i64 @gfx_gxm_config_read(i32 184)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = and i64 %3, 3
%5 = shl i64 %4, 30
store i64 %5, i64* %1
%6 = load i64, i64* %1
ret i64 %6
}

LLVM IR (-O2):
define i64 @gu1_get_cpu_register_base() {
%1 = tail call i64 @gfx_gxm_config_read(i32 184)
%2 = shl i64 %1, 30
%3 = and i64 %2, 3221225472
ret i64 %3
}
void g_DUMMY_set_commandprompt(int win_id, char *prompt) {
  win_id = win_id;
  prompt = prompt;
}


x86 assembly (clang, -O0):
<g_DUMMY_set_commandprompt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @g_DUMMY_set_commandprompt(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA2_DMA18_DriverIRQHandler();
__attribute__((weak)) void DMA2_DMA18_IRQHandler(void) {
  DMA2_DMA18_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA2_DMA18_IRQHandler() {
%1 = call i32 (...) @DMA2_DMA18_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA2_DMA18_IRQHandler() {
%1 = tail call i32 (...) @DMA2_DMA18_DriverIRQHandler()
ret void
}
void convertBADC(char *convThis) {
  char tmp[4];
  tmp[0] = convThis[1];
  tmp[1] = convThis[0];
  tmp[2] = convThis[3];
  tmp[3] = convThis[2];
  convThis[0] = tmp[0];
  convThis[1] = tmp[1];
  convThis[2] = tmp[2];
  convThis[3] = tmp[3];
}


x86 assembly (clang, -O0):
<convertBADC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0xc(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertBADC>:
mov    (%rdi),%sil
mov    0x1(%rdi),%cl
mov    0x3(%rdi),%dl
mov    0x2(%rdi),%al
mov    %cl,(%rdi)
mov    %sil,0x1(%rdi)
mov    %dl,0x2(%rdi)
mov    %al,0x3(%rdi)
ret

LLVM IR (-O0):
define void @convertBADC(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %14, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %18, i8* %19
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%21 = load i8, i8* %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%25 = load i8, i8* %24
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 1
store i8 %25, i8* %27
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%29 = load i8, i8* %28
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 %29, i8* %31
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%33 = load i8, i8* %32
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i64 3
store i8 %33, i8* %35
ret void
}

LLVM IR (-O2):
define void @convertBADC(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = load i8, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %3, i8* %0
store i8 %4, i8* %2
store i8 %6, i8* %7
store i8 %8, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printusage(void) {
  fprintf(stderr, "Usage: bundlefont [-abv] [-n name] [-o outfile] "
                  "[infile]\n");
}


x86 assembly (clang, -O0):
<printusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printusage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: bundlefont [-abv] [-n name] [-o outfile] [infile]\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: bundlefont [-abv] [-n name] [-o outfile] [infile]\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int open_dev_file() {
  int fd;
  fd = open("/dev/iogen", O_RDONLY);
  if (fd < 0) {
    printf("Device file could not be opened. Please ensure the iogen driver "
           "module is loaded.\n");
    exit(0);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_dev_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    116d <open_dev_file+0x3d>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_dev_file>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
test   %eax,%eax
js     114c <open_dev_file+0x1c>
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/iogen\00"
@O_RDONLY = global i32 0
@.str.1 = [83 x i8] c"Device file could not be opened. Please ensure the iogen driver module is loaded.\0A\00"
define i32 @open_dev_file() {
%1 = alloca i32
%2 = load i32, i32* @O_RDONLY
%3 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/iogen\00"
@O_RDONLY = global i32 0
@str = [82 x i8] c"Device file could not be opened. Please ensure the iogen driver module is loaded.\00"
define i32 @open_dev_file() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("Usage:  load <filename> [at] <address>\n"); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: load <filename> [at] <address>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Usage: load <filename> [at] <address>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int sqlite3UnixSleep(int ms) {
  sleep((ms + 999) / 1000);
  return 1000 * ((ms + 999) / 1000);
}


x86 assembly (clang, -O0):
<sqlite3UnixSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3e7,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x3e7,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3UnixSleep>:
push   %rbx
add    $0x3e7,%edi
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x26,%rbx
add    %eax,%ebx
mov    %ebx,%edi
call   1030 <sleep@plt>
imul   $0x3e8,%ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sqlite3UnixSleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 999
%5 = sdiv i32 %4, 1000
%6 = call i32 @sleep(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 999
%9 = sdiv i32 %8, 1000
%10 = mul nsw i32 1000, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sqlite3UnixSleep(i32 %0) {
%2 = add nsw i32 %0, 999
%3 = sdiv i32 %2, 1000
%4 = tail call i32 @sleep(i32 %3)
%5 = mul nsw i32 %3, 1000
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ hctl_clearCoders();
void clearCoders(void) { hctl_clearCoders(); }


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

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

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

LLVM IR (-O2):
define void @clearCoders() {
%1 = tail call i32 (...) @hctl_clearCoders()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Pilha");
  printf("Hello Pilha 2");
  return 0;
}


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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello Pilha\00"
@.str.1 = [14 x i8] c"Hello Pilha 2\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char *append_string(char * or, char *new_end) {
  return append_string_n(or, new_end, (!new_end ? 0 : strlen(new_end)));
}


x86 assembly (clang, -O0):
<append_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <append_string+0x36>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1163 <append_string+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <append_string_n@plt>
cltq
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     113c <append_string+0x1c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rax,%rdx
jmp    113e <append_string+0x1e>
xor    %edx,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <append_string_n@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @append_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
br label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* %11)
br label %13
13: ; preds = %10, %9
%14 = phi i64 [ 0, %9 ], [ %12, %10 ]
%15 = call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @append_string_n to i32 (i8*, i8*, i64, ...)*)(i8* %5, i8* %6, i64 %14)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
define i8* @append_string(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @strlen(i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ 0, %2 ]
%8 = tail call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @append_string_n to i32 (i8*, i8*, i64, ...)*)(i8* %0, i8* %1, i64 %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
void dgtpicom_stop() {}


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

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

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

LLVM IR (-O2):
define void @dgtpicom_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int foo() { bar(); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i32 (...) @bar()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_backward(int, int);
void w_backward_test(void **state) {
  assert_int_equal(0x0000000000000200ul,
                   w_backward(0x0000000004000200ul, 0x0000000400000000ul));
  assert_int_equal(0x0000000000000200ul,
                   w_backward(0x0000000004000200ul, 0x0000000100000000ul));
}


x86 assembly (clang, -O0):
<w_backward_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4000200,%edi
xor    %esi,%esi
call   1040 <w_backward@plt>
mov    %eax,%esi
mov    $0x200,%edi
call   1030 <assert_int_equal@plt>
mov    $0x4000200,%edi
xor    %esi,%esi
call   1040 <w_backward@plt>
mov    %eax,%esi
mov    $0x200,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_backward_test>:
push   %rax
mov    $0x4000200,%edi
xor    %esi,%esi
call   1040 <w_backward@plt>
mov    $0x200,%edi
mov    %eax,%esi
call   1030 <assert_int_equal@plt>
mov    $0x4000200,%edi
xor    %esi,%esi
call   1040 <w_backward@plt>
mov    $0x200,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_backward_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_backward(i32 67109376, i32 0)
%4 = call i32 @assert_int_equal(i32 512, i32 %3)
%5 = call i32 @w_backward(i32 67109376, i32 0)
%6 = call i32 @assert_int_equal(i32 512, i32 %5)
ret void
}

LLVM IR (-O2):
define void @w_backward_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_backward(i32 67109376, i32 0)
%3 = tail call i32 @assert_int_equal(i32 512, i32 %2)
%4 = tail call i32 @w_backward(i32 67109376, i32 0)
%5 = tail call i32 @assert_int_equal(i32 512, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ encrypt_decrypt(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char *argv[]) {
  char filename[256];
  int flag;
  printf("Please, choose, which file you want to encrypt/decrypt: ");
  scanf("%s", filename);
  encrypt_decrypt(filename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <encrypt_decrypt@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <encrypt_decrypt@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Please, choose, which file you want to encrypt/decrypt: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = call i32 @encrypt_decrypt(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"Please, choose, which file you want to encrypt/decrypt: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @encrypt_decrypt(i8* %4)
ret i32 0
}
/* Variables and functions */
int reverse(int);
int test_reverse() {
  return 0xFFFF0000 == reverse(0x0000FFFF) &&
         0x0000FFFF == reverse(0xFFFF0000) && 0xFF0000FF == reverse(0xFF0000FF);
}


x86 assembly (clang, -O0):
<test_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffff,%edi
call   1030 <reverse@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffff0000,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    116d <test_reverse+0x5d>
mov    $0xffff0000,%edi
call   1030 <reverse@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffff,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    116d <test_reverse+0x5d>
mov    $0xff0000ff,%edi
call   1030 <reverse@plt>
mov    %eax,%ecx
mov    $0xff0000ff,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_reverse>:
push   %rbx
mov    $0xffff,%edi
call   1030 <reverse@plt>
xor    %ebx,%ebx
cmp    $0xffff0000,%eax
jne    1149 <test_reverse+0x39>
mov    $0xffff0000,%edi
call   1030 <reverse@plt>
cmp    $0xffff,%eax
jne    1149 <test_reverse+0x39>
mov    $0xff0000ff,%edi
call   1030 <reverse@plt>
xor    %ebx,%ebx
cmp    $0xff0000ff,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_reverse() {
%1 = call i32 @reverse(i32 65535)
%2 = icmp eq i32 -65536, %1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i32 @reverse(i32 -65536)
%5 = icmp eq i32 65535, %4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 @reverse(i32 -16776961)
%8 = icmp eq i32 -16776961, %7
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_reverse() {
%1 = tail call i32 @reverse(i32 65535)
%2 = icmp eq i32 %1, -65536
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 @reverse(i32 -65536)
%5 = icmp eq i32 %4, 65535
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @reverse(i32 -16776961)
%8 = icmp eq i32 %7, -16776961
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
double div(unsigned int numArgs, double *args) {
  if (args[1] < 0)
    die("Division by zero");
  return args[0] / args[1];
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
jbe    113d <div+0x2d>
lea    0xec8(%rip),%rdi
call   1030 <die@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  0x8(%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
push   %rbx
mov    %rsi,%rbx
movsd  0x8(%rsi),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1134 <div+0x24>
lea    0xed6(%rip),%rdi
call   1030 <die@plt>
movsd  0x8(%rbx),%xmm1
movsd  (%rbx),%xmm0
divsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Division by zero\00"
define double @div(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 1
%7 = load double, double* %6
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fdiv double %14, %17
ret double %18
}

LLVM IR (-O2):
@.str = [17 x i8] c"Division by zero\00"
define double @div(i32 %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load double, double* %3
br label %9
9: ; preds = %6, %2
%10 = phi double [ %8, %6 ], [ %4, %2 ]
%11 = load double, double* %1
%12 = fdiv double %11, %10
ret double %12
}
double foo(double x) { return __builtin_sqrt(x); }


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

x86 assembly (clang, -O2):
<foo>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <foo+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @foo(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Type definitions */
struct pair {
  int dummy;
};

/* Variables and functions */
struct pair *pair_prev(struct pair *);
struct pair *pair_first(struct pair *pair) {
  struct pair *prev = pair;
  if (!pair)
    return NULL;
  do {
    pair = prev;
    prev = pair_prev(pair);
  } while (prev);
  return pair;
}


x86 assembly (clang, -O0):
<pair_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113c <pair_first+0x2c>
movq   $0x0,-0x8(%rbp)
jmp    1169 <pair_first+0x59>
jmp    1141 <pair_first+0x31>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <pair_prev@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <pair_first+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_first>:
push   %rbx
test   %rdi,%rdi
je     1132 <pair_first+0x22>
mov    %rdi,%rax
nopl   0x0(%rax)
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <pair_prev@plt>
test   %rax,%rax
jne    1120 <pair_first+0x10>
jmp    1134 <pair_first+0x24>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pair = type { i32 }
define %struct.pair* @pair_first(%struct.pair* %0) {
%2 = alloca %struct.pair*
%3 = alloca %struct.pair*
%4 = alloca %struct.pair*
store %struct.pair* %0, %struct.pair** %3
%5 = load %struct.pair*, %struct.pair** %3
store %struct.pair* %5, %struct.pair** %4
%6 = load %struct.pair*, %struct.pair** %3
%7 = icmp ne %struct.pair* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store %struct.pair* null, %struct.pair** %2
br label %19
9: ; preds = %1
br label %10
10: ; preds = %14, %9
%11 = load %struct.pair*, %struct.pair** %4
store %struct.pair* %11, %struct.pair** %3
%12 = load %struct.pair*, %struct.pair** %3
%13 = call %struct.pair* @pair_prev(%struct.pair* %12)
store %struct.pair* %13, %struct.pair** %4
br label %14
14: ; preds = %10
%15 = load %struct.pair*, %struct.pair** %4
%16 = icmp ne %struct.pair* %15, null
br i1 %16, label %10, label %17
17: ; preds = %14
%18 = load %struct.pair*, %struct.pair** %3
store %struct.pair* %18, %struct.pair** %2
br label %19
19: ; preds = %17, %8
%20 = load %struct.pair*, %struct.pair** %2
ret %struct.pair* %20
}

LLVM IR (-O2):
%struct.pair = type { i32 }
define %struct.pair* @pair_first(%struct.pair* %0) {
%2 = icmp eq %struct.pair* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi %struct.pair* [ %5, %3 ], [ %0, %1 ]
%5 = tail call %struct.pair* @pair_prev(%struct.pair* %4)
%6 = icmp eq %struct.pair* %5, null
br i1 %6, label %7, label %3
7: ; preds = %3, %1
%8 = phi %struct.pair* [ null, %1 ], [ %4, %3 ]
ret %struct.pair* %8
}
int isInRange(long x, long minx, long maxx) {
  if (minx <= x && x < maxx)
    return 1;
  if (x < 180000000)
    x += 360000000;
  else
    x -= 360000000;
  if (minx <= x && x < maxx)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isInRange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1138 <isInRange+0x38>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1138 <isInRange+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1196 <isInRange+0x96>
cmpq   $0xaba9500,-0x10(%rbp)
0a
jge    1159 <isInRange+0x59>
mov    -0x10(%rbp),%rax
add    $0x15752a00,%rax
mov    %rax,-0x10(%rbp)
jmp    1167 <isInRange+0x67>
mov    -0x10(%rbp),%rax
sub    $0x15752a00,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     118f <isInRange+0x8f>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    118f <isInRange+0x8f>
movl   $0x1,-0x4(%rbp)
jmp    1196 <isInRange+0x96>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInRange>:
cmp    %rdi,%rsi
jg     1110 <isInRange+0x10>
mov    $0x1,%eax
cmp    %rdx,%rdi
jge    1110 <isInRange+0x10>
ret
lea    -0x15752a00(%rdi),%rax
lea    0x15752a00(%rdi),%rcx
cmp    $0xaba9500,%rdi
cmovl  %rcx,%rax
cmp    %rsi,%rax
setge  %cl
cmp    %rdx,%rax
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isInRange(i64 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = icmp sle i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i64, i64* %5
%13 = load i64, i64* %7
%14 = icmp slt i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %4
br label %35
16: ; preds = %11, %3
%17 = load i64, i64* %5
%18 = icmp slt i64 %17, 180000000
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i64, i64* %5
%21 = add nsw i64 %20, 360000000
store i64 %21, i64* %5
br label %25
22: ; preds = %16
%23 = load i64, i64* %5
%24 = sub nsw i64 %23, 360000000
store i64 %24, i64* %5
br label %25
25: ; preds = %22, %19
%26 = load i64, i64* %6
%27 = load i64, i64* %5
%28 = icmp sle i64 %26, %27
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i64, i64* %5
%31 = load i64, i64* %7
%32 = icmp slt i64 %30, %31
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 1, i32* %4
br label %35
34: ; preds = %29, %25
store i32 0, i32* %4
br label %35
35: ; preds = %34, %33, %15
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
define i32 @isInRange(i64 %0, i64 %1, i64 %2) {
%4 = icmp sle i64 %1, %0
%5 = icmp slt i64 %0, %2
%6 = and i1 %4, %5
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = icmp slt i64 %0, 180000000
%9 = select i1 %8, i64 360000000, i64 -360000000
%10 = add nsw i64 %9, %0
%11 = icmp sge i64 %10, %1
%12 = icmp slt i64 %10, %2
%13 = and i1 %11, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %7, %3
%16 = phi i32 [ 1, %3 ], [ %14, %7 ]
ret i32 %16
}
/* Type definitions */
struct mdoc_node {
  int dummy;
};
struct mdoc_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_offs(char *);
int pre_dl(const struct mdoc_meta *meta, const struct mdoc_node *n) {
  print_offs("6n");
  return (1);
}


x86 assembly (clang, -O0):
<pre_dl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <print_offs@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_dl>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <print_offs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
@.str = [3 x i8] c"6n\00"
define i32 @pre_dl(%struct.mdoc_meta* %0, %struct.mdoc_node* %1) {
%3 = alloca %struct.mdoc_meta*
%4 = alloca %struct.mdoc_node*
store %struct.mdoc_meta* %0, %struct.mdoc_meta** %3
store %struct.mdoc_node* %1, %struct.mdoc_node** %4
%5 = call i32 @print_offs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.mdoc_meta = type { i32 }
%struct.mdoc_node = type { i32 }
@.str = [3 x i8] c"6n\00"
define i32 @pre_dl(%struct.mdoc_meta* nocapture readnone %0, %struct.mdoc_node* nocapture readnone %1) {
%3 = tail call i32 @print_offs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int omp_get_thread_num();
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int var = 0;
#pragma omp parallel num_threads(2) shared(var)
  {
    if (omp_get_thread_num() == 1) {
      var++;
    }
  }
  var++;
  fprintf(stderr, "DONE\n");
  int error = (var != 2);
  return error;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
cmp    $0x1,%eax
jne    1156 <main+0x36>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x2,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bl
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"DONE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32 (...) @omp_get_thread_num()
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 2
%20 = zext i1 %19 to i32
store i32 %20, i32* %7
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"DONE\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = icmp ne i32 %3, 1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = zext i1 %4 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x6c() {
  Assert_real((isalnum(108)),
              "/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_isalnum.c",
              545, ("isalnum should be 1 for l"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x6c>:
push   %rax
mov    $0x6c,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x221,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for l\00"
define void @t_isalnum_0x6c() {
%1 = call i32 @isalnum(i32 108)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 545, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for l\00"
define void @t_isalnum_0x6c() {
%1 = tail call i32 @isalnum(i32 108)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 545, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord1dv(int /*<<< orphan*/ *);
void TexCoord1dv(GLdouble v[1]) { glTexCoord1dv(v); }


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

x86 assembly (clang, -O2):
<TexCoord1dv>:
jmp    1030 <glTexCoord1dv@plt>

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

LLVM IR (-O2):
define void @TexCoord1dv(i32* %0) {
%2 = tail call i32 @glTexCoord1dv(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void set_tweak_in_tweakey(uint8_t *tweakey, uint8_t *tweak) {
  memcpy(tweakey + 10, tweak, 6);
}


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

x86 assembly (clang, -O2):
<set_tweak_in_tweakey>:
add    $0x28,%rdi
mov    $0x6,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @set_tweak_in_tweakey(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 = getelementptr inbounds i32, i32* %5, i64 10
%7 = load i32*, i32** %4
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 6)
ret void
}

LLVM IR (-O2):
define void @set_tweak_in_tweakey(i32* %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 10
%4 = tail call i32 @memcpy(i32* %3, i32* %1, i32 6)
ret void
}