xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int dummy;
};
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ timespec_to_timeval(struct timeval *, struct timespec *);
int timeval_now_monotonic(struct timeval *tv) {
  struct timespec ts;
  int rc;
  rc = clock_gettime(CLOCK_MONOTONIC, &ts);
  timespec_to_timeval(tv, &ts);
  return rc;
}


x86 assembly (clang, -O0):
<timeval_now_monotonic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <timespec_to_timeval@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_now_monotonic>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1030 <clock_gettime@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <timespec_to_timeval@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @timeval_now_monotonic(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.timespec
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %2
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
store i32 %6, i32* %4
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = call i32 @timespec_to_timeval(%struct.timeval* %7, %struct.timespec* %3)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @timeval_now_monotonic(%struct.timeval* %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = call i32 @timespec_to_timeval(%struct.timeval* %0, %struct.timespec* %2)
ret i32 %5
}
char isDeny(int deny[100 + 2], int target) {
  int i = 0;
  while (deny[i] != -1) {
    if (deny[i] == target) {
      return 'a';
    }
    i++;
  }
  return 'b';
}


x86 assembly (clang, -O0):
<isDeny>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     114f <isDeny+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1141 <isDeny+0x41>
movb   $0x61,-0x1(%rbp)
jmp    1153 <isDeny+0x53>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isDeny+0x12>
movb   $0x62,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDeny>:
mov    (%rdi),%ecx
mov    $0x62,%al
cmp    $0xffffffff,%ecx
je     111f <isDeny+0x1f>
add    $0x4,%rdi
nopl   (%rax)
cmp    %esi,%ecx
je     1120 <isDeny+0x20>
mov    (%rdi),%ecx
add    $0x4,%rdi
cmp    $0xffffffff,%ecx
jne    1110 <isDeny+0x10>
ret
mov    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @isDeny(i32* %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %23, %2
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %26
14: ; preds = %7
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %5
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i8 97, i8* %3
br label %27
23: ; preds = %14
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
store i8 98, i8* %3
br label %27
27: ; preds = %26, %22
%28 = load i8, i8* %3
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @isDeny(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i32, i32* %0, i64 %13
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -1
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i32 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i32 %11, %1
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i8 [ 98, %2 ], [ 98, %5 ], [ 97, %9 ]
ret i8 %15
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  size_t len;
  for (len = 0; len < maxlen; len++, s++) {
    if (!*s) {
      break;
    }
  }
  return (len);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1156 <strnlen+0x56>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1134 <strnlen+0x34>
jmp    1156 <strnlen+0x56>
jmp    1139 <strnlen+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = phi i8* [ %11, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i64 %10, %1
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %2
%14 = phi i64 [ 0, %2 ], [ %5, %4 ], [ %1, %9 ]
ret i64 %14
}
/* Variables and functions */
scalar_t__ des_test();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("DES test: %s\n", des_test() ? "SUCCEEDED" : "FAILED");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <des_test@plt>
mov    %rax,%rcx
lea    0xed8(%rip),%rsi
lea    0xec7(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <des_test@plt>
test   %rax,%rax
lea    0xee6(%rip),%rax
lea    0xed5(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"DES test: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @des_test()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"DES test: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = tail call i64 (...) @des_test()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned units_per_cpu() {
  unsigned u;
  asm("push %%rbx\n\t"
      "mov $1,%%eax\n\t"
      "cpuid\n\t"
      "shr $8,%%ebx\n\t"
      "movzx %%bh,%%eax\n\t"
      "pop %%rbx"
      : "=a"(u)::"%ecx", "%edx");
  return u;
}


x86 assembly (clang, -O0):
<units_per_cpu>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x1,%eax
cpuid
shr    $0x8,%ebx
movzbl %bh,%eax
pop    %rbx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<units_per_cpu>:
push   %rbx
mov    $0x1,%eax
cpuid
shr    $0x8,%ebx
movzbl %bh,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @units_per_cpu() {
%1 = alloca i32
%2 = call i32 asm "push %rbx\0A\09mov $$1,%eax\0A\09cpuid\0A\09shr $$8,%ebx\0A\09movzx %bh,%eax\0A\09pop %rbx", "={ax},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @units_per_cpu() {
%1 = tail call i32 asm "push %rbx\0A\09mov $$1,%eax\0A\09cpuid\0A\09shr $$8,%ebx\0A\09movzx %bh,%eax\0A\09pop %rbx", "={ax},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void stylefree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @stylefree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x8c() {
  Assert_real((isalnum(140) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              705, ("isalnum should be 0 for 0x8c"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x8c\00"
define void @t_isalnum_0x8c() {
%1 = tail call i64 @isalnum(i32 140)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 705, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int limite, numero;
  srand(time(NULL));
  limite = 100;
  numero = rand() % limite + 1;
  printf("O número %d é um número aleatório entre 1 e %d\n", numero, limite);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x64,-0x8(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
cltd
idivl  -0x8(%rbp)
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe72(%rip),%rdi
mov    $0x64,%edx
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"O n\C3\BAmero %d \C3\A9 um n\C3\BAmero aleat\C3\B3rio entre 1 e %d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 100, i32* %2
%6 = call i32 (...) @rand()
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
%13 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"O n\C3\BAmero %d \C3\A9 um n\C3\BAmero aleat\C3\B3rio entre 1 e %d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 100
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %5, i32 100)
%7 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __C_ispunct(int);
int ispunct(int c) { return __C_ispunct(c); }


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

x86 assembly (clang, -O2):
<ispunct>:
jmp    1030 <__C_ispunct@plt>

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

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i32 @__C_ispunct(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
scalar_t__ strlen(char *);
char *strncpy(char *, char *, scalar_t__);
char *str_dup(char *str) {
  char *new = (char *)calloc(strlen(str) + 1, sizeof(char));
  if (new == NULL) {
    return NULL;
  }
  return strncpy(new, str, strlen(str));
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <str_dup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    119f <str_dup+0x6f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     116a <str_dup+0x3a>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncpy@plt>
jmp    116c <str_dup+0x3c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @calloc(i64 %7, i32 1)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %19
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = load i8*, i8** %3
%17 = call i64 @strlen(i8* %16)
%18 = call i8* @strncpy(i8* %14, i8* %15, i64 %17)
store i8* %18, i8** %2
br label %19
19: ; preds = %13, %12
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @str_dup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = inttoptr i64 %4 to i8*
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = tail call i8* @strncpy(i8* %7, i8* %0, i64 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %11
}
unsigned long return_ulong_0() { return 1073741823; }


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

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

LLVM IR (-O0):
define i64 @return_ulong_0() {
ret i64 1073741823
}

LLVM IR (-O2):
define i64 @return_ulong_0() {
ret i64 1073741823
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(int);
main() {
  if (f(-1) != 017770)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1040 <f@plt>
cmp    $0x1ff8,%eax
je     115b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1040 <f@plt>
cmp    $0x1ff8,%eax
jne    1149 <main+0x19>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 -1)
%3 = icmp ne i32 %2, 8184
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -1)
%2 = icmp eq i32 %1, 8184
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double bot_vector_magnitude_2d(double *);
int /*<<< orphan*/ bot_vector_subtract_2d(double const *, double const *,
                                          double *);
double bot_vector_dist_2d(const double v1[2], const double v2[2]) {
  double v[2];
  bot_vector_subtract_2d(v1, v2, v);
  return bot_vector_magnitude_2d(v);
}


x86 assembly (clang, -O0):
<bot_vector_dist_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <bot_vector_subtract_2d@plt>
lea    -0x20(%rbp),%rdi
call   1030 <bot_vector_magnitude_2d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_vector_dist_2d>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <bot_vector_subtract_2d@plt>
mov    %rbx,%rdi
call   1030 <bot_vector_magnitude_2d@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @bot_vector_dist_2d(double* %0, double* %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%6 = call i32 @bot_vector_subtract_2d(double* %0, double* %1, double* %5)
%7 = call double @bot_vector_magnitude_2d(double* %5)
ret double %7
}
int lchild(int i) { return i * 2 + 1; }


x86 assembly (clang, -O0):
<lchild>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lchild>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @lchild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double rng(void) {
  double r;
  r = (double)(rand() / (double)RAND_MAX);
  return r;
}


x86 assembly (clang, -O0):
<rng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec2(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rng() {
%1 = alloca double
%2 = call double (...) @rand()
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
store double %5, double* %1
%6 = load double, double* %1
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rng() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
double atan2_66(double, double);
double poly_atan2(double y, double x) { return atan2_66(y, x); }


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

x86 assembly (clang, -O2):
<poly_atan2>:
jmp    1030 <atan2_66@plt>

LLVM IR (-O0):
define double @poly_atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2_66(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @poly_atan2(double %0, double %1) {
%3 = tail call double @atan2_66(double %0, double %1)
ret double %3
}
/* Variables and functions */
scalar_t__ EAFNOSUPPORT;
int VMCISock_GetAFValue();
scalar_t__ errno;
int vsock_get_family(void) {
  static int af = -1;
  errno = 0;
  if (af == -1) {
    af = VMCISock_GetAFValue();
  }
  if (af == -1 && errno == 0) {
    errno = EAFNOSUPPORT;
  }
  return af;
}


x86 assembly (clang, -O0):
<vsock_get_family>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
movq   $0x0,(%rax)
cmpl   $0xffffffff,0x2eff(%rip)
jne    113c <vsock_get_family+0x2c>
mov    $0x0,%al
call   1030 <VMCISock_GetAFValue@plt>
mov    %eax,0x2eec(%rip)
cmpl   $0xffffffff,0x2ee5(%rip)
jne    116e <vsock_get_family+0x5e>
mov    0x2e90(%rip),%rax
cmpq   $0x0,(%rax)
jne    116e <vsock_get_family+0x5e>
mov    0x2e77(%rip),%rax
mov    (%rax),%rcx
mov    0x2e75(%rip),%rax
mov    %rcx,(%rax)
mov    0x2eb4(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsock_get_family>:
push   %rbx
mov    0x2ec8(%rip),%rbx
movq   $0x0,(%rbx)
mov    0x2f03(%rip),%eax
cmp    $0xffffffff,%eax
je     112c <vsock_get_family+0x1c>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <VMCISock_GetAFValue@plt>
mov    %eax,0x2eef(%rip)
cmp    $0xffffffff,%eax
jne    112a <vsock_get_family+0x1a>
cmpq   $0x0,(%rbx)
jne    112a <vsock_get_family+0x1a>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rbx)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@vsock_get_family.af = internal global i32 -1
@errno = global i64 0
@EAFNOSUPPORT = global i64 0
define i32 @vsock_get_family() {
store i64 0, i64* @errno
%1 = load i32, i32* @vsock_get_family.af
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @VMCISock_GetAFValue()
store i32 %4, i32* @vsock_get_family.af
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @vsock_get_family.af
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i64, i64* @errno
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i64, i64* @EAFNOSUPPORT
store i64 %12, i64* @errno
br label %13
13: ; preds = %11, %8, %5
%14 = load i32, i32* @vsock_get_family.af
ret i32 %14
}

LLVM IR (-O2):
@vsock_get_family.af = internal unnamed_addr global i32 -1
@errno = global i64 0
@EAFNOSUPPORT = global i64 0
define i32 @vsock_get_family() {
store i64 0, i64* @errno
%1 = load i32, i32* @vsock_get_family.af
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i32 (...) @VMCISock_GetAFValue()
store i32 %4, i32* @vsock_get_family.af
%5 = load i64, i64* @errno
%6 = icmp eq i64 %5, 0
%7 = icmp eq i32 %4, -1
%8 = select i1 %7, i1 %6, i1 false
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i64, i64* @EAFNOSUPPORT
store i64 %10, i64* @errno
br label %11
11: ; preds = %0, %9, %3
%12 = phi i32 [ -1, %9 ], [ %4, %3 ], [ %1, %0 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ isnormal(double);
double sanitize_denormal(double v) {
  if (!isnormal(v))
    return 0.f;
  return v;
}


x86 assembly (clang, -O0):
<sanitize_denormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isnormal@plt>
cmp    $0x0,%eax
jne    113d <sanitize_denormal+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <sanitize_denormal+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_denormal>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnormal@plt>
xorps  %xmm0,%xmm0
test   %eax,%eax
je     1127 <sanitize_denormal+0x17>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sanitize_denormal(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @isnormal(double %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
8: ; preds = %1
%9 = load double, double* %3
store double %9, double* %2
br label %10
10: ; preds = %8, %7
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @sanitize_denormal(double %0) {
%2 = tail call i32 @isnormal(double %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, double 0.000000e+00, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  system("date");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
__attribute__((no, noclone)) unsigned __int128 t160_5add(signed __int128 x) {
  unsigned __int128 r;
  if (__builtin_add_overflow(x, (signed __int128)(4), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t160_5add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0x4,%rdx
adc    $0x0,%rcx
mov    %r9,%r8
adc    $0x0,%r8
adc    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t160_5add+0x77>
jmp    118e <t160_5add+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t160_5add>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x4,%r14
mov    %rsi,%rbx
adc    $0x0,%rbx
mov    $0xfffffffffffffffb,%rax
cmp    %rdi,%rax
mov    $0xffffffffffffffff,%rax
sbb    %rsi,%rax
jl     113f <t160_5add+0x2f>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t160_5add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 %12, i129 4)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t160_5add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nuw i129 %7, 4
%9 = icmp slt i128 %6, -4
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
int prepare_2D_cell(int *coord_3D) { coord_3D[2] = 0; }


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

x86 assembly (clang, -O2):
<prepare_2D_cell>:
movl   $0x0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define i32 @prepare_2D_cell(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
store i32 0, i32* %2
ret i32 undef
}
/* Variables and functions */
int atoi(char *);
int install_hex(char *str) { return atoi(str); }


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

x86 assembly (clang, -O2):
<install_hex>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @install_hex(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
double test_fma(double x, double y, double z) { return __builtin_fma(x, y, z); }


x86 assembly (clang, -O0):
<test_fma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <fma@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fma>:
jmp    1030 <fma@plt>

LLVM IR (-O0):
define double @test_fma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fma.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @test_fma(double %0, double %1, double %2) {
%4 = tail call double @llvm.fma.f64(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ any(char *, char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc < 3)
    return 1;
  printf("%ld\n", any(argv[1], argv[2]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1176 <main+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     114c <main+0x2c>
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <any@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %18
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @any(i8* %12, i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
store i32 0, i32* %3
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @any(i8* %6, i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %12
}
int iscntrl(int c) { return (-1 < c && c < 32) || (c == 127); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
cmp    -0x4(%rbp),%eax
jge    1124 <iscntrl+0x24>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     112e <iscntrl+0x2e>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 -1, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 32
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DeleteFile(char const *);
void del_file(const char *path) { DeleteFile(path); }


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

x86 assembly (clang, -O2):
<del_file>:
jmp    1030 <DeleteFile@plt>

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

LLVM IR (-O2):
define void @del_file(i8* %0) {
%2 = tail call i32 @DeleteFile(i8* %0)
ret void
}
void SleepFunction(unsigned long ms) { usleep((double)(ms)*1000.0); }


x86 assembly (clang, -O0):
<SleepFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xeed(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xeec(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    $0x1,%al
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SleepFunction>:
movq   %rdi,%xmm1
punpckldq 0xee3(%rip),%xmm1
subpd  0xeeb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xee7(%rip),%xmm0
mov    $0x1,%al
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @SleepFunction(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to double
%5 = fmul double %4, 1.000000e+03
%6 = call i32 (double, ...) bitcast (i32 (...)* @usleep to i32 (double, ...)*)(double %5)
ret void
}

LLVM IR (-O2):
define void @SleepFunction(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fmul double %2, 1.000000e+03
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @usleep to i32 (double, ...)*)(double %3)
ret void
}
/* Variables and functions */
char *U_EMR_CORE5_set(int);
char *U_EMRENDPATH_set(void) { return (U_EMR_CORE5_set(60)); }


x86 assembly (clang, -O0):
<U_EMRENDPATH_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c,%edi
call   1030 <U_EMR_CORE5_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRENDPATH_set>:
mov    $0x3c,%edi
jmp    1030 <U_EMR_CORE5_set@plt>

LLVM IR (-O0):
define i8* @U_EMRENDPATH_set() {
%1 = call i8* @U_EMR_CORE5_set(i32 60)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRENDPATH_set() {
%1 = tail call i8* @U_EMR_CORE5_set(i32 60)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ exibeMenuAnt(int);
int /*<<< orphan*/ printf(char *);
void menu4(int at) {
  exibeMenuAnt(at);
  printf("ATUAL: 4\n");
}


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

x86 assembly (clang, -O2):
<menu4>:
push   %rax
call   1040 <exibeMenuAnt@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [9 x i8] c"ATUAL: 4\00"
define void @menu4(i32 %0) {
%2 = tail call i32 @exibeMenuAnt(i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int isprime(int x) {
  int i = 0;
  for (i = 2; i <= x / 2; i++)
    if (x % i == 0)
      return i;
  return 0;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1161 <isprime+0x61>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114e <isprime+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <isprime+0x68>
jmp    1153 <isprime+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <isprime+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
xor    %r8d,%r8d
cmp    $0x4,%edi
jl     1137 <isprime+0x37>
mov    %edi,%esi
shr    %esi
neg    %esi
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <isprime+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <isprime+0x20>
mov    %r8d,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 1
br label %5
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %6, %4
br i1 %11, label %12, label %5
12: ; preds = %5, %9, %1
%13 = phi i32 [ 0, %1 ], [ 0, %9 ], [ %6, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ updater_load();
void __attribute__((constructor)) library_load(void) { updater_load(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @library_load, i8* null }]
define void @library_load() {
%1 = call i32 (...) @updater_load()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @library_load, i8* null }]
define void @library_load() {
%1 = tail call i32 (...) @updater_load()
ret void
}
int signum(int value) { return (value > 0 ? 1 : (value < 0 ? -1 : 0)); }


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111e <signum+0x1e>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <signum+0x31>
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
neg    %ecx
test   %edi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @signum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 1, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @signum(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = sext i1 %2 to i32
%4 = icmp slt i32 %0, 1
%5 = select i1 %4, i32 %3, i32 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ent_num();
int main() {
  ent_num();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ent_num()
ret i32 0
}