xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ gluOrtho2D(double, double, double, double);
void init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  gluOrtho2D(-600.0, 600.0, -600.0, 600.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
movsd  0xec3(%rip),%xmm2
movsd  0xec3(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
call   1040 <gluOrtho2D@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
movsd  0xec6(%rip),%xmm0
movsd  0xec6(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
pop    %rax
jmp    1040 <gluOrtho2D@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = call i32 @gluOrtho2D(double -6.000000e+02, double 6.000000e+02, double -6.000000e+02, double 6.000000e+02)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = tail call i32 @gluOrtho2D(double -6.000000e+02, double 6.000000e+02, double -6.000000e+02, double 6.000000e+02)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t be16dec(const void *buf) {
  const uint8_t *p = (const uint8_t *)buf;
  return (uint16_t)((p[0] << 8) | p[1]);
}


x86 assembly (clang, -O0):
<be16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be16dec>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @be16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @be16dec(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ increase_maximum_number_of_open_files();
int /*<<< orphan*/ sethostent(int);
void initialize_network() {
  increase_maximum_number_of_open_files();
  sethostent(1);
}


x86 assembly (clang, -O0):
<initialize_network>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <increase_maximum_number_of_open_files@plt>
mov    $0x1,%edi
call   1040 <sethostent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_network>:
push   %rax
xor    %eax,%eax
call   1030 <increase_maximum_number_of_open_files@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sethostent@plt>

LLVM IR (-O0):
define void @initialize_network() {
%1 = call i32 (...) @increase_maximum_number_of_open_files()
%2 = call i32 @sethostent(i32 1)
ret void
}

LLVM IR (-O2):
define void @initialize_network() {
%1 = tail call i32 (...) @increase_maximum_number_of_open_files()
%2 = tail call i32 @sethostent(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
size_t getN(int n) {
  unsigned char buf[n];
  return sizeof(buf);
}


x86 assembly (clang, -O0):
<getN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @getN(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @getN(i32 %0) {
%2 = zext i32 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void version(void) {
  fputs("erf (NWN ERF Utility) "
        "1.3"
        "\n"
        "Original Copyright (C) 2003, Gareth Hughes. Copyright (C) 2014,2016 "
        "Meaglyn"
        "\n",
        stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [103 x i8] c"erf (NWN ERF Utility) 1.3\0AOriginal Copyright (C) 2003, Gareth Hughes. Copyright (C) 2014,2016 Meaglyn\0A\00"
@stdout = global i32 0
define void @version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [103 x i8] c"erf (NWN ERF Utility) 1.3\0AOriginal Copyright (C) 2003, Gareth Hughes. Copyright (C) 2014,2016 Meaglyn\0A\00"
@stdout = global i32 0
define void @version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void genc_ngt_s() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @cleanup_hitcache() {
ret void
}
void flush_tlb_mm(struct mm_struct *mm) {}


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

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

LLVM IR (-O0):
%struct.mm_struct = type opaque
define void @flush_tlb_mm(%struct.mm_struct* %0) {
%2 = alloca %struct.mm_struct*
store %struct.mm_struct* %0, %struct.mm_struct** %2
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @flush_tlb_mm(%struct.mm_struct* nocapture %0) {
ret void
}
/* Type definitions */
struct passwd {
  char const *pw_name;
};

/* Variables and functions */
const char *passwd_getname(const void *ent) {
  const struct passwd *pw = ent;
  return pw->pw_name;
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @passwd_getname(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.passwd*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.passwd*
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %6, i32 0, i32 0
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @passwd_getname(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: bin2c <infile> <outfile> <array-decl>\n\n");
  printf(
      "Where <infile> is the binary file to convert to C, <outfile> is the\n");
  printf("C source file to generate and <array-decl> is the array declaration "
         "to\n");
  printf("use in the C source file.\n\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf42(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: bin2c <infile> <outfile> <array-decl>\0A\0A\00"
@.str.1 = [69 x i8] c"Where <infile> is the binary file to convert to C, <outfile> is the\0A\00"
@.str.2 = [72 x i8] c"C source file to generate and <array-decl> is the array declaration to\0A\00"
@.str.3 = [28 x i8] c"use in the C source file.\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"Usage: bin2c <infile> <outfile> <array-decl>\0A\00"
@str.4 = [68 x i8] c"Where <infile> is the binary file to convert to C, <outfile> is the\00"
@str.5 = [71 x i8] c"C source file to generate and <array-decl> is the array declaration to\00"
@str.6 = [27 x i8] c"use in the C source file.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rig_realtime(void *);
void *realtime(void *p) {
  rig_realtime(p);
  return p;
}


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

x86 assembly (clang, -O2):
<realtime>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rig_realtime@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @realtime(i8* returned %0) {
%2 = tail call i32 @rig_realtime(i8* %0)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ num_bytes_array;

/* Variables and functions */
int write(int, unsigned char *, int);
int transmit_num_bytes(int fd, unsigned int num_bytes) {
  int i;
  unsigned char num_bytes_array[4];
  for (i = 0; i < 4; i++)
    num_bytes_array[i] = (unsigned char)((num_bytes >> (i * 8)) & 0xff);
  return write(fd, num_bytes_array, sizeof(num_bytes_array));
}


x86 assembly (clang, -O0):
<transmit_num_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1157 <transmit_num_bytes+0x47>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
shr    %cl,%eax
and    $0xff,%eax
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x10(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <transmit_num_bytes+0x15>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transmit_num_bytes>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @transmit_num_bytes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [4 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 8
%14 = lshr i32 %11, %13
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %10
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
%24 = load i32, i32* %3
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%26 = call i32 @write(i32 %24, i8* %25, i32 4)
ret i32 %26
}

LLVM IR (-O2):
define i32 @transmit_num_bytes(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %1, 16
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %10, i8* %11
%12 = lshr i32 %1, 24
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %13, i8* %14
%15 = call i32 @write(i32 %0, i8* %4, i32 4)
ret i32 %15
}
/* Variables and functions */
double M_PI_2;
double cosh(double);
double sinh(double);
double sqrt(int);
double tanh(double);
double ftrans(double y) {
  double x = M_PI_2 * sinh(y);
  double t = tanh(x);
  double c = cosh(x);
  return (sqrt(1 + t * t) / c) / c;
}


x86 assembly (clang, -O0):
<ftrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2e94(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <tanh@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <cosh@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe54(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
divsd  -0x20(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftrans>:
sub    $0x18,%rsp
mov    0x2e9d(%rip),%rax
movsd  (%rax),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <sinh@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <tanh@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cosh@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm0
addsd  0xe6c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI_2 = global double 0.000000e+00
define double @ftrans(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* @M_PI_2
%7 = load double, double* %2
%8 = call double @sinh(double %7)
%9 = fmul double %6, %8
store double %9, double* %3
%10 = load double, double* %3
%11 = call double @tanh(double %10)
store double %11, double* %4
%12 = load double, double* %3
%13 = call double @cosh(double %12)
store double %13, double* %5
%14 = load double, double* %4
%15 = load double, double* %4
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double 1.000000e+00)
%17 = fptosi double %16 to i32
%18 = call double @sqrt(i32 %17)
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = load double, double* %5
%22 = fdiv double %20, %21
ret double %22
}

LLVM IR (-O2):
@M_PI_2 = global double 0.000000e+00
define double @ftrans(double %0) {
%2 = load double, double* @M_PI_2
%3 = tail call double @sinh(double %0)
%4 = fmul double %2, %3
%5 = tail call double @tanh(double %4)
%6 = tail call double @cosh(double %4)
%7 = tail call double @llvm.fmuladd.f64(double %5, double %5, double 1.000000e+00)
%8 = fptosi double %7 to i32
%9 = tail call double @sqrt(i32 %8)
%10 = fdiv double %9, %6
%11 = fdiv double %10, %6
ret double %11
}
/* Variables and functions */
char *strrchr(char const *, char);
char *get_file_name(const char *file_name) {
  char *p;
  if (!file_name) {
    return (NULL);
  }
  if ((p = strrchr(file_name, '/'))) {
    return (p + 1);
  } else {
    return (NULL);
  }
}


x86 assembly (clang, -O0):
<get_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <get_file_name+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1169 <get_file_name+0x59>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1161 <get_file_name+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <get_file_name+0x59>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_name>:
test   %rdi,%rdi
je     1133 <get_file_name+0x23>
push   %rax
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rcx,%rax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @get_file_name(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* null, i8* %6
br label %8
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %7, %3 ]
ret i8* %9
}
void flush_icache_user_page(struct vm_area_struct *vma, struct page *page,
                            unsigned long addr, int len) {}


x86 assembly (clang, -O0):
<flush_icache_user_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @flush_icache_user_page(%struct.vm_area_struct* %0, %struct.page* %1, i64 %2, i32 %3) {
%5 = alloca %struct.vm_area_struct*
%6 = alloca %struct.page*
%7 = alloca i64
%8 = alloca i32
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %5
store %struct.page* %1, %struct.page** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @flush_icache_user_page(%struct.vm_area_struct* nocapture %0, %struct.page* nocapture %1, i64 %2, i32 %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ToBE16(int /*<<< orphan*/);
void WriteUnalignedBE16(uint16_t *p, uint16_t value) { *p = ToBE16(value); }


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

x86 assembly (clang, -O2):
<WriteUnalignedBE16>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <ToBE16@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @WriteUnalignedBE16(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @ToBE16(i32 %1)
store i32 %3, i32* %0
ret void
}
void rop3_182_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = *D & T;
  stk3 = S | stk4;
  stk2 = T ^ stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_182_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xe(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_182_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = and i32 %13, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %10
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = load i8, i8* %10
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i8, i8* %8
%34 = zext i8 %33 to i32
%35 = xor i32 %32, %34
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8, i8* %6
%44 = zext i8 %43 to i32
%45 = xor i32 %44, -1
%46 = and i32 %42, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %5
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = load i8*, i8** %4
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = load i8, i8* %6
%58 = zext i8 %57 to i32
%59 = and i32 %56, %58
%60 = or i32 %53, %59
%61 = trunc i32 %60 to i8
%62 = load i8*, i8** %4
store i8 %61, i8* %62
ret void
}

LLVM IR (-O2):
define void @rop3_182_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void utils_echo(char *line) { fprintf(stdout, "%s\n", line); }


x86 assembly (clang, -O0):
<utils_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_echo>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @utils_echo(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void av_md5_sum() {}


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

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

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

LLVM IR (-O2):
define void @av_md5_sum() {
ret void
}
int inc_hexchar(char *_c) {
  if (*_c == '9') {
    *_c = 'a';
    return 0;
  }
  if (*_c == 'f') {
    *_c = '0';
    return 1;
  }
  (*_c)++;
  return 0;
}


x86 assembly (clang, -O0):
<inc_hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jne    112b <inc_hexchar+0x2b>
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1160 <inc_hexchar+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x66,%eax
jne    114e <inc_hexchar+0x4e>
mov    -0x10(%rbp),%rax
movb   $0x30,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1160 <inc_hexchar+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_hexchar>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x39,%cl
je     1118 <inc_hexchar+0x18>
cmp    $0x66,%cl
jne    111d <inc_hexchar+0x1d>
mov    $0x1,%eax
mov    $0x30,%cl
mov    %cl,(%rdi)
ret
mov    $0x61,%cl
mov    %cl,(%rdi)
ret
add    $0x1,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define i32 @inc_hexchar(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 57
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 97, i8* %9
store i32 0, i32* %2
br label %21
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 102
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %3
store i8 48, i8* %16
store i32 1, i32* %2
br label %21
17: ; preds = %10
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = add i8 %19, 1
store i8 %20, i8* %18
store i32 0, i32* %2
br label %21
21: ; preds = %17, %15, %8
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @inc_hexchar(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %4 [
i8 57, label %6
i8 102, label %3
]
3: ; preds = %1
br label %6
4: ; preds = %1
%5 = add i8 %2, 1
br label %6
6: ; preds = %1, %4, %3
%7 = phi i8 [ %5, %4 ], [ 48, %3 ], [ 97, %1 ]
%8 = phi i32 [ 0, %4 ], [ 1, %3 ], [ 0, %1 ]
store i8 %7, i8* %0
ret i32 %8
}
void nop1(void *a1) { return; }


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

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

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

LLVM IR (-O2):
define void @nop1(i8* nocapture %0) {
ret void
}
const char *get_lame_very_short_version(void) {
  static const char *const str = "LAME"
                                 "3"
                                 "."
                                 "93"
                                 " ";
  return str;
}


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

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

LLVM IR (-O0):
@get_lame_very_short_version.str = internal constant i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0)
@.str = [10 x i8] c"LAME3.93 \00"
define i8* @get_lame_very_short_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"LAME3.93 \00"
define i8* @get_lame_very_short_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgand(void) { gen("andq\t%rcx,%rax"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"andq\09%rcx,%rax\00"
define void @cgand() {
%1 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"andq\09%rcx,%rax\00"
define void @cgand() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ syslog(int, char *, char const *);
void syslog_msg_with_name(const char *name, int facility, int pri,
                          const char *msg) {
  openlog(name, 0, facility);
  syslog(pri, "%s", msg);
  closelog();
}


x86 assembly (clang, -O0):
<syslog_msg_with_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1050 <openlog@plt>
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xe9e(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syslog_msg_with_name>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %esi,%edx
xor    %esi,%esi
call   1050 <openlog@plt>
lea    0xeb8(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <closelog@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @syslog_msg_with_name(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @openlog(i8* %0, i32 0, i32 %1)
%6 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int mixed_volume(int *mv) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(78, mv, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<mixed_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x4e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixed_volume>:
mov    %rdi,%rsi
mov    $0x4e,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @mixed_volume(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 78, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @mixed_volume(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 78, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_sshkey() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_sshkey>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dummy_sshkey() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int mvscanw(int, int, char *, char *);
int s_mvscanw(int y, int x, char *fmt, char *string) {
  return (mvscanw(y, x, fmt, string));
}


x86 assembly (clang, -O0):
<s_mvscanw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <mvscanw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_mvscanw>:
jmp    1030 <mvscanw@plt>

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

LLVM IR (-O2):
define i32 @s_mvscanw(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @mvscanw(i32 %0, i32 %1, i8* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int const floor(double);
int pow(int, int);
double round_decimal(double value, int precision) {
  const int adjustment = pow(10, precision);
  return floor(value * adjustment + 0.5) / adjustment;
}


x86 assembly (clang, -O0):
<round_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %eax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeaa(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <floor@plt>
cltd
idivl  -0x10(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_decimal>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%esi
movsd  %xmm0,0x8(%rsp)
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0xeb2(%rip),%xmm0
call   1040 <floor@plt>
cltd
idiv   %ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @round_decimal(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @pow(i32 10, i32 %6)
store i32 %7, i32* %5
%8 = load double, double* %3
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %8, double %10, double 5.000000e-01)
%12 = call i32 @floor(double %11)
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
%15 = sitofp i32 %14 to double
ret double %15
}

LLVM IR (-O2):
define double @round_decimal(double %0, i32 %1) {
%3 = tail call i32 @pow(i32 10, i32 %1)
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %0, double %4, double 5.000000e-01)
%6 = tail call i32 @floor(double %5)
%7 = sdiv i32 %6, %3
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int Index(int);
void InitMonitoring3D(int bitchoice) {
  int idx, r = 1;
  while (bitchoice) {
    if (bitchoice & 1) {
      idx = Index(r);
    }
    bitchoice >>= 1;
    r <<= 1;
  }
}


x86 assembly (clang, -O0):
<InitMonitoring3D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115d <InitMonitoring3D+0x4d>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1146 <InitMonitoring3D+0x36>
mov    -0xc(%rbp),%edi
call   1030 <Index@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <InitMonitoring3D+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitMonitoring3D>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     113b <InitMonitoring3D+0x2b>
mov    %edi,%ebx
mov    $0x1,%ebp
jmp    112d <InitMonitoring3D+0x1d>
mov    %ebx,%eax
sar    %eax
add    %ebp,%ebp
cmp    $0x1,%ebx
mov    %eax,%ebx
jbe    113b <InitMonitoring3D+0x2b>
test   $0x1,%bl
je     1120 <InitMonitoring3D+0x10>
mov    %ebp,%edi
call   1030 <Index@plt>
jmp    1120 <InitMonitoring3D+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @InitMonitoring3D(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %4
%14 = call i32 @Index(i32 %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %2
%17 = ashr i32 %16, 1
store i32 %17, i32* %2
%18 = load i32, i32* %4
%19 = shl i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @InitMonitoring3D(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %10
%4 = phi i32 [ %12, %10 ], [ 1, %1 ]
%5 = phi i32 [ %11, %10 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @Index(i32 %4)
br label %10
10: ; preds = %8, %3
%11 = ashr i32 %5, 1
%12 = shl i32 %4, 1
%13 = icmp ult i32 %5, 2
br i1 %13, label %14, label %3
14: ; preds = %10, %1
ret void
}
/* Variables and functions */
scalar_t__ roundf(float);
long long int llroundf(float x) { return (long long int)roundf(x); }


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

x86 assembly (clang, -O2):
<llroundf>:
jmp    1030 <roundf@plt>

LLVM IR (-O0):
define i64 @llroundf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @roundf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llroundf(float %0) {
%2 = tail call i64 @roundf(float %0)
ret i64 %2
}
int _is_base64_digit(char s) {
  if ((s >= 48 && s <= 57) || (s >= 65 && s <= 90) || (s >= 97 && s <= 122) ||
      s == '+' || s == '/')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<_is_base64_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <_is_base64_digit+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1172 <_is_base64_digit+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     113e <_is_base64_digit+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1172 <_is_base64_digit+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1158 <_is_base64_digit+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1172 <_is_base64_digit+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1172 <_is_base64_digit+0x72>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    117e <_is_base64_digit+0x7e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <_is_base64_digit+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_base64_digit>:
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%cl
jb     112d <_is_base64_digit+0x2d>
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%cl
jb     112d <_is_base64_digit+0x2d>
lea    -0x61(%rdi),%eax
cmp    $0x1a,%al
setb   %al
and    $0xfb,%dil
cmp    $0x2b,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_is_base64_digit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %35, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %35, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 122
br i1 %26, label %35, label %27
27: ; preds = %23, %19
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 43
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 47
br i1 %34, label %35, label %36
35: ; preds = %31, %27, %23, %15, %7
store i32 1, i32* %2
br label %37
36: ; preds = %31
store i32 0, i32* %2
br label %37
37: ; preds = %36, %35
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @_is_base64_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 26
%6 = or i1 %3, %5
br i1 %6, label %14, label %7
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 26
%10 = and i8 %0, -5
%11 = icmp eq i8 %10, 43
%12 = or i1 %11, %9
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %7, %1
%15 = phi i32 [ 1, %1 ], [ %13, %7 ]
ret i32 %15
}
int fsl_udc_clk_init(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @fsl_udc_clk_init(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
int DummyCDInit(__attribute((unused)) const char *cdrom_name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DummyCDInit(i8* nocapture readnone %0) {
ret i32 0
}
int Min(int x, int y) {
  if (x < y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<Min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <Min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void foo(const int *x) {
  int *tmp = x;
  *tmp = 5;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
store i32 5, i32* %0
ret void
}
/* Variables and functions */
int __socketcall(int, unsigned long *);
int socketpair(int family, int type, int protocol, int sockvec[2]) {
  unsigned long args[4];
  args[0] = family;
  args[1] = type;
  args[2] = protocol;
  args[3] = (unsigned long)sockvec;
  return __socketcall(8, args);
}


x86 assembly (clang, -O0):
<socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x40(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x40(%rbp),%rsi
mov    $0x8,%edi
call   1030 <__socketcall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketpair>:
sub    $0x28,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
movslq %esi,%rax
mov    %rax,0x8(%rsp)
movslq %edx,%rax
mov    %rax,0x10(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edi
call   1030 <__socketcall@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [4 x i64]
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 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 0
store i64 %11, i64* %12
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 1
store i64 %14, i64* %15
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 2
store i64 %17, i64* %18
%19 = load i32*, i32** %8
%20 = ptrtoint i32* %19 to i64
%21 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 3
store i64 %20, i64* %21
%22 = getelementptr inbounds [4 x i64], [4 x i64]* %9, i64 0, i64 0
%23 = call i32 @__socketcall(i32 8, i64* %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [4 x i64]
%6 = bitcast [4 x i64]* %5 to i8*
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 0
store i64 %7, i64* %8
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 1
store i64 %9, i64* %10
%11 = sext i32 %2 to i64
%12 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 2
store i64 %11, i64* %12
%13 = ptrtoint i32* %3 to i64
%14 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 3
store i64 %13, i64* %14
%15 = call i32 @__socketcall(i32 8, i64* %8)
ret i32 %15
}
/* Variables and functions */
unsigned int gettick_real();
unsigned int gettick_nocache(void) { return gettick_real(); }


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

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

LLVM IR (-O0):
define i32 @gettick_nocache() {
%1 = call i32 (...) @gettick_real()
ret i32 %1
}

LLVM IR (-O2):
define i32 @gettick_nocache() {
%1 = tail call i32 (...) @gettick_real()
ret i32 %1
}