xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xf9() {
  Assert_real((isupper(249) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1250, ("isupper should be 0 for 0xf9"));
}


x86 assembly (clang, -O0):
<t_isupper_0xf9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf9,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4e2,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xf9>:
push   %rax
mov    $0xf9,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4e2,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf9\00"
define void @t_isupper_0xf9() {
%1 = call i64 @isupper(i32 249)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1250, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xf9\00"
define void @t_isupper_0xf9() {
%1 = tail call i64 @isupper(i32 249)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1250, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int clz(unsigned long long x) {
  if (__builtin_clzll(x))
    return x;
  return -1;
}


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
bsr    %rax,%rax
xor    $0x3f,%rax
cmp    $0x0,%eax
je     1129 <clz+0x29>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1130 <clz+0x30>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
test   %rdi,%rdi
mov    $0xffffffff,%eax
cmovns %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clz(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = trunc i64 %0 to i32
%4 = select i1 %2, i32 -1, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int main(int argc, char *argv[]) {
  char s[128];
  gets(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x88,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int(int what) {
  printf("We have received SIGINT: Continuing Anyway, Boss.\n");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"We have received SIGINT: Continuing Anyway, Boss.\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [50 x i8] c"We have received SIGINT: Continuing Anyway, Boss.\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret void
}
void pre_assignment() {}


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

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

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

LLVM IR (-O2):
define void @pre_assignment() {
ret void
}
int f1(int x, int y) {
  asm volatile("" : : : "memory");
  bar();
}


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

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

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

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 (...) @bar()
ret i32 undef
}
/* Variables and functions */
char const *softc_private_uuidgen();
const char *softc_uuidgen() { return softc_private_uuidgen(); }


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

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

LLVM IR (-O0):
define i8* @softc_uuidgen() {
%1 = call i8* (...) @softc_private_uuidgen()
ret i8* %1
}

LLVM IR (-O2):
define i8* @softc_uuidgen() {
%1 = tail call i8* (...) @softc_private_uuidgen()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ mtu;

/* Variables and functions */
int /*<<< orphan*/ IP_MTU_DISCOVER;
int IP_PMTUDISC_DONT;
int /*<<< orphan*/ SOL_IP;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void set_mtu_disc_dont(int fd) {
  int mtu = IP_PMTUDISC_DONT;
  setsockopt(fd, SOL_IP, IP_MTU_DISCOVER, &mtu, sizeof(mtu));
}


x86 assembly (clang, -O0):
<set_mtu_disc_dont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mtu_disc_dont>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@IP_PMTUDISC_DONT = global i32 0
@SOL_IP = global i32 0
@IP_MTU_DISCOVER = global i32 0
define void @set_mtu_disc_dont(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @IP_PMTUDISC_DONT
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_IP
%7 = load i32, i32* @IP_MTU_DISCOVER
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@IP_PMTUDISC_DONT = global i32 0
@SOL_IP = global i32 0
@IP_MTU_DISCOVER = global i32 0
define void @set_mtu_disc_dont(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @IP_PMTUDISC_DONT
store i32 %4, i32* %2
%5 = load i32, i32* @SOL_IP
%6 = load i32, i32* @IP_MTU_DISCOVER
%7 = call i32 @setsockopt(i32 %0, i32 %5, i32 %6, i32* %2, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *,
                           char const *);
void logstr(FILE *f, const char *s1, const char *s2) {
  if (f != 0) {
    fprintf(f, "%s%s\n", s1, s2);
    fflush(f);
  }
}


x86 assembly (clang, -O0):
<logstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <logstr+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logstr>:
test   %rdi,%rdi
je     1144 <logstr+0x24>
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
define void @logstr(i32* %0, i8* %1, i8* %2) {
%4 = icmp eq i32* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%7 = tail call i32 @fflush(i32* %0)
br label %8
8: ; preds = %5, %3
ret void
}
void foo558(int p) {}


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

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

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

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

/* Variables and functions */
int jksengine_destroy(ENGINE *e) {
  ;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @jksengine_destroy(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
float fastsin(float);
float fastcos(float x) {
  static const float halfpi = 1.5707963267948966f;
  static const float halfpiminustwopi = -4.7123889803846899f;
  float offset = (x > halfpi) ? halfpiminustwopi : halfpi;
  return fastsin(x + offset);
}


x86 assembly (clang, -O0):
<fastcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xed6(%rip),%xmm3
movss  0xed2(%rip),%xmm2
movaps %xmm2,%xmm0
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
call   1030 <fastsin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastcos>:
xor    %eax,%eax
ucomiss 0xee7(%rip),%xmm0
seta   %al
lea    0xee1(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
jmp    1030 <fastsin@plt>

LLVM IR (-O0):
@fastcos.halfpi = internal constant float 0x3FF921FB60000000
@fastcos.halfpiminustwopi = internal constant float 0xC012D97C80000000
define float @fastcos(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp ogt float %4, 0x3FF921FB60000000
%6 = zext i1 %5 to i64
%7 = select i1 %5, float 0xC012D97C80000000, float 0x3FF921FB60000000
store float %7, float* %3
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fadd float %8, %9
%11 = call float @fastsin(float %10)
ret float %11
}

LLVM IR (-O2):
define float @fastcos(float %0) {
%2 = fcmp ogt float %0, 0x3FF921FB60000000
%3 = select i1 %2, float 0xC012D97C80000000, float 0x3FF921FB60000000
%4 = fadd float %3, %0
%5 = tail call float @fastsin(float %4)
ret float %5
}
void dummy(char *old, char *new) {}


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

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

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

LLVM IR (-O2):
define void @dummy(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *jsonZcbString(char *, char *);
char *jsonZcbChanMaskRsp(char *channelMask) {
  return (jsonZcbString("chanrsp", channelMask));
}


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

x86 assembly (clang, -O2):
<jsonZcbChanMaskRsp>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <jsonZcbString@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"chanrsp\00"
define i8* @jsonZcbChanMaskRsp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @jsonZcbString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"chanrsp\00"
define i8* @jsonZcbChanMaskRsp(i8* %0) {
%2 = tail call i8* @jsonZcbString(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("faci is%d", factorial(3));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"faci is%d\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int ccnl_iottlv_peekType(unsigned char *, int);
int /*<<< orphan*/ ccnl_switch_dehead(unsigned char **, int *, int *);
int iottlv_isFragment(unsigned char *buf, int len) {
  int enc;
  while (!ccnl_switch_dehead(&buf, &len, &enc))
    ;
  return ccnl_iottlv_peekType(buf, len) == 0x1;
}


x86 assembly (clang, -O0):
<iottlv_isFragment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <ccnl_switch_dehead@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1155 <iottlv_isFragment+0x35>
jmp    115a <iottlv_isFragment+0x3a>
jmp    112f <iottlv_isFragment+0xf>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <ccnl_iottlv_peekType@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iottlv_isFragment>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,0x10(%rsp)
mov    %esi,0xc(%rsp)
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0x1c(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <ccnl_switch_dehead@plt>
test   %eax,%eax
je     1150 <iottlv_isFragment+0x30>
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
call   1040 <ccnl_iottlv_peekType@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @iottlv_isFragment(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast i32* %5 to i8*
br label %7
7: ; preds = %7, %2
%8 = call i32 @ccnl_switch_dehead(i8** %3, i32* %4, i32* %5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %7, label %10
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @ccnl_iottlv_peekType(i8* %11, i32 %12)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
ret i32 %15
}
void init_case_1() {}


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

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

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

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

/* Variables and functions */
void GPIOPinWrite(uint32_t ui32Port, uint8_t ui8Pins, uint8_t ui8Val) {
  ;
  (*((volatile uint32_t *)(ui32Port + (0x00000000 + (ui8Pins << 2))))) = ui8Val;
}


x86 assembly (clang, -O0):
<GPIOPinWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x2,%edx
add    $0x0,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinWrite>:
shl    $0x2,%esi
movslq %esi,%rax
movslq %edi,%rcx
mov    %edx,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @GPIOPinWrite(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = shl i32 %9, 2
%11 = add nsw i32 0, %10
%12 = add nsw i32 %8, %11
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @GPIOPinWrite(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 2
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %2, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(void) {
  char stri[21];
  strcpy(stri, "hallo");
  printf("Der String ist %d Zeichen lang", strlen(stri));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hallo\00"
@.str.1 = [31 x i8] c"Der String ist %d Zeichen lang\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hallo\00"
@.str.1 = [31 x i8] c"Der String ist %d Zeichen lang\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void debug32_deflabel(char *name, int32_t segment, int64_t offset,
                      int is_global, char *special) {
  (void)name;
  (void)segment;
  (void)offset;
  (void)is_global;
  (void)special;
}


x86 assembly (clang, -O0):
<debug32_deflabel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @debug32_deflabel(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4) {
ret void
}
int sourceWordwith(int sourceWord, int destinationWord) { return sourceWord; }


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

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

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

LLVM IR (-O2):
define i32 @sourceWordwith(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ mmio_write(void *, int, int);
int /*<<< orphan*/ usleep(int);
void i2c_do_tx(void *base) {
  mmio_write(base, 0x60d0, 1);
  usleep(1000);
}


x86 assembly (clang, -O0):
<i2c_do_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x60d0,%esi
mov    $0x1,%edx
call   1030 <mmio_write@plt>
mov    $0x3e8,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_do_tx>:
push   %rax
mov    $0x60d0,%esi
mov    $0x1,%edx
call   1030 <mmio_write@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @i2c_do_tx(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mmio_write(i8* %3, i32 24784, i32 1)
%5 = call i32 @usleep(i32 1000)
ret void
}

LLVM IR (-O2):
define void @i2c_do_tx(i8* %0) {
%2 = tail call i32 @mmio_write(i8* %0, i32 24784, i32 1)
%3 = tail call i32 @usleep(i32 1000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int edge, volume;
  printf("Enter length of edge of cube (e.g 3): ");
  scanf("%d", &edge);
  volume = edge * edge * edge;
  printf("Volume of cube: %d", volume);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Enter length of edge of cube (e.g 3): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Volume of cube: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Enter length of edge of cube (e.g 3): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Volume of cube: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %5
%7 = mul nsw i32 %6, %5
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, unsigned long);
int /*<<< orphan*/ prints(int /*<<< orphan*/);
void printi(int i) {
  char buffer[256UL];
  prints(itoa(i, buffer, 256UL));
}


x86 assembly (clang, -O0):
<printi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <itoa@plt>
mov    %eax,%edi
call   1030 <prints@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printi>:
sub    $0x108,%rsp
mov    %rsp,%rsi
mov    $0x100,%edx
call   1040 <itoa@plt>
mov    %eax,%edi
call   1030 <prints@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @printi(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i32 @itoa(i32 %4, i8* %5, i64 256)
%7 = call i32 @prints(i32 %6)
ret void
}

LLVM IR (-O2):
define void @printi(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i32 %0, i8* %3, i64 256)
%5 = call i32 @prints(i32 %4)
ret void
}
int f_ble_rc1(float a1) { return (__builtin_islessequal(a1, 100)); }


x86 assembly (clang, -O0):
<f_ble_rc1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ble_rc1>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @f_ble_rc1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_ble_rc1(float %0) {
%2 = fcmp ole float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void memory_unmap(void *addr, size_t size) { munmap(addr, size); }


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

x86 assembly (clang, -O2):
<memory_unmap>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @memory_unmap(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
char alphex_uitoc(unsigned int i) {
  i = (i & (1U << 6)) - 1;
  if (i == 63U)
    return '@';
  else if (i == 62U)
    return '_';
  else if (i >= 36U)
    return ('A' + i - 36);
  else if (i >= 10U)
    return ('a' + i - 10);
  else
    return ('0' + i);
}


x86 assembly (clang, -O0):
<alphex_uitoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x40,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3f,-0x8(%rbp)
jne    1126 <alphex_uitoc+0x26>
movb   $0x40,-0x1(%rbp)
jmp    1178 <alphex_uitoc+0x78>
cmpl   $0x3e,-0x8(%rbp)
jne    1139 <alphex_uitoc+0x39>
movb   $0x5f,-0x1(%rbp)
jmp    1178 <alphex_uitoc+0x78>
cmpl   $0x24,-0x8(%rbp)
jb     1154 <alphex_uitoc+0x54>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0x24,%eax
mov    %al,-0x1(%rbp)
jmp    1178 <alphex_uitoc+0x78>
cmpl   $0xa,-0x8(%rbp)
jb     116f <alphex_uitoc+0x6f>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1178 <alphex_uitoc+0x78>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphex_uitoc>:
and    $0x40,%edi
lea    0x1c(%rdi),%eax
test   %edi,%edi
movzbl %al,%ecx
mov    $0x40,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @alphex_uitoc(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 64
%6 = sub i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 63
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 64, i8* %2
br label %34
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 62
br i1 %12, label %13, label %14
13: ; preds = %10
store i8 95, i8* %2
br label %34
14: ; preds = %10
%15 = load i32, i32* %3
%16 = icmp uge i32 %15, 36
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i32, i32* %3
%19 = add i32 65, %18
%20 = sub i32 %19, 36
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %34
22: ; preds = %14
%23 = load i32, i32* %3
%24 = icmp uge i32 %23, 10
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = load i32, i32* %3
%27 = add i32 97, %26
%28 = sub i32 %27, 10
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
br label %34
30: ; preds = %22
%31 = load i32, i32* %3
%32 = add i32 48, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %2
br label %34
34: ; preds = %30, %25, %17, %13, %9
%35 = load i8, i8* %2
ret i8 %35
}

LLVM IR (-O2):
define signext i8 @alphex_uitoc(i32 %0) {
%2 = and i32 %0, 64
%3 = icmp eq i32 %2, 0
%4 = trunc i32 %2 to i8
%5 = or i8 %4, 28
%6 = select i1 %3, i8 %5, i8 64
ret i8 %6
}
void append_free(char **in) {
  long *p = (long *)*in;
  if (p) {
    p -= 2;
    sqlite3_free(p);
    *in = 0;
  }
}


x86 assembly (clang, -O0):
<append_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <append_free+0x44>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <sqlite3_free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112e <append_free+0x1e>
add    $0xfffffffffffffff0,%rdi
xor    %eax,%eax
call   1030 <sqlite3_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @append_free(i8** nocapture %0) {
%2 = bitcast i8** %0 to i64**
%3 = load i64*, i64** %2
%4 = icmp eq i64* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = getelementptr inbounds i64, i64* %3, i64 -2
%7 = tail call i32 (i64*, ...) bitcast (i32 (...)* @sqlite3_free to i32 (i64*, ...)*)(i64* %6)
store i8* null, i8** %0
br label %8
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *remap(void *old, int oldSize, int newSize) {
  void *new = calloc(newSize, 1);
  memcpy(new, old, oldSize);
  free(old);
  return new;
}


x86 assembly (clang, -O0):
<remap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %edx,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @remap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i8* @calloc(i32 %8, i32 1)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @remap(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @calloc(i32 %2, i32 1)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = tail call i32 @free(i8* %0)
ret i8* %4
}
int getheadspertrack(int part1[]) {
  int nheads = 0;
  nheads = part1[1] + part1[5];
  return nheads;
}


x86 assembly (clang, -O0):
<getheadspertrack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x14(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getheadspertrack>:
mov    0x14(%rdi),%eax
add    0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @getheadspertrack(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 5
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ unlock(char *);
quit() {
  unlock("/usr/spool/infoserv/loglock");
  exit(-1);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <unlock@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlock@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"/usr/spool/infoserv/loglock\00"
define i32 @quit() {
%1 = call i32 @unlock(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"/usr/spool/infoserv/loglock\00"
define i32 @quit() {
%1 = tail call i32 @unlock(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
int REAL_TO_DINT(float var) {
  int newvar;
  newvar = (int)var;
  return newvar;
}


x86 assembly (clang, -O0):
<REAL_TO_DINT>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<REAL_TO_DINT>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @REAL_TO_DINT(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @REAL_TO_DINT(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
unsigned long long foo(const unsigned char *p) { return 1; }


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

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

LLVM IR (-O0):
define i64 @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 1
}

LLVM IR (-O2):
define i64 @foo(i8* nocapture readnone %0) {
ret i64 1
}
/* Variables and functions */
float log(int);
float log1pf(float x) { return log(1 + x); }


x86 assembly (clang, -O0):
<log1pf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pf>:
addss  0xee8(%rip),%xmm0
cvttss2si %xmm0,%edi
jmp    1030 <log@plt>

LLVM IR (-O0):
define float @log1pf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float 1.000000e+00, %3
%5 = fptosi float %4 to i32
%6 = call float @log(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @log1pf(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fptosi float %2 to i32
%4 = tail call float @log(i32 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ append();
char current();
int /*<<< orphan*/ expect_ch(char);
int string(void) {
  expect_ch('"');
  while ('"' != current())
    append();
  expect_ch('"');
  return 5;
}


x86 assembly (clang, -O0):
<string>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1040 <expect_ch@plt>
mov    $0x0,%al
call   1050 <current@plt>
movsbl %al,%ecx
mov    $0x22,%eax
cmp    %ecx,%eax
je     1161 <string+0x31>
mov    $0x0,%al
call   1030 <append@plt>
jmp    113e <string+0xe>
mov    $0x22,%edi
call   1040 <expect_ch@plt>
mov    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string>:
push   %rax
mov    $0x22,%edi
call   1040 <expect_ch@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <current@plt>
cmp    $0x22,%al
je     1154 <string+0x24>
xor    %eax,%eax
call   1030 <append@plt>
jmp    1140 <string+0x10>
mov    $0x22,%edi
call   1040 <expect_ch@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string() {
%1 = call i32 @expect_ch(i8 signext 34)
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @current()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 34, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @append()
br label %2
8: ; preds = %2
%9 = call i32 @expect_ch(i8 signext 34)
ret i32 5
}

LLVM IR (-O2):
define i32 @string() {
%1 = tail call i32 @expect_ch(i8 signext 34)
%2 = tail call signext i8 (...) @current()
%3 = icmp eq i8 %2, 34
br i1 %3, label %8, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @append()
%6 = tail call signext i8 (...) @current()
%7 = icmp eq i8 %6, 34
br i1 %7, label %8, label %4
8: ; preds = %4, %0
%9 = tail call i32 @expect_ch(i8 signext 34)
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int args, char **argv) {
  int i;
  for (i = 0; i < args; i++) {
    printf("%s\n", argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
void warning(s1, s2) char *s1;
char *s2;
{ prmsg("WARNING: ", s1, s2); }


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <prmsg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <prmsg@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"WARNING: \00"
define void @warning(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @prmsg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"WARNING: \00"
define void @warning(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @prmsg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
int /*<<< orphan*/ memcpy(char *, void const *, int);
int strlen(void const *);
char *tcmalloc(int);
char *tcstrdup(const void *str) {
  assert(str);
  int size = strlen(str);
  char *p = tcmalloc(size + 1);
  memcpy(p, str, size);
  p[size] = '\0';
  return p;
}


x86 assembly (clang, -O0):
<tcstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1060 <tcmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <assert@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1060 <tcmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1050 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @tcstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = call i8* @tcmalloc(i32 %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = call i32 @memcpy(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %4
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @tcstrdup(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = tail call i8* @tcmalloc(i32 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %3)
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
void *adt_copy_nothing(const void *src) { return (void *)src; }


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

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

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

LLVM IR (-O2):
define i8* @adt_copy_nothing(i8* readnone returned %0) {
ret i8* %0
}
void f(int *m) { (*m)++; }


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

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

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

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}