xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char readb(long);
unsigned char inb(long address) {
  readb((void *)(address & 0xffffff00) + 0x40);
  return readb(address);
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0xffffff00,%rdi
and    -0x8(%rbp),%rdi
add    $0x40,%rdi
call   1030 <readb@plt>
mov    -0x8(%rbp),%rdi
call   1030 <readb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
push   %rbx
mov    %rdi,%rbx
and    $0xffffff00,%edi
or     $0x40,%rdi
call   1030 <readb@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <readb@plt>

LLVM IR (-O0):
define zeroext i8 @inb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4294967040
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr i8, i8* %5, i64 64
%7 = ptrtoint i8* %6 to i64
%8 = call zeroext i8 @readb(i64 %7)
%9 = load i64, i64* %2
%10 = call zeroext i8 @readb(i64 %9)
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @inb(i64 %0) {
%2 = and i64 %0, 4294967040
%3 = inttoptr i64 %2 to i8*
%4 = getelementptr i8, i8* %3, i64 64
%5 = ptrtoint i8* %4 to i64
%6 = tail call zeroext i8 @readb(i64 %5)
%7 = tail call zeroext i8 @readb(i64 %0)
ret i8 %7
}
/* Variables and functions */
int PTHREAD_MUTEX_RECURSIVE;
void test_PTHREAD_MUTEX_RECURSIVE(void) {
  int dummy = PTHREAD_MUTEX_RECURSIVE;
  (void)dummy;
}


x86 assembly (clang, -O0):
<test_PTHREAD_MUTEX_RECURSIVE>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define void @test_PTHREAD_MUTEX_RECURSIVE() {
%1 = alloca i32
%2 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret void
}

LLVM IR (-O2):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define void @test_PTHREAD_MUTEX_RECURSIVE() {
ret void
}
/* Variables and functions */
int USART_Available();
int usbBytesAvailable();
int CharAvailable(void) {
  if (usbBytesAvailable()) {
    return usbBytesAvailable();
  } else {
    return USART_Available();
  }
}


x86 assembly (clang, -O0):
<CharAvailable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <usbBytesAvailable@plt>
cmp    $0x0,%eax
je     1147 <CharAvailable+0x27>
mov    $0x0,%al
call   1040 <usbBytesAvailable@plt>
mov    %eax,-0x4(%rbp)
jmp    1151 <CharAvailable+0x31>
mov    $0x0,%al
call   1030 <USART_Available@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharAvailable>:
push   %rax
xor    %eax,%eax
call   1040 <usbBytesAvailable@plt>
test   %eax,%eax
je     1134 <CharAvailable+0x14>
xor    %eax,%eax
pop    %rcx
jmp    1040 <usbBytesAvailable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <USART_Available@plt>

LLVM IR (-O0):
define i32 @CharAvailable() {
%1 = alloca i32
%2 = call i32 (...) @usbBytesAvailable()
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @usbBytesAvailable()
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 (...) @USART_Available()
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @CharAvailable() {
%1 = tail call i32 (...) @usbBytesAvailable()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @usbBytesAvailable()
br label %7
5: ; preds = %0
%6 = tail call i32 (...) @USART_Available()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n");
  printf("You don't have <math.h>\n");
  printf("You don't have <foobar.h>\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [25 x i8] c"You don't have <math.h>\0A\00"
@.str.2 = [27 x i8] c"You don't have <foobar.h>\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
@str.3 = [24 x i8] c"You don't have <math.h>\00"
@str.4 = [26 x i8] c"You don't have <foobar.h>\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int addline(int);
indent(void) { return (addline(1)); }


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <addline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
mov    $0x1,%edi
jmp    1030 <addline@plt>

LLVM IR (-O0):
define i32 @indent() {
%1 = call i32 @addline(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @indent() {
%1 = tail call i32 @addline(i32 1)
ret i32 %1
}
int f(int *foo) {
  int x = 10;
  switch (*foo) {
  case 0:
    x = 5;
    break;
  case 3:
    x = 6;
    break;
  case 4:
    x = 6;
  case 5:
    x = 6;
    break;
  case 7:
    x = 0;
    break;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
sub    $0x7,%rax
ja     1169 <f+0x69>
mov    -0x18(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5,-0xc(%rbp)
jmp    1169 <f+0x69>
movl   $0x6,-0xc(%rbp)
jmp    1169 <f+0x69>
movl   $0x6,-0xc(%rbp)
movl   $0x6,-0xc(%rbp)
jmp    1169 <f+0x69>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq (%rdi),%rcx
mov    $0xa,%eax
cmp    $0x7,%rcx
ja     1118 <f+0x18>
lea    0xeeb(%rip),%rax
mov    (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 10, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
switch i32 %5, label %11 [
i32 0, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 7, label %10
]
6: ; preds = %1
store i32 5, i32* %3
br label %11
7: ; preds = %1
store i32 6, i32* %3
br label %11
8: ; preds = %1
store i32 6, i32* %3
br label %9
9: ; preds = %1, %8
store i32 6, i32* %3
br label %11
10: ; preds = %1
store i32 0, i32* %3
br label %11
11: ; preds = %1, %10, %9, %7, %6
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@switch.table.f = [8 x i32] [i32 5, i32 10, i32 10, i32 6, i32 6, i32 6, i32 10, i32 0]
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.f, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 10, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char *arvg[]) { abort(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
double calc_sin_TrueAnom(double EccAnom, double ecc) {
  return sqrt(1. - ((ecc) * (ecc))) * sin(EccAnom) / (1. - ecc * cos(EccAnom));
}


x86 assembly (clang, -O0):
<calc_sin_TrueAnom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe91(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe24(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sin_TrueAnom>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
movapd 0xebe(%rip),%xmm0
xorpd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
mulsd  %xmm1,%xmm1
movsd  0xeb8(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116c <calc_sin_TrueAnom+0x3c>
sqrtsd %xmm0,%xmm0
jmp    1171 <calc_sin_TrueAnom+0x41>
call   1050 <sqrt@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movapd 0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xe68(%rip),%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @calc_sin_TrueAnom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = fneg double %5
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
%9 = call double @sqrt(double %8)
%10 = load double, double* %3
%11 = call double @sin(double %10)
%12 = fmul double %9, %11
%13 = load double, double* %4
%14 = load double, double* %3
%15 = call double @cos(double %14)
%16 = fneg double %13
%17 = call double @llvm.fmuladd.f64(double %16, double %15, double 1.000000e+00)
%18 = fdiv double %12, %17
ret double %18
}

LLVM IR (-O2):
define double @calc_sin_TrueAnom(double %0, double %1) {
%3 = fneg double %1
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double 1.000000e+00)
%5 = tail call double @sqrt(double %4)
%6 = tail call double @sin(double %0)
%7 = fmul double %5, %6
%8 = tail call double @cos(double %0)
%9 = tail call double @llvm.fmuladd.f64(double %3, double %8, double 1.000000e+00)
%10 = fdiv double %7, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ PR_SET_PDEATHSIG;
int getppid();
scalar_t__ prctl(int /*<<< orphan*/, int);
int /*<<< orphan*/ raise(int);
int /*<<< orphan*/ xerror(char *);
void xset_pdeathsig(int signum) {
  if (prctl(PR_SET_PDEATHSIG, signum) != 0)
    xerror("prctl: PR_SET_PDEATHSIG");
  if (getppid() == 1)
    raise(signum);
}


x86 assembly (clang, -O0):
<xset_pdeathsig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1050 <prctl@plt>
cmp    $0x0,%rax
je     1172 <xset_pdeathsig+0x32>
lea    0xe93(%rip),%rdi
call   1040 <xerror@plt>
mov    $0x0,%al
call   1060 <getppid@plt>
cmp    $0x1,%eax
jne    118a <xset_pdeathsig+0x4a>
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xset_pdeathsig>:
push   %rbx
mov    %edi,%ebx
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    %ebx,%esi
call   1050 <prctl@plt>
test   %rax,%rax
je     1164 <xset_pdeathsig+0x24>
lea    0xea1(%rip),%rdi
call   1040 <xerror@plt>
xor    %eax,%eax
call   1060 <getppid@plt>
cmp    $0x1,%eax
jne    1178 <xset_pdeathsig+0x38>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <raise@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@PR_SET_PDEATHSIG = global i32 0
@.str = [24 x i8] c"prctl: PR_SET_PDEATHSIG\00"
define void @xset_pdeathsig(i32 %0) {
%2 = load i32, i32* @PR_SET_PDEATHSIG
%3 = tail call i64 @prctl(i32 %2, i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @xerror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = tail call i32 (...) @getppid()
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @raise(i32 %0)
br label %12
12: ; preds = %10, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clog_write(int *, char *);
void CLOG_WRITE__(int *clen, char *c) { clog_write(clen, c); }


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

x86 assembly (clang, -O2):
<CLOG_WRITE__>:
jmp    1030 <clog_write@plt>

LLVM IR (-O0):
define void @CLOG_WRITE__(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 @clog_write(i32* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @CLOG_WRITE__(i32* %0, i8* %1) {
%3 = tail call i32 @clog_write(i32* %0, i8* %1)
ret void
}
/* Type definitions */
struct bpf_sock_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __sock4_xlate_fwd(struct bpf_sock_addr *);
__attribute__((section("connect4"), used)) int
sock4_connect(struct bpf_sock_addr *ctx) {
  __sock4_xlate_fwd(ctx);
  return 1;
}


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

x86 assembly (clang, -O2):
<sock4_connect>:
push   %rax
call   1030 <__sock4_xlate_fwd@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bpf_sock_addr = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.bpf_sock_addr*)* @sock4_connect to i8*)], section "llvm.metadata"
define i32 @sock4_connect(%struct.bpf_sock_addr* %0) section "connect4" {
%2 = alloca %struct.bpf_sock_addr*
store %struct.bpf_sock_addr* %0, %struct.bpf_sock_addr** %2
%3 = load %struct.bpf_sock_addr*, %struct.bpf_sock_addr** %2
%4 = call i32 @__sock4_xlate_fwd(%struct.bpf_sock_addr* %3)
ret i32 1
}

LLVM IR (-O2):
%struct.bpf_sock_addr = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.bpf_sock_addr*)* @sock4_connect to i8*)], section "llvm.metadata"
define i32 @sock4_connect(%struct.bpf_sock_addr* %0) section "connect4" {
%2 = tail call i32 @__sock4_xlate_fwd(%struct.bpf_sock_addr* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ g();
int f(int i) {
  if (i & 0x0ffff000)
    g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff000,%eax
cmp    $0x0,%eax
je     1133 <f+0x23>
mov    $0x0,%al
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   $0xffff000,%edi
je     1124 <f+0x14>
push   %rax
xor    %eax,%eax
call   1030 <g@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 268431360
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @g()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 268431360
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @g()
br label %6
6: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
char *ptr_after_char(char const *, char);
const char *sp_parse_file_name(const char *filename) {
  const char *ptr = ptr_after_char(filename, '/');
  return ptr ? ptr : filename;
}


x86 assembly (clang, -O0):
<sp_parse_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <ptr_after_char@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <sp_parse_file_name+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114e <sp_parse_file_name+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_parse_file_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <ptr_after_char@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @sp_parse_file_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @ptr_after_char(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
br label %12
10: ; preds = %1
%11 = load i8*, i8** %2
br label %12
12: ; preds = %10, %8
%13 = phi i8* [ %9, %8 ], [ %11, %10 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @sp_parse_file_name(i8* %0) {
%2 = tail call i8* @ptr_after_char(i8* %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ serror(char *);
badsyntax() { serror("bad operands"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"bad operands\00"
define i32 @badsyntax() {
%1 = alloca i32
%2 = call i32 @serror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"bad operands\00"
define i32 @badsyntax() {
%1 = tail call i32 @serror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ addFD(int, char *);
int /*<<< orphan*/ dropTrSuite();
int /*<<< orphan*/ messErr(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void lectFic(char *L) {
  int fd;
  dropTrSuite();
  if ((fd = open(L, O_RDONLY)) == -1) {
    perror(L);
    messErr(16);
  } else
    addFD(fd, L);
}


x86 assembly (clang, -O0):
<lectFic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dropTrSuite@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1199 <lectFic+0x49>
mov    -0x8(%rbp),%rdi
call   1070 <perror@plt>
mov    $0x10,%edi
call   1030 <messErr@plt>
jmp    11a5 <lectFic+0x55>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <addFD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lectFic>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dropTrSuite@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1060 <open@plt>
cmp    $0xffffffff,%eax
je     117c <lectFic+0x2c>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <addFD@plt>
mov    %rbx,%rdi
call   1070 <perror@plt>
mov    $0x10,%edi
pop    %rbx
jmp    1030 <messErr@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
define void @lectFic(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @dropTrSuite()
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @perror(i8* %10)
%12 = call i32 @messErr(i32 16)
br label %17
13: ; preds = %1
%14 = load i32, i32* %3
%15 = load i8*, i8** %2
%16 = call i32 @addFD(i32 %14, i8* %15)
br label %17
17: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define void @lectFic(i8* %0) {
%2 = tail call i32 (...) @dropTrSuite()
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* %0, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @messErr(i32 16)
br label %11
9: ; preds = %1
%10 = tail call i32 @addFD(i32 %4, i8* %0)
br label %11
11: ; preds = %9, %6
ret void
}
void gdk_drawable_get_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drawable_get_colormap() {
ret void
}
int toascii(int c) { return c; }


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

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

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

LLVM IR (-O2):
define i32 @toascii(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fclose(int /*<<< orphan*/ *);
bool close_2(FILE *this, void *unused) {
  if (this != NULL)
    return fclose(this) == 0;
  else
    return true;
}


x86 assembly (clang, -O0):
<close_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <close_2+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    114f <close_2+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_2>:
test   %rdi,%rdi
je     112b <close_2+0x1b>
push   %rax
call   1030 <fclose@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @close_2(i32* %0, i8* nocapture readnone %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @fclose(i32* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int strnlen(const char *s, size_t count) {
  const char *sc;
  for (sc = s; count-- && *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1168 <strnlen+0x68>
jmp    1157 <strnlen+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %19, %2
%8 = load i64, i64* %4
%9 = add i64 %8, -1
store i64 %9, i64* %4
%10 = icmp ne i64 %8, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %11, %7
%17 = phi i1 [ false, %7 ], [ %15, %11 ]
br i1 %17, label %18, label %22
18: ; preds = %16
br label %19
19: ; preds = %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
br label %7
22: ; preds = %16
%23 = load i8*, i8** %5
%24 = load i8*, i8** %3
%25 = ptrtoint i8* %23 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
%28 = trunc i64 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
ret i32 %20
}
isxdigit(c) register int c;
{ return (isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f')); }


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1173 <isxdigit+0x63>
mov    $0x41,%eax
cmp    -0x4(%rbp),%eax
jg     1150 <isxdigit+0x40>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1173 <isxdigit+0x63>
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     116d <isxdigit+0x5d>
cmpl   $0x66,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isdigit(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 65, %7
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 70
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sle i32 97, %13
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 102
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int calc(char **);
int calculate(char *s) { return calc(&s); }


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

x86 assembly (clang, -O2):
<calculate>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <calc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @calculate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @calc(i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @calculate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @calc(i8** %2)
ret i32 %3
}
void f1(void) {
  int e1;
  char *el;
  int alphabet;
  int *Alphabet;
  int alphabet1soup;
  int *alphabetlsoup;
  int lcase;
  {
    int e1;
    int a1phabet;
    char *lcAse;
    int s52;
    int sS2;
    int s5Z;
    int numO;
    int num0;
  }
}


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

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
/* Variables and functions */
double askForScores(int);
int askNumberOfCourses();
int close();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hi man");
  puts("I can help you calculate your GPA");
  int number_of_courses;
  number_of_courses = askNumberOfCourses();
  double gp = askForScores(number_of_courses);
  printf("\nYour GPA is %.2f\n\n", gp);
  return close();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1070 <askNumberOfCourses@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <askForScores@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <askNumberOfCourses@plt>
mov    %eax,%edi
call   1040 <askForScores@plt>
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <close@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Hi man\00"
@.str.1 = [34 x i8] c"I can help you calculate your GPA\00"
@.str.2 = [20 x i8] c"\0AYour GPA is %.2f\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @askNumberOfCourses()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call double @askForScores(i32 %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = call i32 (...) @close()
ret i32 %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hi man\00"
@.str.1 = [34 x i8] c"I can help you calculate your GPA\00"
@.str.2 = [20 x i8] c"\0AYour GPA is %.2f\0A\0A\00"
define i32 @main() {
%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 ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @askNumberOfCourses()
%4 = tail call double @askForScores(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %4)
%6 = tail call i32 (...) @close()
ret i32 %6
}
int pneigh_refcnt_dec_and_test(struct pneigh_entry *pneigh) { return 1; }


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

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

LLVM IR (-O0):
%struct.pneigh_entry = type opaque
define i32 @pneigh_refcnt_dec_and_test(%struct.pneigh_entry* %0) {
%2 = alloca %struct.pneigh_entry*
store %struct.pneigh_entry* %0, %struct.pneigh_entry** %2
ret i32 1
}

LLVM IR (-O2):
%struct.pneigh_entry = type opaque
define i32 @pneigh_refcnt_dec_and_test(%struct.pneigh_entry* nocapture readnone %0) {
ret i32 1
}
const char *ccnxControlAPIAbout_LongNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\nLicensed under the "
         "Apache License, Version 2.0 (the \"License\");\nyou may not use this "
         "file except in compliance with the License.\nYou may obtain a copy "
         "of the License at:\n\n    "
         "http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by "
         "applicable law or agreed to in writing, software\ndistributed under "
         "the License is distributed on an \"AS IS\" BASIS,\nWITHOUT "
         "WARRANTIES OR CONDITIONS OF ANY KIND, either express or "
         "implied.\nSee the License for the specific language governing "
         "permissions and\nlimitations under the License.\n";
}


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

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

LLVM IR (-O0):
@.str = [574 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0ALicensed under the Apache License, Version 2.0 (the \22License\22);\0Ayou may not use this file except in compliance with the License.\0AYou may obtain a copy of the License at:\0A\0A http://www.apache.org/licenses/LICENSE-2.0\0A\0AUnless required by applicable law or agreed to in writing, software\0Adistributed under the License is distributed on an \22AS IS\22 BASIS,\0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\0ASee the License for the specific language governing permissions and\0Alimitations under the License.\0A\00"
define i8* @ccnxControlAPIAbout_LongNotice() {
ret i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [574 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0ALicensed under the Apache License, Version 2.0 (the \22License\22);\0Ayou may not use this file except in compliance with the License.\0AYou may obtain a copy of the License at:\0A\0A http://www.apache.org/licenses/LICENSE-2.0\0A\0AUnless required by applicable law or agreed to in writing, software\0Adistributed under the License is distributed on an \22AS IS\22 BASIS,\0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\0ASee the License for the specific language governing permissions and\0Alimitations under the License.\0A\00"
define i8* @ccnxControlAPIAbout_LongNotice() {
ret i8* getelementptr inbounds ([574 x i8], [574 x i8]* @.str, i64 0, i64 0)
}
unsigned long int unsignedlongint_ignoring_longlong(unsigned long int x,
                                                    long long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlongint_ignoring_longlong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlongint_ignoring_longlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_longlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ book_probe();
void cmd_bookp(void) { book_probe(); }


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

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

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

LLVM IR (-O2):
define void @cmd_bookp() {
%1 = tail call i32 (...) @book_probe()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _IOFBF;
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           size_t);
void setbuffer(FILE *stream, char *buf, size_t n) {
  (void)setvbuf(stream, buf, buf != NULL ? _IOFBF : _IONBF, n);
}


x86 assembly (clang, -O0):
<setbuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <setbuffer+0x40>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
jmp    115c <setbuffer+0x4c>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <setvbuf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuffer>:
mov    %rdx,%rcx
test   %rsi,%rsi
jne    1126 <setbuffer+0x16>
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <setvbuf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOFBF = global i32 0
@_IONBF = global i32 0
define void @setbuffer(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* @_IOFBF
br label %15
13: ; preds = %3
%14 = load i32, i32* @_IONBF
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
%17 = load i64, i64* %6
%18 = call i32 @setvbuf(i32* %7, i8* %8, i32 %16, i64 %17)
ret void
}

LLVM IR (-O2):
@_IOFBF = global i32 0
@_IONBF = global i32 0
define void @setbuffer(i32* nocapture %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
%5 = load i32, i32* @_IOFBF
%6 = load i32, i32* @_IONBF
%7 = select i1 %4, i32 %6, i32 %5
%8 = tail call i32 @setvbuf(i32* %0, i8* %1, i32 %7, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int aa_random(double rnd) {
  int aa;
  assert(rnd >= 0.0);
  assert(rnd <= 1.0);
  aa = (int)(20.0 * rnd);
  if (aa == 20)
    aa = 19;
  return aa;
}


x86 assembly (clang, -O0):
<aa_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xeca(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  0xea8(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jne    1175 <aa_random+0x65>
movl   $0x13,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_random>:
push   %rax
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
setae  %dil
call   1030 <assert@plt>
movsd  0xecf(%rip),%xmm0
xor    %edi,%edi
ucomisd (%rsp),%xmm0
setae  %dil
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
mulsd  0xeba(%rip),%xmm0
cvttsd2si %xmm0,%ecx
cmp    $0x14,%ecx
mov    $0x13,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @aa_random(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp oge double %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load double, double* %2
%9 = fcmp ole double %8, 1.000000e+00
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load double, double* %2
%13 = fmul double 2.000000e+01, %12
%14 = fptosi double %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 20
br i1 %16, label %17, label %18
17: ; preds = %1
store i32 19, i32* %3
br label %18
18: ; preds = %17, %1
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @aa_random(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = fcmp ole double %0, 1.000000e+00
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = fmul double %0, 2.000000e+01
%9 = fptosi double %8 to i32
%10 = icmp eq i32 %9, 20
%11 = select i1 %10, i32 19, i32 %9
ret i32 %11
}
int xmlUCSIsCatCc(int code) {
  return (((code >= 0x0) && (code <= 0x1f)) ||
          ((code >= 0x7f) && (code <= 0x9f)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCatCc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <xmlUCSIsCatCc+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1142 <xmlUCSIsCatCc+0x42>
xor    %eax,%eax
cmpl   $0x7f,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     113c <xmlUCSIsCatCc+0x3c>
cmpl   $0x9f,-0x4(%rbp)
setle  %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):
<xmlUCSIsCatCc>:
cmp    $0x20,%edi
setb   %al
add    $0xffffff81,%edi
cmp    $0x21,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsCatCc(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = add i32 %0, -127
%4 = icmp ult i32 %3, 33
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sqlen(double *);
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vscale(double *, int);
void vnorm(double v1[3]) {
  double a = sqrt(sqlen(v1));
  vscale(v1, 1. / a);
}


x86 assembly (clang, -O0):
<vnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sqlen@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xea3(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
call   1040 <vscale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnorm>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sqlen@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
movsd  0xeb8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vscale@plt>

LLVM IR (-O0):
define void @vnorm(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = call i32 @sqlen(double* %4)
%6 = call double @sqrt(i32 %5)
store double %6, double* %3
%7 = load double*, double** %2
%8 = load double, double* %3
%9 = fdiv double 1.000000e+00, %8
%10 = fptosi double %9 to i32
%11 = call i32 @vscale(double* %7, i32 %10)
ret void
}

LLVM IR (-O2):
define void @vnorm(double* %0) {
%2 = tail call i32 @sqlen(double* %0)
%3 = tail call double @sqrt(i32 %2)
%4 = fdiv double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = tail call i32 @vscale(double* %0, i32 %5)
ret void
}
/* Type definitions */
struct context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct context *);
int /*<<< orphan*/ context_teardown(struct context *);
int /*<<< orphan*/ free(struct context *);
void context_free(struct context *cxt) {
  assert(cxt);
  context_teardown(cxt);
  free(cxt);
}


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

x86 assembly (clang, -O2):
<context_free>:
push   %rbx
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <context_teardown@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.context = type { i32 }
define void @context_free(%struct.context* %0) {
%2 = alloca %struct.context*
store %struct.context* %0, %struct.context** %2
%3 = load %struct.context*, %struct.context** %2
%4 = call i32 @assert(%struct.context* %3)
%5 = load %struct.context*, %struct.context** %2
%6 = call i32 @context_teardown(%struct.context* %5)
%7 = load %struct.context*, %struct.context** %2
%8 = call i32 @free(%struct.context* %7)
ret void
}

LLVM IR (-O2):
%struct.context = type { i32 }
define void @context_free(%struct.context* %0) {
%2 = tail call i32 @assert(%struct.context* %0)
%3 = tail call i32 @context_teardown(%struct.context* %0)
%4 = tail call i32 @free(%struct.context* %0)
ret void
}
void d2i_RSAPublicKey(void) {}


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

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

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

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