xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char const);
const char *next_char(const char *p) {
  do {
    ++p;
  } while (isspace(*p));
  return p;
}


x86 assembly (clang, -O0):
<next_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    111c <next_char+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_char>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <next_char+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @next_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %6, %1
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
br label %6
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = call i64 @isspace(i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %6
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @next_char(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i8* %4
}
int foo(int a, int b) {
  if (!(a || b)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112a <foo+0x2a>
cmpl   $0x0,-0xc(%rbp)
jne    112a <foo+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <foo+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
or     %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int isLeapYear(unsigned y) {
  return y % 400 == 0 || (y % 100 != 0 && y % 4 == 0);
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
je     1150 <isLeapYear+0x50>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
je     114a <isLeapYear+0x4a>
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
imul   $0xc28f5c29,%edi,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     1127 <isLeapYear+0x27>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     112d <isLeapYear+0x2d>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = urem i32 %3, 400
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = urem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = urem i32 %11, 4
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = urem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = urem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
void thread_work(void *data) { *(int *)data += 1; }


x86 assembly (clang, -O0):
<thread_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_work>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @thread_work(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_additem(int, char *);
void j_additem(int arg0, char *arg1) { japi_additem(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_additem>:
jmp    1030 <japi_additem@plt>

LLVM IR (-O0):
define void @j_additem(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 = load i8*, i8** %4
%7 = call i32 @japi_additem(i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @j_additem(i32 %0, i8* %1) {
%3 = tail call i32 @japi_additem(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n");
  printf("  compile fragment|vertex <source> <output>\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [45 x i8] c" compile fragment|vertex <source> <output>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 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))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [44 x i8] c" compile fragment|vertex <source> <output>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  signed short s = -1;
  if (sizeof(long long) == sizeof(unsigned int))
    return 0;
  if ((unsigned int)s >= 0x100000000ULL)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xffff,-0x6(%rbp)
movswl -0x6(%rbp),%eax
mov    %eax,%eax
movabs $0x100000000,%rcx
cmp    %rcx,%rax
jb     1145 <main+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 -1, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = zext i32 %4 to i64
%6 = icmp uge i64 %5, 4294967296
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double cosh(arg)
double arg;
{
  if (arg < 0)
    arg = -arg;
  if (arg > 21.) {
    return (exp(arg) / 2);
  }
  return ((exp(arg) + exp(-arg)) / 2);
}


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114c <cosh+0x3c>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1183 <cosh+0x73>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11d0 <cosh+0xc0>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe41(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
sub    $0x28,%rsp
movapd 0xee4(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
movapd %xmm3,0x10(%rsp)
movapd %xmm3,%xmm0
call   1030 <exp@plt>
movapd 0x10(%rsp),%xmm1
ucomisd 0xeba(%rip),%xmm1
ja     1185 <cosh+0x75>
movsd  %xmm0,0x8(%rsp)
movapd 0xe9a(%rip),%xmm0
xorpd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe8b(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @cosh(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %3
br label %9
9: ; preds = %6, %1
%10 = load double, double* %3
%11 = fcmp ogt double %10, 2.100000e+01
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load double, double* %3
%14 = call double @exp(double %13)
%15 = fdiv double %14, 2.000000e+00
store double %15, double* %2
br label %24
16: ; preds = %9
%17 = load double, double* %3
%18 = call double @exp(double %17)
%19 = load double, double* %3
%20 = fneg double %19
%21 = call double @exp(double %20)
%22 = fadd double %18, %21
%23 = fdiv double %22, 2.000000e+00
store double %23, double* %2
br label %24
24: ; preds = %16, %12
%25 = load double, double* %2
ret double %25
}

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fcmp ogt double %4, 2.100000e+01
%6 = tail call double @exp(double %4)
br i1 %5, label %11, label %7
7: ; preds = %1
%8 = fneg double %4
%9 = tail call double @exp(double %8)
%10 = fadd double %6, %9
br label %11
11: ; preds = %1, %7
%12 = phi double [ %10, %7 ], [ %6, %1 ]
%13 = fmul double %12, 5.000000e-01
ret double %13
}
/* Type definitions */
struct user_regs_struct {
  int orig_rax;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ptrace_getregs(int /*<<< orphan*/,
                                  struct user_regs_struct *);
int get_syscallid(pid_t pid) {
  struct user_regs_struct regs;
  ptrace_getregs(pid, &regs);
  return regs.orig_rax;
}


x86 assembly (clang, -O0):
<get_syscallid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <ptrace_getregs@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_syscallid>:
push   %rax
mov    %rsp,%rsi
call   1030 <ptrace_getregs@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define i32 @get_syscallid(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.user_regs_struct
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ptrace_getregs(i32 %4, %struct.user_regs_struct* %3)
%6 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define i32 @get_syscallid(i32 %0) {
%2 = alloca %struct.user_regs_struct
%3 = bitcast %struct.user_regs_struct* %2 to i8*
%4 = call i32 @ptrace_getregs(i32 %0, %struct.user_regs_struct* %2)
%5 = getelementptr inbounds %struct.user_regs_struct, %struct.user_regs_struct* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
unsigned int jhash_3words(unsigned int, unsigned int, int /*<<< orphan*/,
                          unsigned int);
unsigned int jhash_2words(unsigned int a, unsigned int b,
                          unsigned int initval) {
  return jhash_3words(a, b, 0, initval);
}


x86 assembly (clang, -O0):
<jhash_2words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
call   1030 <jhash_3words@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jhash_2words>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <jhash_3words@plt>

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

LLVM IR (-O2):
define i32 @jhash_2words(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @jhash_3words(i32 %0, i32 %1, i32 0, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void showhelp(char *mainpgm) {
  fprintf(stderr,
          "Usage: %s [-v] [-r] [-u] [-e error_log] [-E end_char_in_hex] [-o "
          "outfile] [infile]\n",
          mainpgm);
}


x86 assembly (clang, -O0):
<showhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showhelp>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [84 x i8] c"Usage: %s [-v] [-r] [-u] [-e error_log] [-E end_char_in_hex] [-o outfile] [infile]\0A\00"
define void @showhelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [84 x i8] c"Usage: %s [-v] [-r] [-u] [-e error_log] [-E end_char_in_hex] [-o outfile] [infile]\0A\00"
define void @showhelp(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct child_process {
  int dummy;
};

/* Variables and functions */
int finish_command(struct child_process *);
int start_command(struct child_process *);
int run_command(struct child_process *cmd) {
  int code = start_command(cmd);
  if (code) {
    return code;
  }
  return finish_command(cmd);
}


x86 assembly (clang, -O0):
<run_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <start_command@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114d <run_command+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <run_command+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <finish_command@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_command>:
push   %rbx
mov    %rdi,%rbx
call   1030 <start_command@plt>
test   %eax,%eax
je     112f <run_command+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <finish_command@plt>

LLVM IR (-O0):
%struct.child_process = type { i32 }
define i32 @run_command(%struct.child_process* %0) {
%2 = alloca i32
%3 = alloca %struct.child_process*
%4 = alloca i32
store %struct.child_process* %0, %struct.child_process** %3
%5 = load %struct.child_process*, %struct.child_process** %3
%6 = call i32 @start_command(%struct.child_process* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load %struct.child_process*, %struct.child_process** %3
%13 = call i32 @finish_command(%struct.child_process* %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.child_process = type { i32 }
define i32 @run_command(%struct.child_process* %0) {
%2 = tail call i32 @start_command(%struct.child_process* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @finish_command(%struct.child_process* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_RenderingControl_SetColorTemperature(
    struct UPnPService *Service, int ErrorCode, void *User) {
  printf("RND Invoke Response: "
         "RenderingControl/SetColorTemperature[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_SetColorTemperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: RenderingControl/SetColorTemperature[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetColorTemperature(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: RenderingControl/SetColorTemperature[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_RenderingControl_SetColorTemperature(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void back_key_down(char k) { (void)k; }


x86 assembly (clang, -O0):
<back_key_down>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @back_key_down(i8 signext %0) {
ret void
}
/* Variables and functions */
int constrain_int(int a, int min, int max) {
  if (a < min)
    return min;
  if (a > max)
    return max;
  return a;
}


x86 assembly (clang, -O0):
<constrain_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <constrain_int+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <constrain_int+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <constrain_int+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <constrain_int+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constrain_int>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @constrain_int(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %6
store i32 %12, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %21
19: ; preds = %13
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @constrain_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
size_t round_by(size_t a, size_t b) { return a - a % b; }


x86 assembly (clang, -O0):
<round_by>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_by>:
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1116 <round_by+0x16>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111c <round_by+0x1c>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @round_by(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
%9 = sub i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @round_by(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = sub i64 %0, %3
ret i64 %4
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_whence;
  int /*<<< orphan*/ l_type;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLKW;
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, struct flock *);
void my_lock(int fd) {
  struct flock lock;
  lock.l_type = F_WRLCK;
  lock.l_whence = SEEK_SET;
  lock.l_start = 0;
  lock.l_len = 0;
  fcntl(fd, F_SETLKW, &lock);
  return;
}


x86 assembly (clang, -O0):
<my_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_lock>:
sub    $0x18,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i64, i64, i32, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define void @my_lock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETLKW
%12 = call i32 @fcntl(i32 %10, i32 %11, %struct.flock* %3)
ret void
}

LLVM IR (-O2):
%struct.flock = type { i64, i64, i32, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLKW = global i32 0
define void @my_lock(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 2
store i32 %6, i32* %7
%8 = bitcast %struct.flock* %2 to i8*
%9 = load i32, i32* @F_SETLKW
%10 = call i32 @fcntl(i32 %0, i32 %9, %struct.flock* %2)
ret void
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int cmdline_parser2(int, char *const *, struct gengetopt_args_info *,
                    int /*<<< orphan*/, int);
int cmdline_parser(int argc, char *const *argv,
                   struct gengetopt_args_info *args_info) {
  return cmdline_parser2(argc, argv, args_info, 0, 1);
}


x86 assembly (clang, -O0):
<cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <cmdline_parser2@plt>

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

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
define i32 @cmdline_parser(i32 %0, i8** %1, %struct.gengetopt_args_info* %2) {
%4 = tail call i32 @cmdline_parser2(i32 %0, i8** %1, %struct.gengetopt_args_info* %2, i32 0, i32 1)
ret i32 %4
}
/* Variables and functions */
int isprime(long);
long nextprime(long num) {
  long x;
  int t;
  for (x = num;; ++x) {
    t = isprime(x);
    if (t == 1)
      return x;
  }
}


x86 assembly (clang, -O0):
<nextprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isprime@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1144 <nextprime+0x34>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1149 <nextprime+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <nextprime+0x14>

x86 assembly (clang, -O2):
<nextprime>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <isprime@plt>
add    $0x1,%rbx
cmp    $0x1,%eax
jne    1120 <nextprime+0x10>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @nextprime(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @isprime(i64 %3)
%5 = icmp eq i32 %4, 1
%6 = add nsw i64 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_map_to_pretty_name() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_map_to_pretty_name"
         "\n");
}


x86 assembly (clang, -O0):
<pa_channel_map_to_pretty_name>:
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):
<pa_channel_map_to_pretty_name>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_channel_map_to_pretty_name\00"
define i32 @pa_channel_map_to_pretty_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t writeuint32le(uint8_t arr[4], uint32_t v) {
  arr[0] = v & 255;
  v >>= 8;
  arr[1] = v & 255;
  v >>= 8;
  arr[2] = v & 255;
  v >>= 8;
  arr[3] = v & 255;
}


x86 assembly (clang, -O0):
<writeuint32le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeuint32le>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define i32 @writeuint32le(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %5
%11 = ashr i32 %10, 8
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = and i32 %12, 255
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32, i32* %5
%17 = ashr i32 %16, 8
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = and i32 %18, 255
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32, i32* %5
%23 = ashr i32 %22, 8
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = and i32 %24, 255
%26 = load i32*, i32** %4
%27 = getelementptr inbounds i32, i32* %26, i64 3
store i32 %25, i32* %27
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @writeuint32le(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = lshr i32 %1, 24
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret i32 undef
}
/* Variables and functions */
int ap_cmd_set_int(int, int, int);
int ap_jump_to(int session, int pos) {
  return (ap_cmd_set_int(session, 0xcc27, pos));
}


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

x86 assembly (clang, -O2):
<ap_jump_to>:
mov    %esi,%edx
mov    $0xcc27,%esi
jmp    1030 <ap_cmd_set_int@plt>

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

LLVM IR (-O2):
define i32 @ap_jump_to(i32 %0, i32 %1) {
%3 = tail call i32 @ap_cmd_set_int(i32 %0, i32 52263, i32 %1)
ret i32 %3
}
/* Variables and functions */
int f258(int *);
int f259(int *p) { return f258(p); }


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

x86 assembly (clang, -O2):
<f259>:
jmp    1030 <f258@plt>

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

LLVM IR (-O2):
define i32 @f259(i32* %0) {
%2 = tail call i32 @f258(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200] = {0};
  scanf("%s", word);
  printf("%ld", hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xc0(%rsp)
lea    0xe6b(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xe54(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = bitcast [200 x i8]* %2 to i8*
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%7 = call i32 @hash(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(int, int);
int main(void) {
  int x = 0xf;
  int n = 4;
  printf("0x%x\n", rightrot(x, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <rightrot@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
mov    $0x4,%esi
call   1040 <rightrot@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 @rightrot(i32 15, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int ft_toupper(int c) {
  if ('a' <= c && c <= 'z')
    return (c - 'a' + 'A');
  else
    return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1130 <ft_toupper+0x30>
cmpl   $0x7a,-0x8(%rbp)
jg     1130 <ft_toupper+0x30>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <ft_toupper+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = add nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int ENOMEM;
int /*<<< orphan*/ _unsupported();
int posix_memalign(void **memptr, size_t alignment, size_t size) {
  _unsupported();
  return ENOMEM;
}


x86 assembly (clang, -O0):
<posix_memalign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <_unsupported@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_memalign>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i32 @posix_memalign(i8** %0, i64 %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 (...) @_unsupported()
%8 = load i32, i32* @ENOMEM
ret i32 %8
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i32 @posix_memalign(i8** nocapture readnone %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @_unsupported()
%5 = load i32, i32* @ENOMEM
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateWakeSet(unsigned long ulWakeFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC010))) =
      (ulWakeFlags | ((*((volatile unsigned long *)(0x400FC010))) &
                      ~(0x00000010 | 0x00000008 | 0x00000200)));
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateWakeSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xfffffffffffffde7,%rax
or     %rax,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateWakeSet>:
mov    $0xfffffffffffffde7,%rax
and    0x400fc010,%rax
40
or     %rdi,%rax
mov    %rax,0x400fc010
40
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateWakeSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%5 = and i64 %4, -537
%6 = or i64 %3, %5
store volatile i64 %6, i64* inttoptr (i64 1074774032 to i64*)
%7 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateWakeSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = and i64 %2, -537
%4 = or i64 %3, %0
store volatile i64 %4, i64* inttoptr (i64 1074774032 to i64*)
%5 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bad(char *);
int /*<<< orphan*/ want(int);
need(int type) {
  if (!want(type))
    bad("Errore di sintassi");
}


x86 assembly (clang, -O0):
<need>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <want@plt>
cmp    $0x0,%eax
jne    1148 <need+0x28>
lea    0xebd(%rip),%rdi
call   1030 <bad@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<need>:
push   %rax
call   1040 <want@plt>
test   %eax,%eax
je     112c <need+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1030 <bad@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Errore di sintassi\00"
define i32 @need(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @want(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @bad(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [19 x i8] c"Errore di sintassi\00"
define i32 @need(i32 %0) {
%2 = tail call i32 @want(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @bad(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 undef
}
void av_base64_decode() {}


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

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

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

LLVM IR (-O2):
define void @av_base64_decode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ singloginit_();
int singloginitonce() {
  { singloginit_(); }
}


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

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

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

LLVM IR (-O2):
define i32 @singloginitonce() {
%1 = tail call i32 (...) @singloginit_()
ret i32 undef
}
void usb_qdss_close(struct usb_qdss_ch *ch) {}


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

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

LLVM IR (-O0):
%struct.usb_qdss_ch = type opaque
define void @usb_qdss_close(%struct.usb_qdss_ch* %0) {
%2 = alloca %struct.usb_qdss_ch*
store %struct.usb_qdss_ch* %0, %struct.usb_qdss_ch** %2
ret void
}

LLVM IR (-O2):
%struct.usb_qdss_ch = type opaque
define void @usb_qdss_close(%struct.usb_qdss_ch* nocapture %0) {
ret void
}
void ForceFaultSate(void) {}


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

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

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

LLVM IR (-O2):
define void @ForceFaultSate() {
ret void
}
int unlink(const char *pathname) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(pathname);
  return -1;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.unlink = [7 x i8] c"unlink\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.unlink, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load i8*, i8** %2
ret i32 -1
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.unlink = [7 x i8] c"unlink\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @unlink(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.unlink, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i32 -1
}