xunge/DecIR huggingface dataset:
/* Variables and functions */
int aa_cla_ilaenv(int, char *, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                  int /*<<< orphan*/, int /*<<< orphan*/);
int aa_cla_dgelsd_smlsiz() {
  return aa_cla_ilaenv(9,
                       "D"
                       "GELSD",
                       "", 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<aa_cla_dgelsd_smlsiz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x9,%edi
lea    0xedc(%rip),%rsi
lea    0xedb(%rip),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <aa_cla_ilaenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dgelsd_smlsiz>:
push   %rax
movl   $0x0,(%rsp)
lea    0xee1(%rip),%rsi
lea    0xee0(%rip),%rdx
mov    $0x9,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <aa_cla_ilaenv@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"DGELSD\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @aa_cla_dgelsd_smlsiz() {
%1 = tail call i32 @aa_cla_ilaenv(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void testSelfOperations(int a) {
  clang_analyzer_eval((a | a) == a);
  clang_analyzer_eval((a & a) == a);
  clang_analyzer_eval((a ^ a) == 0);
  clang_analyzer_eval((a - a) == 0);
}


x86 assembly (clang, -O0):
<testSelfOperations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
xor    -0x4(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    -0x4(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSelfOperations>:
push   %rax
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @testSelfOperations(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = or i32 %3, %4
%6 = load i32, i32* %2
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = and i32 %10, %11
%13 = load i32, i32* %2
%14 = icmp eq i32 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @clang_analyzer_eval(i32 %15)
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = xor i32 %17, %18
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @clang_analyzer_eval(i32 %21)
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = sub nsw i32 %23, %24
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @clang_analyzer_eval(i32 %27)
ret void
}

LLVM IR (-O2):
define void @testSelfOperations(i32 %0) {
%2 = tail call i32 @clang_analyzer_eval(i32 1)
%3 = tail call i32 @clang_analyzer_eval(i32 1)
%4 = tail call i32 @clang_analyzer_eval(i32 1)
%5 = tail call i32 @clang_analyzer_eval(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Cafè amb llet!\n");
  printf("?");
  printf("!");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x3f,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Caf\C3\A8 amb llet!\0A\00"
@.str.1 = [2 x i8] c"?\00"
@.str.2 = [2 x i8] c"!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Caf\C3\A8 amb llet!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 63)
%3 = tail call i32 @putchar(i32 33)
ret i32 0
}
/* Type definitions */
struct ipc {
  int dummy;
};

/* Variables and functions */
struct ipc *init(struct ipc *);
int /*<<< orphan*/ traitement(struct ipc *);
void main() {
  struct ipc *memoire[1];
  *memoire = init(*memoire);
  traitement(*memoire);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <traitement@plt>

LLVM IR (-O0):
%struct.ipc = type { i32 }
define void @main() {
%1 = alloca [1 x %struct.ipc*]
%2 = getelementptr inbounds [1 x %struct.ipc*], [1 x %struct.ipc*]* %1, i64 0, i64 0
%3 = load %struct.ipc*, %struct.ipc** %2
%4 = call %struct.ipc* @init(%struct.ipc* %3)
%5 = getelementptr inbounds [1 x %struct.ipc*], [1 x %struct.ipc*]* %1, i64 0, i64 0
store %struct.ipc* %4, %struct.ipc** %5
%6 = getelementptr inbounds [1 x %struct.ipc*], [1 x %struct.ipc*]* %1, i64 0, i64 0
%7 = load %struct.ipc*, %struct.ipc** %6
%8 = call i32 @traitement(%struct.ipc* %7)
ret void
}

LLVM IR (-O2):
%struct.ipc = type { i32 }
define void @main() {
%1 = tail call %struct.ipc* @init(%struct.ipc* undef)
%2 = tail call i32 @traitement(%struct.ipc* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void fputEol(FILE *fOut) { fputc('\n', fOut); }


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

x86 assembly (clang, -O2):
<fputEol>:
mov    %rdi,%rsi
mov    $0xa,%edi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @fputEol(i32* nocapture %0) {
%2 = tail call i32 @fputc(i8 signext 10, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int get_port(struct sockaddr const *);
uint16_t check_dynamic_port(const struct sockaddr *want,
                            const struct sockaddr *got) {
  if (get_port(want) == 0) {
    int port = get_port(got);
    if (port > 0)
      return (uint16_t)port;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_dynamic_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_port@plt>
cmp    $0x0,%eax
jne    1158 <check_dynamic_port+0x48>
mov    -0x18(%rbp),%rdi
call   1030 <get_port@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1153 <check_dynamic_port+0x43>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <check_dynamic_port+0x4f>
jmp    1158 <check_dynamic_port+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_dynamic_port>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_port@plt>
test   %eax,%eax
jne    112b <check_dynamic_port+0x1b>
mov    %rbx,%rdi
call   1030 <get_port@plt>
test   %eax,%eax
jle    112b <check_dynamic_port+0x1b>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @check_dynamic_port(%struct.sockaddr* %0, %struct.sockaddr* %1) {
%3 = tail call i32 @get_port(%struct.sockaddr* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @get_port(%struct.sockaddr* %1)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ %6, %5 ], [ 0, %8 ]
ret i32 %10
}
/* Variables and functions */
int unlink(char const *);
int g_file_delete(const char *filename) { return unlink(filename) != -1; }


x86 assembly (clang, -O0):
<g_file_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_file_delete>:
push   %rax
call   1030 <unlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g_file_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @g_file_delete(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage is: %s (-p PORT)\n", prog);
  fputs("-p : Port number.\n", stderr);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%esi
lea    0xed6(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage is: %s (-p PORT)\0A\00"
@.str.1 = [19 x i8] c"-p : Port number.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage is: %s (-p PORT)\0A\00"
@.str.1 = [19 x i8] c"-p : Port number.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int fsync(int);
int full_fsync(int fd) {
  int rc;
  rc = fsync(fd);
  return rc;
}


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

x86 assembly (clang, -O2):
<full_fsync>:
jmp    1030 <fsync@plt>

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

LLVM IR (-O2):
define i32 @full_fsync(i32 %0) {
%2 = tail call i32 @fsync(i32 %0)
ret i32 %2
}
double func(double x, double y, double z) { return (x * x + z * z) - y * y; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @func(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = load double, double* %6
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %5
%14 = load double, double* %5
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double %12)
ret double %16
}

LLVM IR (-O2):
define double @func(double %0, double %1, double %2) {
%4 = fmul double %2, %2
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %4)
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %5)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ fnEncryption();
int main() {
  fnEncryption();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fnEncryption()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void uint16Clear(uint16_t *data) { *data = 0; }


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

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

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

LLVM IR (-O2):
define void @uint16Clear(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
unsigned long binary(unsigned long number) {
  unsigned long module, i = 1, total = 0;
  do {
    module = number % 2;
    total += i * module;
    number /= 2;
    i *= 10;
  } while (number > 0);
  return total;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
ja     1118 <binary+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
mov    $0x1,%ecx
xor    %eax,%eax
mov    %rdi,%rdx
nopw   0x0(%rax,%rax,1)
mov    %edi,%esi
and    $0x1,%esi
imul   %rcx,%rsi
add    %rsi,%rax
shr    %rdx
add    %rcx,%rcx
lea    (%rcx,%rcx,4),%rcx
cmp    $0x1,%rdi
mov    %rdx,%rdi
ja     1110 <binary+0x10>
ret

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

LLVM IR (-O2):
define i64 @binary(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %9, %2 ]
%4 = phi i64 [ 1, %1 ], [ %10, %2 ]
%5 = phi i64 [ 0, %1 ], [ %8, %2 ]
%6 = and i64 %3, 1
%7 = mul nuw nsw i64 %4, %6
%8 = add i64 %5, %7
%9 = lshr i64 %3, 1
%10 = mul i64 %4, 10
%11 = icmp ult i64 %3, 2
br i1 %11, label %12, label %2
12: ; preds = %2
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ memchr(char *, int /*<<< orphan*/, size_t);
wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n) {
  return (wchar_t *)memchr((char *)s, c, n);
}


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

x86 assembly (clang, -O2):
<wmemchr>:
jmp    1030 <memchr@plt>

LLVM IR (-O0):
define i32* @wmemchr(i32* %0, i32 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = call i64 @memchr(i8* %8, i32 %9, i64 %10)
%12 = inttoptr i64 %11 to i32*
ret i32* %12
}

LLVM IR (-O2):
define i32* @wmemchr(i32* %0, i32 %1, i64 %2) {
%4 = bitcast i32* %0 to i8*
%5 = tail call i64 @memchr(i8* %4, i32 %1, i64 %2)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
long pgcd(long p, long q) {
  if (q == 0) {
    return p;
  } else {
    return pgcd(q, p % q);
  }
}


x86 assembly (clang, -O0):
<pgcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <pgcd+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <pgcd+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <pgcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <pgcd+0x35>
mov    %rsi,%rdx
jmp    111d <pgcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <pgcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <pgcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <pgcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @pgcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
int llvm_fcmp_ogt(double X, double Y) { return X > Y; }


x86 assembly (clang, -O0):
<llvm_fcmp_ogt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llvm_fcmp_ogt>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @llvm_fcmp_ogt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @llvm_fcmp_ogt(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double c_sqrt(double arg0) { return sqrt(arg0); }


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

x86 assembly (clang, -O2):
<c_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <c_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @c_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ get_proc_cpuinfo_data(char *, char *, int /*<<< orphan*/);
int generic_get_cpu_model() {
  char buffer[512];
  if (!get_proc_cpuinfo_data("model", buffer, 0))
    return atoi(buffer);
  else
    return -1;
}


x86 assembly (clang, -O0):
<generic_get_cpu_model>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    -0x210(%rbp),%rsi
lea    0xec7(%rip),%rdi
xor    %edx,%edx
call   1030 <get_proc_cpuinfo_data@plt>
cmp    $0x0,%eax
jne    115d <generic_get_cpu_model+0x3d>
lea    -0x210(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <generic_get_cpu_model+0x44>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_get_cpu_model>:
sub    $0x208,%rsp
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <get_proc_cpuinfo_data@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
je     114b <generic_get_cpu_model+0x2b>
add    $0x208,%rsp
ret
mov    %rsp,%rdi
call   1040 <atoi@plt>
add    $0x208,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"model\00"
define i32 @generic_get_cpu_model() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_proc_cpuinfo_data(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @atoi(i8* %2)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ %6, %5 ], [ -1, %0 ]
ret i32 %8
}
void foo_2_2_1_1_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_1_2_2_1() {
ret void
}
int do_489() { return 489; }


x86 assembly (clang, -O0):
<do_489>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e9,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_489() {
ret i32 489
}

LLVM IR (-O2):
define i32 @do_489() {
ret i32 489
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void exitprog_FF(void) {
  puts("\n_____________________________________\n");
  puts("\nExecution Terminated with opcode 0xFF");
  exit(0);
}


x86 assembly (clang, -O0):
<exitprog_FF>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitprog_FF>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0A_____________________________________\0A\00"
@.str.1 = [39 x i8] c"\0AExecution Terminated with opcode 0xFF\00"
define void @exitprog_FF() {
%1 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0A_____________________________________\0A\00"
@.str.1 = [39 x i8] c"\0AExecution Terminated with opcode 0xFF\00"
define void @exitprog_FF() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_13int16_mem(short *val) {
  return ((*val) & (-0x13 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_13int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffed,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_13int16_mem>:
movzwl (%rdi),%eax
test   $0xffed,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -19
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof(FILE *file) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @feof(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sys_yield();
void user_process() {
  int v = 0;
  for (;;) {
    v++;
    sys_yield();
  }
}


x86 assembly (clang, -O0):
<user_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <sys_yield@plt>
jmp    111f <user_process+0xf>

x86 assembly (clang, -O2):
<user_process>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sys_yield@plt>
jmp    1120 <user_process+0x10>

LLVM IR (-O0):
define void @user_process() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 (...) @sys_yield()
br label %2
}

LLVM IR (-O2):
define void @user_process() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @sys_yield()
br label %1
}
void sharpen(int *s) { ++*s; }


x86 assembly (clang, -O0):
<sharpen>:
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):
<sharpen>:
addl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @sharpen(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 @sharpen(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_add_several_crossing_times();
int /*<<< orphan*/ test_add_single_crossing_time();
int /*<<< orphan*/ test_add_two_crossing_times();
int /*<<< orphan*/ test_create_destroy();
int /*<<< orphan*/ test_index_out_of_bounds();
int /*<<< orphan*/ test_trip_doesnt_exist();
int main() {
  test_create_destroy();
  test_add_single_crossing_time();
  test_add_two_crossing_times();
  test_add_several_crossing_times();
  test_trip_doesnt_exist();
  test_index_out_of_bounds();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_create_destroy@plt>
mov    $0x0,%al
call   1080 <test_add_single_crossing_time@plt>
mov    $0x0,%al
call   1030 <test_add_two_crossing_times@plt>
mov    $0x0,%al
call   1060 <test_add_several_crossing_times@plt>
mov    $0x0,%al
call   1070 <test_trip_doesnt_exist@plt>
mov    $0x0,%al
call   1040 <test_index_out_of_bounds@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_create_destroy@plt>
xor    %eax,%eax
call   1080 <test_add_single_crossing_time@plt>
xor    %eax,%eax
call   1030 <test_add_two_crossing_times@plt>
xor    %eax,%eax
call   1060 <test_add_several_crossing_times@plt>
xor    %eax,%eax
call   1070 <test_trip_doesnt_exist@plt>
xor    %eax,%eax
call   1040 <test_index_out_of_bounds@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_create_destroy()
%3 = call i32 (...) @test_add_single_crossing_time()
%4 = call i32 (...) @test_add_two_crossing_times()
%5 = call i32 (...) @test_add_several_crossing_times()
%6 = call i32 (...) @test_trip_doesnt_exist()
%7 = call i32 (...) @test_index_out_of_bounds()
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_create_destroy()
%2 = tail call i32 (...) @test_add_single_crossing_time()
%3 = tail call i32 (...) @test_add_two_crossing_times()
%4 = tail call i32 (...) @test_add_several_crossing_times()
%5 = tail call i32 (...) @test_trip_doesnt_exist()
%6 = tail call i32 (...) @test_index_out_of_bounds()
ret i32 1
}
/* Variables and functions */
double omp_get_wtime();
extern double currentTime() { return omp_get_wtime(); }


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

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

LLVM IR (-O0):
define double @currentTime() {
%1 = call double (...) @omp_get_wtime()
ret double %1
}

LLVM IR (-O2):
define double @currentTime() {
%1 = tail call double (...) @omp_get_wtime()
ret double %1
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ LOG_AUTH;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vsyslog(int, char const *, int /*<<< orphan*/);
void pusb_log_syslog(int level, const char *format, va_list ap) {
  openlog("pam_usb", LOG_PID, LOG_AUTH);
  vsyslog(level, format, ap);
  closelog();
}


x86 assembly (clang, -O0):
<pusb_log_syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
lea    0xea5(%rip),%rdi
call   1050 <openlog@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vsyslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pusb_log_syslog>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xeab(%rip),%rdi
call   1050 <openlog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <vsyslog@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"pam_usb\00"
@LOG_PID = global i32 0
@LOG_AUTH = global i32 0
define void @pusb_log_syslog(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @LOG_PID
%8 = load i32, i32* @LOG_AUTH
%9 = call i32 @openlog(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @vsyslog(i32 %10, i8* %11, i32 %12)
%14 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"pam_usb\00"
@LOG_PID = global i32 0
@LOG_AUTH = global i32 0
define void @pusb_log_syslog(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @LOG_PID
%5 = load i32, i32* @LOG_AUTH
%6 = tail call i32 @openlog(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = tail call i32 @vsyslog(i32 %0, i8* %1, i32 %2)
%8 = tail call i32 (...) @closelog()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
char *gethname(int /*<<< orphan*/);
int /*<<< orphan*/ isdigit(int);
char *strchr(char *, char);
char *getsname(u_int32_t a) {
  char *s, *cp;
  s = gethname(a);
  if (!isdigit((int)*s)) {
    cp = strchr(s, '.');
    if (cp != NULL)
      *cp = '\0';
  }
  return (s);
}


x86 assembly (clang, -O0):
<getsname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <gethname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1185 <getsname+0x55>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1180 <getsname+0x50>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1185 <getsname+0x55>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsname>:
push   %rbx
call   1040 <gethname@plt>
mov    %rax,%rbx
movsbl (%rax),%eax
add    $0xffffffd0,%eax
cmp    $0xa,%eax
jb     1149 <getsname+0x29>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1149 <getsname+0x29>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getsname(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i8* @gethname(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 @isdigit(i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i8* @strchr(i8* %13, i8 signext 46)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i8*, i8** %4
store i8 0, i8* %18
br label %19
19: ; preds = %17, %12
br label %20
20: ; preds = %19, %1
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @getsname(i32 %0) {
%2 = tail call i8* @gethname(i32 %0)
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, -48
%6 = icmp ult i32 %5, 10
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = tail call i8* @strchr(i8* %2, i8 signext 46)
%9 = icmp eq i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %7
store i8 0, i8* %8
br label %11
11: ; preds = %7, %10, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void assertTrue(const char *desc, int x) {
  if (x == 0) {
    printf("ASSERTION FAILED: %s\n", desc);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<assertTrue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1153 <assertTrue+0x33>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertTrue>:
test   %esi,%esi
je     1125 <assertTrue+0x5>
ret
push   %rax
mov    %rdi,%rax
lea    0xed0(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"ASSERTION FAILED: %s\0A\00"
define void @assertTrue(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"ASSERTION FAILED: %s\0A\00"
define void @assertTrue(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
ret void
}
char *decirHolaMundo() { return "Hola Mundo"; }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hola Mundo\00"
define i8* @decirHolaMundo() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hola Mundo\00"
define i8* @decirHolaMundo() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int celix_utils_stringEquals(char const *, char const *);
int utils_stringEquals(const void *string, const void *toCompare) {
  return celix_utils_stringEquals((const char *)string,
                                  (const char *)toCompare);
}


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

x86 assembly (clang, -O2):
<utils_stringEquals>:
jmp    1030 <celix_utils_stringEquals@plt>

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

LLVM IR (-O2):
define i32 @utils_stringEquals(i8* %0, i8* %1) {
%3 = tail call i32 @celix_utils_stringEquals(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("Hello, world\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello, world\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, double, int);
char *tmpl_insert(char *tmpl, int n, double val) {
  char *s;
  asprintf(&s, tmpl, val, n);
  return s;
}


x86 assembly (clang, -O0):
<tmpl_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0xc(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1030 <asprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpl_insert>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @tmpl_insert(i8* %0, i32 %1, double %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store double %2, double* %6
%8 = load i8*, i8** %4
%9 = load double, double* %6
%10 = load i32, i32* %5
%11 = call i32 @asprintf(i8** %7, i8* %8, double %9, i32 %10)
%12 = load i8*, i8** %7
ret i8* %12
}

LLVM IR (-O2):
define i8* @tmpl_insert(i8* %0, i32 %1, double %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i32 @asprintf(i8** %4, i8* %0, double %2, i32 %1)
%7 = load i8*, i8** %4
ret i8* %7
}
int numBuckets(int numElements) { return 26; }


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

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

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

LLVM IR (-O2):
define i32 @numBuckets(i32 %0) {
ret i32 26
}
int getWaitStopSig(int *a) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @getWaitStopSig(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
unsigned long z_adler32(long, char const *, unsigned int);
unsigned long ADLER32(const char *buf, unsigned int len) {
  return z_adler32(1L, buf, len);
}


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

x86 assembly (clang, -O2):
<ADLER32>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <z_adler32@plt>

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

LLVM IR (-O2):
define i64 @ADLER32(i8* %0, i32 %1) {
%3 = tail call i64 @z_adler32(i64 1, i8* %0, i32 %1)
ret i64 %3
}
int float2Int(register float convert) {
  register int ans;
  ans = (int)convert;
  convert -= ans;
  if (convert >= 0.5)
    ans++;
  return ans;
}


x86 assembly (clang, -O0):
<float2Int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1148 <float2Int+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float2Int>:
cvttss2si %xmm0,%eax
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
ucomiss 0xeea(%rip),%xmm0
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @float2Int(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
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = fsub float %8, %7
store float %9, float* %2
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp oge double %11, 5.000000e-01
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @float2Int(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fcmp oge float %4, 5.000000e-01
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ MAP_HUGETLB;
int /*<<< orphan*/ mmap_chunks_lower(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void alloc_huge_below_hint(int chunks) {
  printf("Allocating hugepage chunks < 128TB \n");
  mmap_chunks_lower(chunks, MAP_HUGETLB);
}


x86 assembly (clang, -O0):
<alloc_huge_below_hint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1040 <mmap_chunks_lower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_huge_below_hint>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <mmap_chunks_lower@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Allocating hugepage chunks < 128TB \0A\00"
@MAP_HUGETLB = global i32 0
define void @alloc_huge_below_hint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = load i32, i32* @MAP_HUGETLB
%6 = call i32 @mmap_chunks_lower(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@MAP_HUGETLB = global i32 0
@str = [36 x i8] c"Allocating hugepage chunks < 128TB \00"
define void @alloc_huge_below_hint(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @MAP_HUGETLB
%4 = tail call i32 @mmap_chunks_lower(i32 %0, i32 %3)
ret void
}