xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printBin(unsigned int);
void convertFloatToBin(float X) {
  unsigned bin = *(unsigned *)&X;
  printBin(bin);
}


x86 assembly (clang, -O0):
<convertFloatToBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <printBin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertFloatToBin>:
movd   %xmm0,%edi
jmp    1030 <printBin@plt>

LLVM IR (-O0):
define void @convertFloatToBin(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast float* %2 to i32*
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printBin(i32 %6)
ret void
}

LLVM IR (-O2):
define void @convertFloatToBin(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @printBin(i32 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h264avcc_get_nb_sps(const uint8_t *p) { return p[5] & 0x1f; }


x86 assembly (clang, -O0):
<h264avcc_get_nb_sps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264avcc_get_nb_sps>:
mov    0x14(%rdi),%eax
and    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @h264avcc_get_nb_sps(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = and i32 %3, 31
ret i32 %4
}
void XkbSelectEventDetails() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gdk_gc_get_values() {
ret void
}
int sam3Base32EncodedLength(int size) { return (((size + 5 - 1) / 5) * 8); }


x86 assembly (clang, -O0):
<sam3Base32EncodedLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
sub    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
shl    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam3Base32EncodedLength>:
add    $0x4,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x21,%rax
add    %ecx,%eax
shl    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @sam3Base32EncodedLength(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = sdiv i32 %2, 5
%4 = shl nsw i32 %3, 3
ret i32 %4
}
void prompt(mesg) const char *mesg;
{
  move(2, 20);
  printw("%s", mesg);
  move(2 + 1, 20);
  refresh();
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x14,%esi
mov    $0x0,%al
call   1050 <move@plt>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printw@plt>
mov    $0x3,%edi
mov    $0x14,%esi
mov    $0x0,%al
call   1050 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <move@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printw@plt>
mov    $0x3,%edi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <move@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @prompt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 2, i32 20)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 3, i32 20)
%7 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @prompt(i8* %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 2, i32 20)
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printw to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 3, i32 20)
%5 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ syssuerr(char *, char *);
int efork(void) {
  int fd;
  if (-1 == (fd = fork()))
    syssuerr("%s: efork: fork failed",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/"
             "trip/iwave/sucore/src/syscalls.c");
  return fd;
}


