xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
scalar_t__ SSIZE_MAX;
size_t off_to_size(off_t off_bytes) {
  if (off_bytes > SSIZE_MAX) {
    return SSIZE_MAX;
  }
  return off_bytes;
}


x86 assembly (clang, -O0):
<off_to_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ed5(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <off_to_size+0x2f>
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <off_to_size+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<off_to_size>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
cmovge %rdi,%rax
ret

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

LLVM IR (-O2):
@SSIZE_MAX = global i64 0
define i64 @off_to_size(i64 %0) {
%2 = load i64, i64* @SSIZE_MAX
%3 = icmp slt i64 %2, %0
%4 = select i1 %3, i64 %2, i64 %0
ret i64 %4
}
/* Variables and functions */
int strcmp(char *, char *);
int sort_name(char s1[], char s2[]) { return strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<sort_name>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @sort_name(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage() {
  fputs("Program save contents of console in PNM file\n"
        "(PNM is printed on standard output\n"
        "\n"
        "usage:\n"
        "\tttyscreenshot [8|9] console-num\n"
        "\n"
        "First argument is a character width in pixels;\n"
        "9 pixels is a default width use by EGA/VGA cards,\n"
        "8 pixels isn't.\n"
        "\n"
        "You need permissions to read /dev/vcsa[console-num] device.\n",
        stderr);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@.str = [297 x i8] c"Program save contents of console in PNM file\0A(PNM is printed on standard output\0A\0Ausage:\0A\09ttyscreenshot [8|9] console-num\0A\0AFirst argument is a character width in pixels;\0A9 pixels is a default width use by EGA/VGA cards,\0A8 pixels isn't.\0A\0AYou need permissions to read /dev/vcsa[console-num] device.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([297 x i8], [297 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [297 x i8] c"Program save contents of console in PNM file\0A(PNM is printed on standard output\0A\0Ausage:\0A\09ttyscreenshot [8|9] console-num\0A\0AFirst argument is a character width in pixels;\0A9 pixels is a default width use by EGA/VGA cards,\0A8 pixels isn't.\0A\0AYou need permissions to read /dev/vcsa[console-num] device.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([297 x i8], [297 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int dunno_decy(uint32_t x1, uint32_t x2, uint32_t x3) {
  if ((((x1 >> 9) & 1) + ((x2 >> 11) & 1) + ((x3 >> 11) & 1)) <= 1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<dunno_decy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x9,%eax
and    $0x1,%eax
mov    -0xc(%rbp),%ecx
sar    $0xb,%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
sar    $0xb,%ecx
and    $0x1,%ecx
add    %ecx,%eax
cmp    $0x1,%eax
jg     1141 <dunno_decy+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <dunno_decy+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dunno_decy>:
shr    $0x9,%edi
and    $0x1,%edi
shr    $0xb,%esi
and    $0x1,%esi
add    %edi,%esi
shr    $0xb,%edx
and    $0x1,%edx
add    %esi,%edx
xor    %eax,%eax
cmp    $0x2,%edx
setb   %al
ret

LLVM IR (-O0):
define i32 @dunno_decy(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = ashr i32 %8, 9
%10 = and i32 %9, 1
%11 = load i32, i32* %6
%12 = ashr i32 %11, 11
%13 = and i32 %12, 1
%14 = add nsw i32 %10, %13
%15 = load i32, i32* %7
%16 = ashr i32 %15, 11
%17 = and i32 %16, 1
%18 = add nsw i32 %14, %17
%19 = icmp sle i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %3
store i32 1, i32* %4
br label %22
21: ; preds = %3
store i32 0, i32* %4
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @dunno_decy(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, 9
%5 = and i32 %4, 1
%6 = lshr i32 %1, 11
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %2, 11
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %8, %10
%12 = icmp ult i32 %11, 2
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int pow(int, int);
int dist(int y0, int x0, int y1, int x1) {
  return pow(y0 - y1, 2) + pow(x0 - x1, 2);
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
sub    %edx,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %eax,%ebx
sub    %r14d,%ebp
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = call i32 @pow(i32 %11, i32 2)
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = call i32 @pow(i32 %15, i32 2)
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @dist(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = tail call i32 @pow(i32 %5, i32 2)
%7 = sub nsw i32 %1, %3
%8 = tail call i32 @pow(i32 %7, i32 2)
%9 = add nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r, A;
  scanf("%lf", &r);
  A = 3.14159 * r * r;
  printf("A=%.4lf\n", A);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fmul double 3.141590e+00, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"A=%.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 3.141590e+00
%6 = fmul double %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fixpt_div(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ fixpt_from_int(int);
int fixpt_to_int(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  assert(fixpt_to_int(fixpt_div(fixpt_from_int(1), fixpt_from_int(1))) == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <fixpt_from_int@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1030 <fixpt_from_int@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <fixpt_div@plt>
mov    %eax,%edi
call   1060 <fixpt_to_int@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1030 <fixpt_from_int@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <fixpt_from_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <fixpt_div@plt>
mov    %eax,%edi
call   1060 <fixpt_to_int@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @fixpt_from_int(i32 1)
%7 = call i32 @fixpt_from_int(i32 1)
%8 = call i32 @fixpt_div(i32 %6, i32 %7)
%9 = call i32 @fixpt_to_int(i32 %8)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fixpt_from_int(i32 1)
%4 = tail call i32 @fixpt_from_int(i32 1)
%5 = tail call i32 @fixpt_div(i32 %3, i32 %4)
%6 = tail call i32 @fixpt_to_int(i32 %5)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 0
}
void set_tui_attach_device(unsigned int id) {}


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

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

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

LLVM IR (-O2):
define void @set_tui_attach_device(i32 %0) {
ret void
}
void bootblock_mainboard_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bootblock_mainboard_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ our_gets(char *);
int /*<<< orphan*/ puts(char *);
void echo() {
  char buf[8];
  our_gets(buf);
  puts(buf);
}


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

x86 assembly (clang, -O2):
<echo>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <our_gets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @echo() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @our_gets(i8* %2)
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
ret void
}

LLVM IR (-O2):
define void @echo() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @our_gets(i8* %2)
%4 = call i32 @puts(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int rawwifi_setup_interface(const char *name, uint32_t channel,
                            uint32_t txpower, uint32_t bHT, uint32_t bitrate) {
  return 0;
}


x86 assembly (clang, -O0):
<rawwifi_setup_interface>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rawwifi_setup_interface(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @rawwifi_setup_interface(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ left_shfit32();
int main() {
  left_shfit32();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @left_shfit32()
%2 = tail call i32 @exit(i32 0)
unreachable
}
double eval_unneg(double x, double y) { return !y; }


x86 assembly (clang, -O0):
<eval_unneg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_unneg>:
xorpd  %xmm2,%xmm2
cmpeqsd %xmm1,%xmm2
movsd  0xeef(%rip),%xmm0
andpd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @eval_unneg(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp une double %5, 0.000000e+00
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @eval_unneg(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
%4 = uitofp i1 %3 to double
ret double %4
}
/* Type definitions */
struct itimerval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _getitimer(int which, struct itimerval *value) {
  errno = ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_getitimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getitimer>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_getitimer(i32 %0, %struct.itimerval* %1) {
%3 = alloca i32
%4 = alloca %struct.itimerval*
store i32 %0, i32* %3
store %struct.itimerval* %1, %struct.itimerval** %4
%5 = load i32, i32* @ENOTSUP
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_getitimer(i32 %0, %struct.itimerval* nocapture readnone %1) {
%3 = load i32, i32* @ENOTSUP
store i32 %3, i32* @errno
ret i32 -1
}
int Send_ETH(void *Block, unsigned int len) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Send_ETH(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t sbrk(int incr) {}


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

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

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

LLVM IR (-O2):
define i32 @sbrk(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int);
int main() {
  printf("char: %i \nshort: %i \nint: %i \nfloat: %i \ndouble: %i \nlong: %i "
         "\nlong long: %i \n",
         (int)sizeof(char), (int)sizeof(short), (int)sizeof(int),
         (int)sizeof(float), (int)sizeof(double), (int)sizeof(long),
         (int)sizeof(long long));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%r8d
mov    $0x8,%r9d
mov    %r8d,%ecx
movl   $0x8,(%rsp)
movl   $0x8,0x8(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
mov    $0x8,%r9d
push   $0x8
push   $0x8
call   1030 <printf@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c"char: %i \0Ashort: %i \0Aint: %i \0Afloat: %i \0Adouble: %i \0Along: %i \0Along long: %i \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 4, i32 4, i32 8, i32 8, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [79 x i8] c"char: %i \0Ashort: %i \0Aint: %i \0Afloat: %i \0Adouble: %i \0Along: %i \0Along long: %i \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 4, i32 4, i32 8, i32 8, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
void SOS_Locate(const char *file, const char *func, int line) {
  printf("In module %s, function: %s, line %d:\n", file, func, line);
}


x86 assembly (clang, -O0):
<SOS_Locate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SOS_Locate>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"In module %s, function: %s, line %d:\0A\00"
define void @SOS_Locate(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"In module %s, function: %s, line %d:\0A\00"
define void @SOS_Locate(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
char *duplica_string(char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s;
  char *s_duplicado;
  s = (char *)malloc(sizeof(char));
  s = "Campos verdes";
  s_duplicado = duplica_string(s);
  printf("%s\n", s_duplicado);
  free(s_duplicado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <duplica_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1060 <malloc@plt>
lea    0xeae(%rip),%rdi
call   1050 <duplica_string@plt>
mov    %rax,%rbx
lea    0xead(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @duplica_string(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1)
%2 = tail call i8* @duplica_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
int(ars_d_set_tcpopt_echo)(struct ars_packet *pkt, int layer, char *f,
                           char *v) {
  return 0;
}


x86 assembly (clang, -O0):
<ars_d_set_tcpopt_echo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_tcpopt_echo(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_tcpopt_echo(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
void XDestroyImage() {}


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

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

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

LLVM IR (-O2):
define void @XDestroyImage() {
ret void
}
int n_th_even_iter(int n) {
  int count = 0;
  int i;
  int n_th_even = 0;
  for (i = 0; count <= n; i++) {
    if (i % 2 == 0) {
      count++;
      n_th_even = i;
    }
  }
  return n_th_even;
}


x86 assembly (clang, -O0):
<n_th_even_iter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     115e <n_th_even_iter+0x5e>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114b <n_th_even_iter+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1150 <n_th_even_iter+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <n_th_even_iter+0x1c>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_th_even_iter>:
xor    %eax,%eax
test   %edi,%edi
js     112a <n_th_even_iter+0x2a>
xor    %ecx,%ecx
xor    %r8d,%r8d
nopl   0x0(%rax,%rax,1)
mov    %ecx,%edx
and    $0x1,%edx
mov    %edx,%esi
xor    $0x1,%esi
add    %esi,%r8d
test   %edx,%edx
cmove  %ecx,%eax
add    $0x1,%ecx
cmp    %edi,%r8d
jle    1110 <n_th_even_iter+0x10>
ret

LLVM IR (-O0):
define i32 @n_th_even_iter(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %5
store i32 0, i32* %4
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %4
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %4
store i32 %17, i32* %5
br label %18
18: ; preds = %14, %10
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @n_th_even_iter(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %12, %3 ], [ 0, %1 ]
%6 = phi i32 [ %10, %3 ], [ 0, %1 ]
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
%9 = xor i32 %7, 1
%10 = add nuw nsw i32 %9, %6
%11 = select i1 %8, i32 %5, i32 %4
%12 = add nuw nsw i32 %5, 1
%13 = icmp sgt i32 %10, %0
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %15
}
int guild_skill_get_inf(int id) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ p264_pixel_avg_weight_w8_mmxext(int /*<<< orphan*/ *, int,
                                                   int /*<<< orphan*/ *, int,
                                                   int, int);
void p264_pixel_avg_weight_8x16_mmxext(uint8_t *dst, int i_dst, uint8_t *src,
                                       int i_src, int i_weight_dst) {
  p264_pixel_avg_weight_w8_mmxext(dst, i_dst, src, i_src, i_weight_dst, 16);
}


x86 assembly (clang, -O0):
<p264_pixel_avg_weight_8x16_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x10,%r9d
call   1030 <p264_pixel_avg_weight_w8_mmxext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_pixel_avg_weight_8x16_mmxext>:
mov    $0x10,%r9d
jmp    1030 <p264_pixel_avg_weight_w8_mmxext@plt>

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

LLVM IR (-O2):
define void @p264_pixel_avg_weight_8x16_mmxext(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @p264_pixel_avg_weight_w8_mmxext(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "Usage: chown"
                        " <path> <uid> <gid>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: chown <path> <uid> <gid>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: chown <path> <uid> <gid>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void UYVYToUVRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToUVRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ o5_write();
int /*<<< orphan*/ write_flush();
void wo5_flush() {
  o5_write();
  write_flush();
}


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

x86 assembly (clang, -O2):
<wo5_flush>:
push   %rax
xor    %eax,%eax
call   1030 <o5_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_flush@plt>

LLVM IR (-O0):
define void @wo5_flush() {
%1 = call i32 (...) @o5_write()
%2 = call i32 (...) @write_flush()
ret void
}

LLVM IR (-O2):
define void @wo5_flush() {
%1 = tail call i32 (...) @o5_write()
%2 = tail call i32 (...) @write_flush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ stderr;
int socket_version() {
  fprintf(stderr,
          "Socket Wrapper by Eshin Kunishima\nI love POSIX API. (%li)\n",
          200809L);
  return 0;
}


x86 assembly (clang, -O0):
<socket_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x31069,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_version>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x31069,%edx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"Socket Wrapper by Eshin Kunishima\0AI love POSIX API. (%li)\0A\00"
define i32 @socket_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 200809)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"Socket Wrapper by Eshin Kunishima\0AI love POSIX API. (%li)\0A\00"
define i32 @socket_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 200809)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Print(char *);
int /*<<< orphan*/ nap(int);
void nocash(void) {
  Print("Whattaya trying to pull on me? You aint got the cash!");
  nap(1200);
}


x86 assembly (clang, -O0):
<nocash>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Print@plt>
mov    $0x4b0,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocash>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Print@plt>
mov    $0x4b0,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Whattaya trying to pull on me? You aint got the cash!\00"
define void @nocash() {
%1 = call i32 @Print(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @nap(i32 1200)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Whattaya trying to pull on me? You aint got the cash!\00"
define void @nocash() {
%1 = tail call i32 @Print(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @nap(i32 1200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m4x4_translate(int /*<<< orphan*/, float, float, float);
int /*<<< orphan*/ matrixstack_head();
void matrixstack_translate(float x, float y) {
  m4x4_translate(matrixstack_head(), x, y, 0.0f);
}


x86 assembly (clang, -O0):
<matrixstack_translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <matrixstack_head@plt>
mov    %eax,%edi
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1040 <m4x4_translate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixstack_translate>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <matrixstack_head@plt>
xorps  %xmm2,%xmm2
mov    %eax,%edi
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
pop    %rax
jmp    1040 <m4x4_translate@plt>

LLVM IR (-O0):
define void @matrixstack_translate(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call i32 (...) @matrixstack_head()
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call i32 @m4x4_translate(i32 %5, float %6, float %7, float 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @matrixstack_translate(float %0, float %1) {
%3 = tail call i32 (...) @matrixstack_head()
%4 = tail call i32 @m4x4_translate(i32 %3, float %0, float %1, float 0.000000e+00)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double timeval_double(const struct timeval *tv) {
  return (double)tv->tv_sec + ((double)tv->tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<timeval_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_double>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @timeval_double(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @timeval_double(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %8, %4
ret double %9
}
/* Variables and functions */
int __show_config(int);
int show_config(char **args, int num_args) { return __show_config(3); }


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

x86 assembly (clang, -O2):
<show_config>:
mov    $0x3,%edi
jmp    1030 <__show_config@plt>

LLVM IR (-O0):
define i32 @show_config(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 @__show_config(i32 3)
ret i32 %5
}

LLVM IR (-O2):
define i32 @show_config(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @__show_config(i32 3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ killsrv();
void sigabrt(int sig) { killsrv(); }


x86 assembly (clang, -O0):
<sigabrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <killsrv@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sigabrt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @killsrv()
ret void
}

LLVM IR (-O2):
define void @sigabrt(i32 %0) {
%2 = tail call i32 (...) @killsrv()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t swap16(uint16_t v) {
  uint8_t ret[2];
  ret[0] = v >> 8;
  ret[1] = v;
  return (*((uint16_t *)ret));
}


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
mov    %edi,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @swap16(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 8
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %7, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @swap16(i32 %0) {
%2 = ashr i32 %0, 8
ret i32 %2
}
/* Variables and functions */
unsigned int rand();
int fillbuf_rand(unsigned buf[], unsigned num) {
  unsigned u;
  for (u = 0; u < num; u++)
    buf[u] = rand();
  return 0;
}


x86 assembly (clang, -O0):
<fillbuf_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1153 <fillbuf_rand+0x43>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fillbuf_rand+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillbuf_rand>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1144 <fillbuf_rand+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fillbuf_rand+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @fillbuf_rand(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @fillbuf_rand(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i32 (...) @rand()
%9 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %8, i32* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i = 0;
  int j;
  for (i = 0; i < 1000; i++) {
    j = i * 5;
    printf("The answer is %d\n", j);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    1165 <main+0x55>
imul   $0x5,-0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x5,%ebx
cmp    $0x1388,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"The answer is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %7, %3 ]
%5 = mul nuw nsw i32 %4, 5
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 1000
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ socket(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void test_ipv4udp() { socket(AF_INET, SOCK_DGRAM, 0); }


x86 assembly (clang, -O0):
<test_ipv4udp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ipv4udp>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define void @test_ipv4udp() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret void
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define void @test_ipv4udp() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret void
}
void gtk_stock_item_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_stock_item_copy() {
ret void
}
int foo(int x) {
  if ((x != 0 && x != 13) || x == 5 || x == 20)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111b <foo+0x1b>
cmpl   $0xd,-0x8(%rbp)
jne    112f <foo+0x2f>
cmpl   $0x5,-0x8(%rbp)
je     112f <foo+0x2f>
cmpl   $0x14,-0x8(%rbp)
jne    113b <foo+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <foo+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
sbb    %ecx,%ecx
or     $0x1,%ecx
cmp    $0xd,%edi
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 13
%3 = icmp eq i32 %0, 0
%4 = or i1 %2, %3
%5 = select i1 %4, i32 -1, i32 1
ret i32 %5
}