xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void parsecmd(void) { nocall("parsecmd"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"parsecmd\00"
define void @parsecmd() {
%1 = call i32 @nocall(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"parsecmd\00"
define void @parsecmd() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XSegment;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XSegment(void *_p) {
  if (_p == NULL)
    abort();
  free((XSegment *)_p);
}


x86 assembly (clang, -O0):
<free_XSegment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XSegment+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XSegment>:
test   %rdi,%rdi
je     112a <free_XSegment+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XSegment(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XSegment(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int rand();
int slach_rand_int_range_2(int min, int max) {
  return rand() % (max - min + 1) + min;
}


x86 assembly (clang, -O0):
<slach_rand_int_range_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slach_rand_int_range_2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @slach_rand_int_range_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @slach_rand_int_range_2(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int CHAR_BIT;
int ffsll(long long x) {
  for (unsigned i = 0; i < sizeof(x) * CHAR_BIT; i++)
    if ((x >> i) & 1)
      return i + 1;
  return 0;
}


x86 assembly (clang, -O0):
<ffsll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ec7(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
cmp    %rcx,%rax
jae    1162 <ffsll+0x62>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sar    %cl,%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     114f <ffsll+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <ffsll+0x69>
jmp    1154 <ffsll+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <ffsll+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsll>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rcx
test   %rcx,%rcx
je     112e <ffsll+0x2e>
shl    $0x3,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
bt     %rax,%rdi
jb     1131 <ffsll+0x31>
add    $0x1,%eax
cmp    %rax,%rcx
ja     1120 <ffsll+0x20>
xor    %eax,%eax
ret
add    $0x1,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @ffsll(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = load i32, i32* @CHAR_BIT
%9 = sext i32 %8 to i64
%10 = mul i64 8, %9
%11 = icmp ult i64 %7, %10
br i1 %11, label %12, label %26
12: ; preds = %5
%13 = load i64, i64* %3
%14 = load i32, i32* %4
%15 = zext i32 %14 to i64
%16 = ashr i64 %13, %15
%17 = and i64 %16, 1
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i32, i32* %4
%21 = add i32 %20, 1
store i32 %21, i32* %2
br label %27
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %4
%25 = add i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
store i32 0, i32* %2
br label %27
27: ; preds = %26, %19
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @ffsll(i64 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = sext i32 %2 to i64
%4 = shl nsw i64 %3, 3
%5 = icmp eq i32 %2, 0
br i1 %5, label %18, label %6
6: ; preds = %1, %14
%7 = phi i64 [ %16, %14 ], [ 0, %1 ]
%8 = shl nuw i64 1, %7
%9 = and i64 %8, %0
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = trunc i64 %7 to i32
%13 = add i32 %12, 1
br label %18
14: ; preds = %6
%15 = add nuw nsw i64 %7, 1
%16 = and i64 %15, 4294967295
%17 = icmp ugt i64 %4, %16
br i1 %17, label %6, label %18
18: ; preds = %14, %1, %11
%19 = phi i32 [ %13, %11 ], [ 0, %1 ], [ 0, %14 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ MIMEH_version();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int MIME_version(void) {
  fprintf(stderr, "ripMIME: %s\n", "200811050000");
  MIMEH_version();
  return 0;
}


x86 assembly (clang, -O0):
<MIME_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed2(%rip),%rdx
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <MIMEH_version@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MIME_version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xed5(%rip),%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <MIMEH_version@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"ripMIME: %s\0A\00"
@.str.1 = [13 x i8] c"200811050000\00"
define i32 @MIME_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @MIMEH_version()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"ripMIME: %s\0A\00"
@.str.1 = [13 x i8] c"200811050000\00"
define i32 @MIME_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @MIMEH_version()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ command_helpall();
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: brctl [commands]\n");
  printf("commands:\n");
  command_helpall();
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <command_helpall@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: brctl [commands]\0A\00"
@.str.1 = [11 x i8] c"commands:\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @command_helpall()
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Usage: brctl [commands]\00"
@str.2 = [10 x i8] c"commands:\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @command_helpall()
ret void
}
void add_voids(void *a, void *b) { *(int *)a += *(int *)b; }


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

x86 assembly (clang, -O2):
<add_voids>:
mov    (%rsi),%eax
add    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @add_voids(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
store i32 %7, i32* %5
ret void
}
void testfunc14(void) {
  char a;
  long int b;
  long int b2;
  double c;
  float d;
  long double e;
  a = (int)b;
  a = (int)(b + b2);
  a = b + b2;
  a = b++;
  if ((int)(b + b2)) {
  }
  a = c;
  c = b;
  d = c;
  d = e;
}


x86 assembly (clang, -O0):
<testfunc14>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
mov    %al,-0x1(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %al,-0x1(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %al,-0x1(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    %al,-0x1(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
cmp    $0x0,%eax
je     1149 <testfunc14+0x49>
jmp    1149 <testfunc14+0x49>
cvttsd2si -0x20(%rbp),%eax
mov    %al,-0x1(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
fldt   -0x40(%rbp)
fstps  -0x44(%rbp)
movss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testfunc14() {
%1 = alloca i8
%2 = alloca i64
%3 = alloca i64
%4 = alloca double
%5 = alloca float
%6 = alloca x86_fp80
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i64, i64* %2
%11 = load i64, i64* %3
%12 = add nsw i64 %10, %11
%13 = trunc i64 %12 to i32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %1
%15 = load i64, i64* %2
%16 = load i64, i64* %3
%17 = add nsw i64 %15, %16
%18 = trunc i64 %17 to i8
store i8 %18, i8* %1
%19 = load i64, i64* %2
%20 = add nsw i64 %19, 1
store i64 %20, i64* %2
%21 = trunc i64 %19 to i8
store i8 %21, i8* %1
%22 = load i64, i64* %2
%23 = load i64, i64* %3
%24 = add nsw i64 %22, %23
%25 = trunc i64 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %0
br label %28
28: ; preds = %27, %0
%29 = load double, double* %4
%30 = fptosi double %29 to i8
store i8 %30, i8* %1
%31 = load i64, i64* %2
%32 = sitofp i64 %31 to double
store double %32, double* %4
%33 = load double, double* %4
%34 = fptrunc double %33 to float
store float %34, float* %5
%35 = load x86_fp80, x86_fp80* %6
%36 = fptrunc x86_fp80 %35 to float
store float %36, float* %5
ret void
}

LLVM IR (-O2):
define void @testfunc14() {
ret void
}
const char *pl_get_type(void) {
  static const char *const type = "tfile";
  return type;
}


x86 assembly (clang, -O0):
<pl_get_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_get_type>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@pl_get_type.type = internal constant i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
@.str = [6 x i8] c"tfile\00"
define i8* @pl_get_type() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"tfile\00"
define i8* @pl_get_type() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
long __syscall1(long n, long a1) {
  unsigned long __ret;
  __asm__ __volatile__("xchg %%ebx,%%edx ; "
                       "call *%%gs:16"
                       " ; xchg %%ebx,%%edx"
                       : "=a"(__ret)
                       : "a"(n), "d"(a1)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
xchg   %edx,%ebx
call   *%gs:0x10
xchg   %edx,%ebx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall1>:
mov    %rsi,%rdx
mov    %rdi,%rax
xchg   %edx,%ebx
call   *%gs:0x10
xchg   %edx,%ebx
ret

LLVM IR (-O0):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "xchg %ebx,%edx ; call *%gs:16 ; xchg %ebx,%edx", "={ax},{ax},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "xchg %ebx,%edx ; call *%gs:16 ; xchg %ebx,%edx", "={ax},{ax},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
int funca() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @funca() {
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR51_get(void) { return U_WMRCORENONE_get("U_WMR51"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR51\00"
define i32 @U_WMR51_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR51\00"
define i32 @U_WMR51_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int isspace(int c) {
  if (c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v' ||
      c == ' ') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
je     1143 <isspace+0x43>
cmpl   $0xa,-0x8(%rbp)
je     1143 <isspace+0x43>
cmpl   $0xd,-0x8(%rbp)
je     1143 <isspace+0x43>
cmpl   $0x9,-0x8(%rbp)
je     1143 <isspace+0x43>
cmpl   $0xb,-0x8(%rbp)
je     1143 <isspace+0x43>
cmpl   $0x20,-0x8(%rbp)
jne    114f <isspace+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isspace+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 12, label %3
i32 11, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetCOMHWConfig(char x) {
  unsigned char d[] = {0xDA, 0x02};
  if (x)
    d[1] |= 0x10;
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetCOMHWConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xedb(%rip),%ax
mov    %ax,-0x3(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113d <SetCOMHWConfig+0x2d>
movzbl -0x2(%rbp),%eax
or     $0x10,%eax
mov    %al,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetCOMHWConfig>:
push   %rax
movw   $0x2da,0x6(%rsp)
test   %dil,%dil
je     1122 <SetCOMHWConfig+0x12>
movb   $0x12,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.SetCOMHWConfig.d = [2 x i8] c"\DA\02"
define void @SetCOMHWConfig(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %10, 16
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
br label %13
13: ; preds = %7, %1
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%15 = call i32 @oled_SendCommand(i8* %14, i32 2)
ret void
}

LLVM IR (-O2):
define void @SetCOMHWConfig(i8 signext %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 730, i16* %2
%4 = icmp eq i8 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = bitcast i16* %2 to [2 x i8]*
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
store i8 18, i8* %7
br label %8
8: ; preds = %5, %1
%9 = call i32 @oled_SendCommand(i8* %3, i32 2)
ret void
}
/* Type definitions */
struct hash_map {
  int dummy;
};

/* Variables and functions */
scalar_t__ hmap_find_member_int(struct hash_map const *, unsigned int);
int hmap_is_member_int(const struct hash_map *ht, unsigned int key) {
  if (hmap_find_member_int(ht, key))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<hmap_is_member_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <hmap_find_member_int@plt>
cmp    $0x0,%rax
je     1141 <hmap_is_member_int+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <hmap_is_member_int+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmap_is_member_int>:
push   %rax
call   1030 <hmap_find_member_int@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.hash_map = type { i32 }
define i32 @hmap_is_member_int(%struct.hash_map* %0, i32 %1) {
%3 = tail call i64 @hmap_find_member_int(%struct.hash_map* %0, i32 %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void op_nop(struct cpu_ctx *r, int mode, union inst_arg *arg) {}


x86 assembly (clang, -O0):
<op_nop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.cpu_ctx = type opaque
%union.inst_arg = type opaque
define void @op_nop(%struct.cpu_ctx* nocapture %0, i32 %1, %union.inst_arg* nocapture %2) {
ret void
}
/* Variables and functions */
scalar_t__ util_be_buf_to_dword(unsigned char *);
int util_be_buf4_to_int(unsigned char *buf) {
  return (int)util_be_buf_to_dword(buf);
}


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

x86 assembly (clang, -O2):
<util_be_buf4_to_int>:
jmp    1030 <util_be_buf_to_dword@plt>

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

LLVM IR (-O2):
define i32 @util_be_buf4_to_int(i8* %0) {
%2 = tail call i64 @util_be_buf_to_dword(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int noop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @noop() {
ret i32 0
}
int cmpint(const void *a, const void *b) { return *((int *)a) - *((int *)b); }


x86 assembly (clang, -O0):
<cmpint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpint>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @cmpint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
get_max_char(ref_n) int *ref_n;
{ *ref_n = 255; }


x86 assembly (clang, -O0):
<get_max_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0xff,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max_char>:
movl   $0xff,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @get_max_char(i32* nocapture writeonly %0) {
store i32 255, i32* %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t argv_count(char **argv) {
  int cnt = 0;
  assert(argv != NULL);
  while (*argv++)
    cnt++;
  return cnt;
}


x86 assembly (clang, -O0):
<argv_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     115c <argv_count+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <argv_count+0x25>
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argv_count>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
cmpq   $0x0,(%rbx)
je     1141 <argv_count+0x31>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rbx,%rcx,8)
mov    %rax,%rcx
jne    1130 <argv_count+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @argv_count(i8** %0) {
%2 = icmp ne i8** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %16, label %7
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ 0, %1 ]
%9 = phi i8** [ %10, %7 ], [ %0, %1 ]
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = add nuw nsw i32 %8, 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %7
14: ; preds = %7
%15 = zext i32 %11 to i64
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 0, %1 ], [ %15, %14 ]
ret i64 %17
}
int foo(int a, int b) {
  int x = a - 4;
  if (a < 4)
    return x;
  else
    return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1128 <foo+0x28>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112f <foo+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0x4(%rdi),%ecx
xor    %eax,%eax
cmp    $0x4,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 4
%4 = add nsw i32 %0, -4
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprime(int n1, float n2) {
  printf("*************************\n");
  printf("Número 1: %i\n", n1);
  printf("Número 2: %f\n", n2);
}


x86 assembly (clang, -O0):
<imprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %edi,%ebx
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb5(%rip),%rdi
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"*************************\0A\00"
@.str.1 = [15 x i8] c"N\C3\BAmero 1: %i\0A\00"
@.str.2 = [15 x i8] c"N\C3\BAmero 2: %f\0A\00"
define void @imprime(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"N\C3\BAmero 1: %i\0A\00"
@.str.2 = [15 x i8] c"N\C3\BAmero 2: %f\0A\00"
@str = [26 x i8] c"*************************\00"
define void @imprime(i32 %0, float %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = fpext float %1 to double
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %5)
ret void
}
void log_open() {}


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

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

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

LLVM IR (-O2):
define void @log_open() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void errmsg(char *msg) {
  printf(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<errmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errmsg>:
push   %rax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @errmsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @errmsg(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct demod_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ selcall_deinit(struct demod_state *);
void pzvei_deinit(struct demod_state *s) { selcall_deinit(s); }


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

x86 assembly (clang, -O2):
<pzvei_deinit>:
jmp    1030 <selcall_deinit@plt>

LLVM IR (-O0):
%struct.demod_state = type { i32 }
define void @pzvei_deinit(%struct.demod_state* %0) {
%2 = alloca %struct.demod_state*
store %struct.demod_state* %0, %struct.demod_state** %2
%3 = load %struct.demod_state*, %struct.demod_state** %2
%4 = call i32 @selcall_deinit(%struct.demod_state* %3)
ret void
}

LLVM IR (-O2):
%struct.demod_state = type { i32 }
define void @pzvei_deinit(%struct.demod_state* %0) {
%2 = tail call i32 @selcall_deinit(%struct.demod_state* %0)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};
struct cmsghdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ CMSG_DATA(struct cmsghdr const *);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void print_origdstaddr(const struct cmsghdr *c) {
  const struct sockaddr_in *sin = (const struct sockaddr_in *)CMSG_DATA(c);
  printf("IP_ORIGDSTADDR, {sa_family=AF_INET, sin_port=htons(%u)"
         ", sin_addr=inet_addr(\"127.0.0.1\")}",
         ntohs(sin->sin_port));
}


x86 assembly (clang, -O0):
<print_origdstaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CMSG_DATA@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <ntohs@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_origdstaddr>:
push   %rax
call   1030 <CMSG_DATA@plt>
mov    (%rax),%edi
call   1050 <ntohs@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.cmsghdr = type { i32 }
%struct.sockaddr_in = type { i32 }
@.str = [89 x i8] c"IP_ORIGDSTADDR, {sa_family=AF_INET, sin_port=htons(%u), sin_addr=inet_addr(\22127.0.0.1\22)}\00"
define void @print_origdstaddr(%struct.cmsghdr* %0) {
%2 = alloca %struct.cmsghdr*
%3 = alloca %struct.sockaddr_in*
store %struct.cmsghdr* %0, %struct.cmsghdr** %2
%4 = load %struct.cmsghdr*, %struct.cmsghdr** %2
%5 = call i64 @CMSG_DATA(%struct.cmsghdr* %4)
%6 = inttoptr i64 %5 to %struct.sockaddr_in*
store %struct.sockaddr_in* %6, %struct.sockaddr_in** %3
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @ntohs(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
%struct.cmsghdr = type { i32 }
%struct.sockaddr_in = type { i32 }
@.str = [89 x i8] c"IP_ORIGDSTADDR, {sa_family=AF_INET, sin_port=htons(%u), sin_addr=inet_addr(\22127.0.0.1\22)}\00"
define void @print_origdstaddr(%struct.cmsghdr* %0) {
%2 = tail call i64 @CMSG_DATA(%struct.cmsghdr* %0)
%3 = inttoptr i64 %2 to %struct.sockaddr_in*
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @ntohs(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
int test_imm_34uint16_reg(unsigned short val) {
  return ((val) & (0x34 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_34uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x34,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_34uint16_reg>:
test   $0x34,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_34uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 52
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *very_ugly_ipv6_code(char *, int, int /*<<< orphan*/);
char *subnet6_id(char *ip, int bitmask) {
  return very_ugly_ipv6_code(ip, bitmask, 0);
}


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

x86 assembly (clang, -O2):
<subnet6_id>:
xor    %edx,%edx
jmp    1030 <very_ugly_ipv6_code@plt>

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

LLVM IR (-O2):
define i8* @subnet6_id(i8* %0, i32 %1) {
%3 = tail call i8* @very_ugly_ipv6_code(i8* %0, i32 %1, i32 0)
ret i8* %3
}
int Int__MINUS_(int x, int y) { return x - y; }


x86 assembly (clang, -O0):
<Int__MINUS_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int__MINUS_>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @Int__MINUS_(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Int__MINUS_(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ switcher(char);
int main(int argc, char *argv[]) {
  if (argc == 2) {
    switcher(argv[1][0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1140 <main+0x30>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%edi
call   1030 <switcher@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1126 <main+0x16>
push   %rax
mov    0x8(%rsi),%rax
movsbl (%rax),%edi
call   1030 <switcher@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = tail call i32 @switcher(i8 signext %7)
br label %9
9: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Prt(char *, int, int);
void bi__display_commands() {
  Prt(("You may:"), (21) - 1, (1) - 1);
  Prt((" i) Insure an item.          a) Insure all items."), (22) - 1, (1) - 1);
  Prt((" e) Insure all equipment.    p) Insure person."), (23) - 1, (1) - 1);
  Prt(("^R) Redraw the screen.     Esc) Exit from building."), (24) - 1,
      (1) - 1);
}


x86 assembly (clang, -O0):
<bi__display_commands>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
xor    %edx,%edx
call   1030 <Prt@plt>
lea    0xedb(%rip),%rdi
mov    $0x15,%esi
xor    %edx,%edx
call   1030 <Prt@plt>
lea    0xefa(%rip),%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1030 <Prt@plt>
lea    0xf16(%rip),%rdi
mov    $0x17,%esi
xor    %edx,%edx
call   1030 <Prt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bi__display_commands>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x14,%esi
xor    %edx,%edx
call   1030 <Prt@plt>
lea    0xede(%rip),%rdi
mov    $0x15,%esi
xor    %edx,%edx
call   1030 <Prt@plt>
lea    0xefd(%rip),%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1030 <Prt@plt>
lea    0xf19(%rip),%rdi
mov    $0x17,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <Prt@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"You may:\00"
@.str.1 = [50 x i8] c" i) Insure an item. a) Insure all items.\00"
@.str.2 = [47 x i8] c" e) Insure all equipment. p) Insure person.\00"
@.str.3 = [52 x i8] c"^R) Redraw the screen. Esc) Exit from building.\00"
define void @bi__display_commands() {
%1 = call i32 @Prt(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 20, i32 0)
%2 = call i32 @Prt(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 21, i32 0)
%3 = call i32 @Prt(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 22, i32 0)
%4 = call i32 @Prt(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 23, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"You may:\00"
@.str.1 = [50 x i8] c" i) Insure an item. a) Insure all items.\00"
@.str.2 = [47 x i8] c" e) Insure all equipment. p) Insure person.\00"
@.str.3 = [52 x i8] c"^R) Redraw the screen. Esc) Exit from building.\00"
define void @bi__display_commands() {
%1 = tail call i32 @Prt(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 20, i32 0)
%2 = tail call i32 @Prt(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 21, i32 0)
%3 = tail call i32 @Prt(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 22, i32 0)
%4 = tail call i32 @Prt(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 23, i32 0)
ret void
}
int cube_by_value(int n) { return n * n * n; }


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

x86 assembly (clang, -O2):
<cube_by_value>:
mov    %edi,%eax
imul   %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cube_by_value(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
int check_routing(struct sip_msg *, int);
int allow_routing_1(struct sip_msg *msg, char *basename, char *s) {
  return check_routing(msg, (int)(long)basename);
}


x86 assembly (clang, -O0):
<allow_routing_1>:
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),%rax
mov    %eax,%esi
call   1030 <check_routing@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allow_routing_1>:
jmp    1030 <check_routing@plt>

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
define i32 @allow_routing_1(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sip_msg*
%5 = alloca i8*
%6 = alloca i8*
store %struct.sip_msg* %0, %struct.sip_msg** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.sip_msg*, %struct.sip_msg** %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = call i32 @check_routing(%struct.sip_msg* %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @allow_routing_1(%struct.sip_msg* %0, i8* %1, i8* nocapture readnone %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @check_routing(%struct.sip_msg* %0, i32 %5)
ret i32 %6
}
double AreaTrapezio(double dx, double h1, double h2) {
  return (dx * (h1 + h2) / 2);
}


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

x86 assembly (clang, -O2):
<AreaTrapezio>:
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  0xef0(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @AreaTrapezio(double %0, double %1, double %2) {
%4 = fadd double %1, %2
%5 = fmul double %4, %0
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[7] = {1, 2, 1, 3, 1, 2, 1}, i, res = 0;
  for (i = 0; i < 7; i++)
    res ^= a[i];
  printf("%d", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    117d <main+0x6d>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
xor    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <main+0x47>
mov    -0x28(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
void foo540(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo540(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printhello() { printf("Helloworld\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Helloworld\0A\00"
define void @printhello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"Helloworld\00"
define void @printhello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
void mouseb_report_driver_all(char *s, unsigned size) { *s = 0; }


x86 assembly (clang, -O0):
<mouseb_report_driver_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouseb_report_driver_all>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mouseb_report_driver_all(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
ret void
}