x86 assembly (clang, -O0):
<efork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1154 <efork+0x34>
lea    0xeb8(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <syssuerr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1142 <efork+0x22>
lea    0xeca(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <syssuerr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%s: efork: fork failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i32 @efork() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = icmp eq i32 -1, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @syssuerr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s: efork: fork failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i32 @efork() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @syssuerr(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
__attribute__((__unused__)) void *_voidp_consume(void *p, ...) {
  return (void *)0;
}


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

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

LLVM IR (-O0):
define i8* @_voidp_consume(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_voidp_consume(i8* nocapture readnone %0, ...) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char nombre[] = "Gustavo A. Chavarria";
  char *puntero = nombre;
  printf("%s \nIngrese otro nombre: ", puntero);
  gets(puntero);
  printf("%s", puntero);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <gets@plt>
mov    -0x28(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x61697272617661,%rax
mov    %rax,0xd(%rsp)
lea    0xecf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nombre = [21 x i8] c"Gustavo A. Chavarria\00"
@.str = [26 x i8] c"%s \0AIngrese otro nombre: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [21 x i8]* %2 to i8*
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @gets(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nombre = [21 x i8] c"Gustavo A. Chavarria\00"
@.str = [26 x i8] c"%s \0AIngrese otro nombre: \00"
@.str.1 = [3 x i8] c"%s\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 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @gets(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int useconds_t;

/* Variables and functions */
int /*<<< orphan*/ EINTR;
int /*<<< orphan*/ errno;
scalar_t__ msleep(int);
int usleep(useconds_t usec) {
  if (msleep(usec / 1000) > 0) {
    errno = EINTR;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <msleep@plt>
cmp    $0x0,%rax
jle    1155 <usleep+0x45>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <usleep+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
call   1030 <msleep@plt>
test   %rax,%rax
jle    114b <usleep+0x3b>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
mov    0x2e9e(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINTR = global i32 0
@errno = global i32 0
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000
%6 = call i64 @msleep(i32 %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* @EINTR
store i32 %9, i32* @errno
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@EINTR = global i32 0
@errno = global i32 0
define i32 @usleep(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = tail call i64 @msleep(i32 %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @EINTR
store i32 %6, i32* @errno
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void limpa(void) { system("/usr/bin/clear"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"/usr/bin/clear\00"
define void @limpa() {
%1 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/usr/bin/clear\00"
define void @limpa() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addID(int *);
int *init_rng(int, int, int, int);
int *finit_rng_ptr(int *gennum, int *total_gen, int *seed, int *length) {
  int *tmpGen;
  tmpGen = init_rng(*gennum, *total_gen, *seed, *length);
  addID(tmpGen);
  return tmpGen;
}


x86 assembly (clang, -O0):
<finit_rng_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
call   1030 <init_rng@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <addID@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finit_rng_ptr>:
push   %rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
call   1030 <init_rng@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <addID@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @finit_rng_ptr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = tail call i32* @init_rng(i32 %5, i32 %6, i32 %7, i32 %8)
%10 = tail call i32 @addID(i32* %9)
ret i32* %9
}
int execute_pciconfig_write() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pciconfig_write() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int cmd_quit(int argc, char *argv[]) {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<cmd_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cmd_quit>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @cmd_quit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dot(double const *, double const *);
double sqrt(int /*<<< orphan*/);
double norm2(const double v[3]) { return (sqrt(dot(v, v))); }


x86 assembly (clang, -O0):
<norm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <dot@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm2>:
push   %rax
mov    %rdi,%rsi
call   1030 <dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @norm2(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double*, double** %2
%5 = call i32 @dot(double* %3, double* %4)
%6 = call double @sqrt(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @norm2(double* %0) {
%2 = tail call i32 @dot(double* %0, double* %0)
%3 = tail call double @sqrt(i32 %2)
ret double %3
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  size_t len = 0;
  while (len < maxlen && s[len] != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    113c <strnlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <strnlen+0x4c>
jmp    115d <strnlen+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
                                        struct blk_mq_hw_ctx *hctx) {}


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.blk_mq_hw_ctx = type opaque
define void @blk_mq_debugfs_register_sched_hctx(%struct.request_queue* nocapture %0, %struct.blk_mq_hw_ctx* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void send_message_self(const char *s, int connfd) {
  write(connfd, s, strlen(s));
}


x86 assembly (clang, -O0):
<send_message_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message_self>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @send_message_self(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ borraTableroSnake();
int /*<<< orphan*/ pintaComida();
int /*<<< orphan*/ pintaSerpiente();
int /*<<< orphan*/ snakeInic();
void inicio(void) {
  borraTableroSnake();
  snakeInic();
  pintaSerpiente();
  pintaComida();
}


x86 assembly (clang, -O0):
<inicio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <borraTableroSnake@plt>
mov    $0x0,%al
call   1060 <snakeInic@plt>
mov    $0x0,%al
call   1050 <pintaSerpiente@plt>
mov    $0x0,%al
call   1040 <pintaComida@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inicio>:
push   %rax
xor    %eax,%eax
call   1030 <borraTableroSnake@plt>
xor    %eax,%eax
call   1060 <snakeInic@plt>
xor    %eax,%eax
call   1050 <pintaSerpiente@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pintaComida@plt>

LLVM IR (-O0):
define void @inicio() {
%1 = call i32 (...) @borraTableroSnake()
%2 = call i32 (...) @snakeInic()
%3 = call i32 (...) @pintaSerpiente()
%4 = call i32 (...) @pintaComida()
ret void
}

LLVM IR (-O2):
define void @inicio() {
%1 = tail call i32 (...) @borraTableroSnake()
%2 = tail call i32 (...) @snakeInic()
%3 = tail call i32 (...) @pintaSerpiente()
%4 = tail call i32 (...) @pintaComida()
ret void
}
/* Type definitions */
typedef int c;

/* Variables and functions */
scalar_t__ sl_isupper(int);
int sl_tolower(int c) { return sl_isupper(c) ? (c) - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<sl_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sl_isupper@plt>
cmp    $0x0,%rax
je     113e <sl_tolower+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <sl_tolower+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <sl_isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sl_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @sl_isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = add nsw i32 %8, 97
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @sl_tolower(i32 %0) {
%2 = tail call i64 @sl_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void INT_Excep_MTU3_TGIV3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU3_TGIV3() {
ret void
}
/* Variables and functions */
int __builtin_mips_shra_r_w(int, int);
int silk_RSHIFT_ROUND(int a, int shift) {
  int r;
  r = __builtin_mips_shra_r_w(a, shift);
  return r;
}


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

x86 assembly (clang, -O2):
<silk_RSHIFT_ROUND>:
jmp    1030 <__builtin_mips_shra_r_w@plt>

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

LLVM IR (-O2):
define i32 @silk_RSHIFT_ROUND(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_mips_shra_r_w(i32 %0, i32 %1)
ret i32 %3
}
char ifhex(int rest) {
  if (rest == 10)
    return ('A');
  if (rest == 11)
    return ('B');
  if (rest == 12)
    return ('C');
  if (rest == 13)
    return ('D');
  if (rest == 14)
    return ('E');
  if (rest == 15)
    return ('F');
}


x86 assembly (clang, -O0):
<ifhex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    111a <ifhex+0x1a>
movb   $0x41,-0x1(%rbp)
jmp    1174 <ifhex+0x74>
cmpl   $0xb,-0x8(%rbp)
jne    112d <ifhex+0x2d>
movb   $0x42,-0x1(%rbp)
jmp    1174 <ifhex+0x74>
cmpl   $0xc,-0x8(%rbp)
jne    1140 <ifhex+0x40>
movb   $0x43,-0x1(%rbp)
jmp    1174 <ifhex+0x74>
cmpl   $0xd,-0x8(%rbp)
jne    1153 <ifhex+0x53>
movb   $0x44,-0x1(%rbp)
jmp    1174 <ifhex+0x74>
cmpl   $0xe,-0x8(%rbp)
jne    1166 <ifhex+0x66>
movb   $0x45,-0x1(%rbp)
jmp    1174 <ifhex+0x74>
cmpl   $0xf,-0x8(%rbp)
jne    1174 <ifhex+0x74>
movb   $0x46,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifhex>:
add    $0xfffffff5,%edi
lea    0x42(%rdi),%eax
cmp    $0x5,%edi
movzbl %al,%ecx
mov    $0x41,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @ifhex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 65, i8* %2
br label %27
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 11
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 66, i8* %2
br label %27
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 12
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 67, i8* %2
br label %27
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 13
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 68, i8* %2
br label %27
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 14
br i1 %21, label %22, label %23
22: ; preds = %19
store i8 69, i8* %2
br label %27
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 15
br i1 %25, label %26, label %27
26: ; preds = %23
store i8 70, i8* %2
br label %27
27: ; preds = %6, %10, %14, %18, %22, %26, %23
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @ifhex(i32 %0) {
%2 = add i32 %0, -11
%3 = icmp ult i32 %2, 5
%4 = trunc i32 %2 to i8
%5 = add i8 %4, 66
%6 = select i1 %3, i8 %5, i8 65
ret i8 %6
}
void cs_deregister_messenger(void) { return; }


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

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

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

LLVM IR (-O2):
define void @cs_deregister_messenger() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chan(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *s = "zx";
  chan(s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chan@plt>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <chan@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"zx\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @chan(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *, char *);
void read_str_from_config_line(char *config_line, char *val) {
  char prm_name[20];
  sscanf(config_line, "%s %s\n", prm_name, val);
}


x86 assembly (clang, -O0):
<read_str_from_config_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xecd(%rip),%rsi
call   1030 <sscanf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_str_from_config_line>:
sub    $0x18,%rsp
mov    %rsi,%rcx
lea    0xee2(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
define void @read_str_from_config_line(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [20 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
define void @read_str_from_config_line(i8* nocapture %0, i8* %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %1)
ret void
}
int isPowerOfTwo(int x) { return x && (!(x & (x - 1))); }


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <isPowerOfTwo+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
test   %edi,%edi
je     110f <isPowerOfTwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isPowerOfTwo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int divisor(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1;
  int num = 0;
  while (num <= 500) {
    i++;
    num = divisor(i * (i + 1) / 2);
  }
  printf("%d \n", i * (i + 1) / 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f4,-0xc(%rbp)
jg     1176 <main+0x56>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <divisor@plt>
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x2,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%ebp
imul   %ebp,%ecx
mov    %ecx,%ebx
shr    %ebx
mov    %ebx,%edi
call   1040 <divisor@plt>
mov    %ebp,%ecx
cmp    $0x1f5,%eax
jl     1130 <main+0x10>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = add nuw nsw i32 %2, 2
%5 = mul nsw i32 %3, %4
%6 = lshr i32 %5, 1
%7 = tail call i32 @divisor(i32 %6)
%8 = icmp slt i32 %7, 501
br i1 %8, label %1, label %9
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
int isrange(int start, int end, int line) {
  return start <= line && (line <= end || end == -1);
}


x86 assembly (clang, -O0):
<isrange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     113f <isrange+0x3f>
mov    -0xc(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0xe(%rbp)
jle    1139 <isrange+0x39>
cmpl   $0xffffffff,-0x8(%rbp)
sete   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrange>:
cmp    %edx,%edi
setle  %al
cmp    %esi,%edx
setle  %cl
cmp    $0xffffffff,%esi
sete   %dl
or     %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @isrange(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %0, %2
%5 = icmp sle i32 %2, %1
%6 = icmp eq i32 %1, -1
%7 = or i1 %6, %5
%8 = and i1 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void modular_multiplication(mpz_t a, mpz_t b, mpz_t c, mpz_t n) {
  mpz_mul(a, b, c);
  mpz_mod(a, a, n);
}


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

x86 assembly (clang, -O2):
<modular_multiplication>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edi,%ebp
call   1030 <mpz_mul@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mpz_mod@plt>

LLVM IR (-O0):
define void @modular_multiplication(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @mpz_mul(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = call i32 @mpz_mod(i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @modular_multiplication(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mpz_mul(i32 %0, i32 %1, i32 %2)
%6 = tail call i32 @mpz_mod(i32 %0, i32 %0, i32 %3)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t _byteswap64(uint64_t x) {
  return ((0x00000000000000ff) & (x >> 56) | (0x000000000000ff00) & (x >> 40) |
          (0x0000000000ff0000) & (x >> 24) | (0x00000000ff000000) & (x >> 8) |
          (0x000000ff00000000) & (x << 8) | (0x0000ff0000000000) & (x << 24) |
          (0x00ff000000000000) & (x << 40) | (0xff00000000000000) & (x << 56));
}


x86 assembly (clang, -O0):
<_byteswap64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff000000,%ecx
or     %ecx,%eax
mov    %eax,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff00000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
movslq %ecx,%rcx
movabs $0xff0000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
movabs $0xff000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    -0x4(%rbp),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
movabs $0xff00000000000000,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_byteswap64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 56
%5 = and i32 255, %4
%6 = load i32, i32* %2
%7 = ashr i32 %6, 40
%8 = and i32 65280, %7
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = ashr i32 %10, 24
%12 = and i32 16711680, %11
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 8
%16 = and i32 -16777216, %15
%17 = or i32 %13, %16
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = shl i32 %19, 8
%21 = sext i32 %20 to i64
%22 = and i64 1095216660480, %21
%23 = or i64 %18, %22
%24 = load i32, i32* %2
%25 = shl i32 %24, 24
%26 = sext i32 %25 to i64
%27 = and i64 280375465082880, %26
%28 = or i64 %23, %27
%29 = load i32, i32* %2
%30 = shl i32 %29, 40
%31 = sext i32 %30 to i64
%32 = and i64 71776119061217280, %31
%33 = or i64 %28, %32
%34 = load i32, i32* %2
%35 = shl i32 %34, 56
%36 = sext i32 %35 to i64
%37 = and i64 -72057594037927936, %36
%38 = or i64 %33, %37
%39 = trunc i64 %38 to i32
ret i32 %39
}

LLVM IR (-O2):
define i32 @_byteswap64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a, b;
  for (a = 4; a < 100; a++) {
    if (a < 4)
      b = b + 2;
    else
      b = b * 2;
  }
  printf("%d%d", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1164 <main+0x54>
cmpl   $0x4,-0x8(%rbp)
jge    1148 <main+0x38>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <main+0x41>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 100, i32 0)
ret i32 0
}
int hostapd_select_hw_mode(struct hostapd_iface *iface) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define i32 @hostapd_select_hw_mode(%struct.hostapd_iface* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void perm_argsort_work_free(void *work) { free(work); }


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

x86 assembly (clang, -O2):
<perm_argsort_work_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @perm_argsort_work_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ perror(char *);
int Connect(int sockfd, struct sockaddr_in sockaddr, int sin_size) {
  int n;
  if ((n = connect(sockfd, (struct sockaddr *)&sockaddr, sin_size)) < 0) {
    perror("connect");
    return -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<Connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %esi,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1040 <connect@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1164 <Connect+0x44>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <Connect+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Connect>:
push   %rax
mov    %esi,(%rsp)
mov    %rsp,%rsi
call   1040 <connect@plt>
test   %eax,%eax
js     1132 <Connect+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"connect\00"
define i32 @Connect(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
store i32 %1, i32* %9
store i32 %0, i32* %6
store i32 %2, i32* %7
%10 = load i32, i32* %6
%11 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%12 = load i32, i32* %7
%13 = call i32 @connect(i32 %10, %struct.sockaddr* %11, i32 %12)
store i32 %13, i32* %8
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %19
17: ; preds = %3
%18 = load i32, i32* %8
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"connect\00"
define i32 @Connect(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.sockaddr_in
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i64 0, i32 0
store i32 %1, i32* %5
%6 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%7 = call i32 @connect(i32 %0, %struct.sockaddr* %6, i32 %2)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ -1, %9 ], [ %7, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
char upper(char);
int main() {
  char cc = upper('h');
  printf("%c\n", cc);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call signext i8 @upper(i8 signext 104)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %1)
ret i32 0
}