xunge/DecIR huggingface dataset:
int prioridad(char op) {
  int prio;
  switch (op) {
  case '^':
  case '%':
    prio = 3;
    break;
  case '*':
  case '/':
    prio = 2;
    break;
  case '+':
  case '-':
    prio = 1;
    break;
  case '(':
    prio = 0;
    break;
  }
  return prio;
}


x86 assembly (clang, -O0):
<prioridad>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffdb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x39,%eax
ja     115f <prioridad+0x5f>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x8(%rbp)
jmp    115f <prioridad+0x5f>
movl   $0x2,-0x8(%rbp)
jmp    115f <prioridad+0x5f>
movl   $0x1,-0x8(%rbp)
jmp    115f <prioridad+0x5f>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prioridad>:
add    $0xffffffd8,%edi
mov    $0x3,%eax
cmp    $0x7,%edi
ja     111a <prioridad+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @prioridad(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 94, label %6
i32 37, label %6
i32 42, label %7
i32 47, label %7
i32 43, label %8
i32 45, label %8
i32 40, label %9
]
6: ; preds = %1, %1
store i32 3, i32* %3
br label %10
7: ; preds = %1, %1
store i32 2, i32* %3
br label %10
8: ; preds = %1, %1
store i32 1, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %1, %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@switch.table.prioridad = [8 x i32] [i32 0, i32 3, i32 2, i32 1, i32 3, i32 1, i32 3, i32 2]
define i32 @prioridad(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -40
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.prioridad, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 3, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
#define EINTR 128
int errno;
scalar_t__ read(int, void *, size_t);
ssize_t safe_read(int fd, void *buf, size_t count) {
  ssize_t res;
  for (;;) {
    res = read(fd, buf, count);
    if (res >= 0)
      return res;
    switch (errno) {
    case EINTR:
      continue;
    default:
      return -1;
    }
  }
}


x86 assembly (clang, -O0):
<safe_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jl     114f <safe_read+0x3f>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <safe_read+0x65>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
sub    $0x80,%eax
jne    116d <safe_read+0x5d>
jmp    1168 <safe_read+0x58>
jmp    1123 <safe_read+0x13>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eba(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
test   %rax,%rax
jns    1152 <safe_read+0x42>
cmpl   $0x80,(%r15)
je     1130 <safe_read+0x20>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i64 @safe_read(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* @errno
%9 = icmp eq i32 %8, 128
br i1 %9, label %4, label %10
10: ; preds = %7, %4
%11 = phi i64 [ %5, %4 ], [ -1, %7 ]
ret i64 %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bswap_16(uint16_t val) {
  return ((val & (uint16_t)0x00ffU) << 8) | ((val & (uint16_t)0xff00U) >> 8);
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @bswap_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bswap_16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sink(int /*<<< orphan*/, char);
__attribute__((noipa)) void fca1_1(char a[1][1]) {
  sink(0, a[0][0]);
  sink(0, a[0][1]);
}


x86 assembly (clang, -O0):
<fca1_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl (%rax),%esi
call   1030 <sink@plt>
mov    -0x8(%rbp),%rax
xor    %edi,%edi
movsbl 0x1(%rax),%esi
call   1030 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fca1_1>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%esi
xor    %edi,%edi
call   1030 <sink@plt>
movsbl 0x1(%rbx),%esi
xor    %edi,%edi
pop    %rbx
jmp    1030 <sink@plt>

LLVM IR (-O0):
define void @fca1_1([1 x i8]* %0) {
%2 = alloca [1 x i8]*
store [1 x i8]* %0, [1 x i8]** %2
%3 = load [1 x i8]*, [1 x i8]** %2
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%6 = load i8, i8* %5
%7 = call i32 @sink(i32 0, i8 signext %6)
%8 = load [1 x i8]*, [1 x i8]** %2
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %8, i64 0
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %9, i64 0, i64 1
%11 = load i8, i8* %10
%12 = call i32 @sink(i32 0, i8 signext %11)
ret void
}

LLVM IR (-O2):
define void @fca1_1([1 x i8]* nocapture %0) {
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %0, i64 0, i64 0
%3 = load i8, i8* %2
%4 = tail call i32 @sink(i32 0, i8 signext %3)
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %0, i64 0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @sink(i32 0, i8 signext %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void pre_task() { write("ganttproject.gan", "\t\t<task", NULL); }


x86 assembly (clang, -O0):
<pre_task>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_task>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [8 x i8] c"\09\09<task\00"
define void @pre_task() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [8 x i8] c"\09\09<task\00"
define void @pre_task() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
void foo670(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo670(i32 %0) {
ret void
}
int deffeed_() { return (1); }


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

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

LLVM IR (-O0):
define i32 @deffeed_() {
ret i32 1
}

LLVM IR (-O2):
define i32 @deffeed_() {
ret i32 1
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *copystring(const char *s) {
  char *b;
  b = malloc(strlen(s) + 1);
  strcpy(b, s);
  return b;
}


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

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

LLVM IR (-O0):
define i8* @copystring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @copystring(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
double dp_sub(double a, double b) { return a - b; }


x86 assembly (clang, -O0):
<dp_sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dp_sub>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @dp_sub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int strtol(char const *, char **, int);
void getNumArg2(const char *s, int *n1p, int *n2p) {
  char *s2;
  *n1p = strtol(s, &s2, 10);
  *n2p = strtol(s2 + 1, NULL, 10);
}


x86 assembly (clang, -O0):
<getNumArg2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumArg2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%rbx)
mov    (%rsp),%rdi
add    $0x1,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @getNumArg2(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i32 @strtol(i8* %8, i8** %7, i32 10)
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = call i32 @strtol(i8* %12, i8** null, i32 10)
%14 = load i32*, i32** %6
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @getNumArg2(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @strtol(i8* %0, i8** %4, i32 10)
store i32 %6, i32* %1
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @strtol(i8* nocapture %8, i8** null, i32 10)
store i32 %9, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo3(char, char, char, char, char, char, char, char, char,
                        char, char, char);
int main(void) {
  foo3('h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', '!');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x68,%edi
mov    $0x65,%esi
mov    $0x6c,%ecx
mov    $0x6f,%r8d
mov    $0x20,%r9d
mov    %ecx,%edx
movl   $0x77,(%rsp)
movl   $0x6f,0x8(%rsp)
movl   $0x72,0x10(%rsp)
movl   $0x6c,0x18(%rsp)
movl   $0x64,0x20(%rsp)
movl   $0x21,0x28(%rsp)
call   1030 <foo3@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x68,%edi
mov    $0x65,%esi
mov    $0x6c,%edx
mov    $0x6c,%ecx
mov    $0x6f,%r8d
mov    $0x20,%r9d
push   $0x21
push   $0x64
push   $0x6c
push   $0x72
push   $0x6f
push   $0x77
call   1030 <foo3@plt>
add    $0x30,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo3(i8 signext 104, i8 signext 101, i8 signext 108, i8 signext 108, i8 signext 111, i8 signext 32, i8 signext 119, i8 signext 111, i8 signext 114, i8 signext 108, i8 signext 100, i8 signext 33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo3(i8 signext 104, i8 signext 101, i8 signext 108, i8 signext 108, i8 signext 111, i8 signext 32, i8 signext 119, i8 signext 111, i8 signext 114, i8 signext 108, i8 signext 100, i8 signext 33)
ret i32 0
}
/* Variables and functions */
float acosf(float);
void __hv_acos_f(float bIn, float *bOut) { *bOut = acosf(bIn); }


x86 assembly (clang, -O0):
<__hv_acos_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <acosf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_acos_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <acosf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__hv_acos_f(float %0, float* nocapture writeonly %1) {
%3 = tail call float @acosf(float %0)
store float %3, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: c2ascii 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 = [21 x i8] c"Usage: c2ascii file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: c2ascii file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ getpass(char *);
char *md_getpass(char *prompt) { return ((char *)getpass(prompt)); }


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

x86 assembly (clang, -O2):
<md_getpass>:
jmp    1030 <getpass@plt>

LLVM IR (-O0):
define i8* @md_getpass(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @getpass(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @md_getpass(i8* %0) {
%2 = tail call i64 @getpass(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int toy_library_hello() { printf("Hello there!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello there!\00"
define i32 @toy_library_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void __attribute__((
    __warning__("curl_easy_getinfo expects a pointer to double for this info")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_getinfo_err_double(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_getinfo_err_double() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
void readsfromfile_no_end_of_file_check(FILE *fp, char *s, char *inputfile,
                                        int *line) {
  char smess[100000];
  (*line)++;
  fgets(s, 100000, fp);
}


x86 assembly (clang, -O0):
<readsfromfile_no_end_of_file_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186c0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x186a0,%esi
call   1030 <fgets@plt>
add    $0x186c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readsfromfile_no_end_of_file_check>:
mov    %rdi,%rdx
addl   $0x1,(%rcx)
mov    %rsi,%rdi
mov    $0x186a0,%esi
jmp    1030 <fgets@plt>

LLVM IR (-O0):
define void @readsfromfile_no_end_of_file_check(i32* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca [100000 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %8
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i8*, i8** %6
%14 = load i32*, i32** %5
%15 = call i32 @fgets(i8* %13, i32 100000, i32* %14)
ret void
}

LLVM IR (-O2):
define void @readsfromfile_no_end_of_file_check(i32* nocapture %0, i8* %1, i8* nocapture readnone %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = tail call i32 @fgets(i8* %1, i32 100000, i32* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t getProtoMode(uint8_t *data) { return (data[0] >> 4) & 0x01; }


x86 assembly (clang, -O0):
<getProtoMode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x4,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getProtoMode>:
mov    (%rdi),%eax
shr    $0x4,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getProtoMode(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @getProtoMode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 4
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;
typedef scalar_t__ a;

/* Variables and functions */
void *p2v(uint a) { return (void *)((a) + 0x80000000); }


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

x86 assembly (clang, -O2):
<p2v>:
mov    %edi,%eax
xor    $0x80000000,%eax
ret

LLVM IR (-O0):
define i8* @p2v(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -2147483648
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @p2v(i32 %0) {
%2 = xor i32 %0, -2147483648
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
__attribute__((always_)) void module_add_driver(struct module *mod,
                                                struct device_driver *drv) {}


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

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

LLVM IR (-O0):
%struct.module = type opaque
%struct.device_driver = type opaque
define void @module_add_driver(%struct.module* %0, %struct.device_driver* %1) {
%3 = alloca %struct.module*
%4 = alloca %struct.device_driver*
store %struct.module* %0, %struct.module** %3
store %struct.device_driver* %1, %struct.device_driver** %4
ret void
}

LLVM IR (-O2):
%struct.module = type opaque
%struct.device_driver = type opaque
define void @module_add_driver(%struct.module* nocapture %0, %struct.device_driver* nocapture %1) {
ret void
}
int isLeap(int year) {
  if (year % 4 == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isLeap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <isLeap+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isLeap+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeap>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isLeap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
char *velika(char *s) {
  char *p = s;
  while (*s != '\0') {
    if (*s >= 'a' && *s <= 'z')
      *s = *s - 32;
    s++;
  }
  return p;
}


x86 assembly (clang, -O0):
<velika>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <velika+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1152 <velika+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1152 <velika+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <velika+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<velika>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <velika+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <velika+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <velika+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <velika+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <velika+0x10>
ret

LLVM IR (-O0):
define i8* @velika(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %27, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %27
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %27
20: ; preds = %15
%21 = load i8*, i8** %2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 32
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %2
store i8 %25, i8* %26
br label %27
27: ; preds = %20, %15, %10
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %2
br label %5
30: ; preds = %5
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @velika(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ read_file_u32(int, int /*<<< orphan*/);
int32_t read_file_s32(int fd, uint64_t addr) { return read_file_u32(fd, addr); }


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

x86 assembly (clang, -O2):
<read_file_s32>:
jmp    1030 <read_file_u32@plt>

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

LLVM IR (-O2):
define i32 @read_file_s32(i32 %0, i32 %1) {
%3 = tail call i32 @read_file_u32(i32 %0, i32 %1)
ret i32 %3
}
void uint_char(unsigned int i, unsigned char *p) {
  p[0] = (i >> 24) & 255;
  p[1] = (i >> 16) & 255;
  p[2] = (i >> 8) & 255;
  p[3] = (i)&255;
}


x86 assembly (clang, -O0):
<uint_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_char>:
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @uint_char(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
%6 = lshr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %3
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %3
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @uint_char(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int toword(const uint8_t *p) { return p[0] | p[1] << 8; }


x86 assembly (clang, -O0):
<toword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toword>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @toword(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @toword(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
void Convert8To16Plane() {}


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

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

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

LLVM IR (-O2):
define void @Convert8To16Plane() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strcpy(char *dest, const char *src) {
  int len = strlen(src);
  memcpy(dest, src, len + 1);
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <memcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i32 @memcpy(i8* %8, i8* %9, i32 %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret i8* %0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ traverse(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc == 1)
    traverse(".", 0);
  else
    traverse(argv[1], 0);
  return EXIT_SUCCESS;
}


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)
cmpl   $0x1,-0x8(%rbp)
jne    1143 <main+0x33>
lea    0xec9(%rip),%rdi
xor    %esi,%esi
call   1030 <traverse@plt>
jmp    1152 <main+0x42>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
call   1030 <traverse@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    111f <main+0xf>
lea    0xee3(%rip),%rdi
jmp    1123 <main+0x13>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
call   1030 <traverse@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @traverse(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @traverse(i8* %13, i32 0)
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @traverse(i8* %8, i32 0)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./text2bin input_file output_file -f|-d\n");
  printf("    -f  use floating point format (4 bytes)\n");
  printf("    -d  use float precision format (8 bytes)\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: ./text2bin input_file output_file -f|-d\0A\00"
@.str.1 = [45 x i8] c" -f use floating point format (4 bytes)\0A\00"
@.str.2 = [46 x i8] c" -d use float precision format (8 bytes)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [47 x i8] c"Usage: ./text2bin input_file output_file -f|-d\00"
@str.3 = [44 x i8] c" -f use floating point format (4 bytes)\00"
@str.4 = [45 x i8] c" -d use float precision format (8 bytes)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htobe32(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void ph_to_be32(void *v, uint32_t u) {
  u = htobe32(u);
  memcpy(v, &u, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<ph_to_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <htobe32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ph_to_be32>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <htobe32@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ph_to_be32(i8* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htobe32(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
int iso_722(c)
char *c;
{ return (((c[0] & 0xff) << 8) | (c[1] & 0xff)); }


x86 assembly (clang, -O0):
<iso_722>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_722>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @iso_722(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SPRAYPROG;
int /*<<< orphan*/ SPRAYVERS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ rpcb_unset(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/ *);
void cleanup(int n) {
  (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL);
  exit(0);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <rpcb_unset@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <rpcb_unset@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SPRAYPROG = global i32 0
@SPRAYVERS = global i32 0
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SPRAYPROG
%4 = load i32, i32* @SPRAYVERS
%5 = call i32 @rpcb_unset(i32 %3, i32 %4, i32* null)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SPRAYPROG = global i32 0
@SPRAYVERS = global i32 0
define void @cleanup(i32 %0) {
%2 = load i32, i32* @SPRAYPROG
%3 = load i32, i32* @SPRAYVERS
%4 = tail call i32 @rpcb_unset(i32 %2, i32 %3, i32* null)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ testGetSymbol();
void testNoun() { testGetSymbol(); }


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

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

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

LLVM IR (-O2):
define void @testNoun() {
%1 = tail call i32 (...) @testGetSymbol()
ret void
}
void mem_trim(void) { return; }


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

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

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

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

/* Variables and functions */
__attribute__((__pure__)) uint16_t h2_u16(const uint8_t *const s) {
  return ((uint16_t)s[0] << 8) | (uint16_t)s[1];
}


x86 assembly (clang, -O0):
<h2_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2_u16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @h2_u16(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @h2_u16(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Type definitions */
struct chashtable {
  int dummy;
};

/* Variables and functions */
int _chash_add_internel(struct chashtable *, void *, void *,
                        int /*<<< orphan*/);
int chash_add(struct chashtable *cht, void *key, void *value) {
  return _chash_add_internel(cht, key, value, 0);
}


x86 assembly (clang, -O0):
<chash_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <_chash_add_internel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chash_add>:
xor    %ecx,%ecx
jmp    1030 <_chash_add_internel@plt>

LLVM IR (-O0):
%struct.chashtable = type { i32 }
define i32 @chash_add(%struct.chashtable* %0, i8* %1, i8* %2) {
%4 = alloca %struct.chashtable*
%5 = alloca i8*
%6 = alloca i8*
store %struct.chashtable* %0, %struct.chashtable** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.chashtable*, %struct.chashtable** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @_chash_add_internel(%struct.chashtable* %7, i8* %8, i8* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.chashtable = type { i32 }
define i32 @chash_add(%struct.chashtable* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_chash_add_internel(%struct.chashtable* %0, i8* %1, i8* %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void hej(void) { puts("helloo world\n fefefe"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"helloo world\0A fefefe\00"
define void @hej() {
%1 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"helloo world\0A fefefe\00"
define void @hej() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
void rotr(int *a, int *b, int *c) {
  int d, e, f;
  d = *a;
  e = *b;
  f = *c;
  *a = f;
  *b = d;
  *c = e;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rdi),%r8d
mov    (%rsi),%ecx
mov    (%rdx),%eax
mov    %eax,(%rdi)
mov    %r8d,(%rsi)
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
store i32 %13, i32* %8
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = load i32*, i32** %4
store i32 %16, i32* %17
%18 = load i32, i32* %7
%19 = load i32*, i32** %5
store i32 %18, i32* %19
%20 = load i32, i32* %8
%21 = load i32*, i32** %6
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = load i32, i32* %2
store i32 %6, i32* %0
store i32 %4, i32* %1
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rnd(void) { return ((double)rand()) / ((double)RAND_MAX); }


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rnd() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rnd() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
void CrashLog_Init() {}


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

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

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

LLVM IR (-O2):
define void @CrashLog_Init() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isPOP(const char *comm) { return strcmp(comm, "pop") == 0; }


x86 assembly (clang, -O0):
<isPOP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPOP>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"pop\00"
define i32 @isPOP(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"pop\00"
define i32 @isPOP(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}