xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int /*<<< orphan*/ write(int, char *, int);
void ft_usage(char *name) {
  write(1, "Usage: ", 7);
  ft_putstr(name);
  write(1, " [write list of integers]\n", 26);
}


x86 assembly (clang, -O0):
<ft_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
lea    0xec8(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
mov    $0x1a,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <ft_putstr@plt>
lea    0xebf(%rip),%rsi
mov    $0x1,%edi
mov    $0x1a,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage: \00"
@.str.1 = [27 x i8] c" [write list of integers]\0A\00"
define void @ft_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%4 = load i8*, i8** %2
%5 = call i32 @ft_putstr(i8* %4)
%6 = call i32 @write(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 26)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Usage: \00"
@.str.1 = [27 x i8] c" [write list of integers]\0A\00"
define void @ft_usage(i8* %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = tail call i32 @ft_putstr(i8* %0)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 26)
ret void
}
/* Variables and functions */
scalar_t__ getenv(char *);
char *rtl_getvar(char *name) {
  char *val;
  if (!name || !*name)
    return "";
  val = (char *)getenv(name);
  if (!val)
    return "";
  return val;
}


x86 assembly (clang, -O0):
<rtl_getvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <rtl_getvar+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1144 <rtl_getvar+0x34>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <rtl_getvar+0x64>
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116c <rtl_getvar+0x5c>
lea    0xe9d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <rtl_getvar+0x64>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_getvar>:
push   %rbx
lea    0xee8(%rip),%rbx
test   %rdi,%rdi
je     112f <rtl_getvar+0x1f>
cmpb   $0x0,(%rdi)
je     112f <rtl_getvar+0x1f>
call   1030 <getenv@plt>
test   %rax,%rax
je     112f <rtl_getvar+0x1f>
mov    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @rtl_getvar(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %21
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = call i64 @getenv(i8* %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %4
%16 = load i8*, i8** %4
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %12
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %21
19: ; preds = %12
%20 = load i8*, i8** %4
store i8* %20, i8** %2
br label %21
21: ; preds = %19, %18, %11
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @rtl_getvar(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 @getenv(i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = inttoptr i64 %7 to i8*
br label %11
11: ; preds = %6, %1, %3, %9
%12 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %6 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ PRCMHIBRegWrite(int, unsigned long);
void PRCMOCRRegisterWrite(unsigned char ucIndex, unsigned long ulRegValue) {
  PRCMHIBRegWrite(0x4402F800 + 0x00000420 + (ucIndex << 2), ulRegValue);
}


x86 assembly (clang, -O0):
<PRCMOCRRegisterWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%edi
shl    $0x2,%edi
add    $0x4402fc20,%edi
mov    -0x10(%rbp),%rsi
call   1030 <PRCMHIBRegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMOCRRegisterWrite>:
lea    0x4402fc20(,%rdi,4),%edi
jmp    1030 <PRCMHIBRegWrite@plt>

LLVM IR (-O0):
define void @PRCMOCRRegisterWrite(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 2
%8 = add nsw i32 1141046304, %7
%9 = load i64, i64* %4
%10 = call i32 @PRCMHIBRegWrite(i32 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @PRCMOCRRegisterWrite(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 2
%5 = add nuw nsw i32 %4, 1141046304
%6 = tail call i32 @PRCMHIBRegWrite(i32 %5, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void func2(void *args) {
  while (1) {
    sleep(2);
    printf("I am PTHREAD_2 : hello gatieme!\n");
  }
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <func2+0xc>

x86 assembly (clang, -O2):
<func2>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1130 <func2+0x10>

LLVM IR (-O0):
@.str = [33 x i8] c"I am PTHREAD_2 : hello gatieme!\0A\00"
define void @func2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@str = [32 x i8] c"I am PTHREAD_2 : hello gatieme!\00"
define void @func2(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %2
}
void ft_strclr(char *s) {
  if (!s)
    return;
  while (*s) {
    *s = '\0';
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <ft_strclr+0x18>
jmp    1142 <ft_strclr+0x42>
jmp    111d <ft_strclr+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <ft_strclr+0x42>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <ft_strclr+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
store i8 0, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
scalar_t__ fork();
scalar_t__ setsid();
int daemonize_no_touch_fdz(void) {
  pid_t pid;
  pid = fork();
  if (pid < 0)
    return -1;
  if (pid > 0)
    _exit(0);
  if (setsid() < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<daemonize_no_touch_fdz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    115a <daemonize_no_touch_fdz+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <daemonize_no_touch_fdz+0x60>
cmpq   $0x0,-0x10(%rbp)
jle    116c <daemonize_no_touch_fdz+0x3c>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0x0,%al
call   1040 <setsid@plt>
cmp    $0x0,%rax
jge    1189 <daemonize_no_touch_fdz+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <daemonize_no_touch_fdz+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize_no_touch_fdz>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
js     114c <daemonize_no_touch_fdz+0x1c>
jne    1153 <daemonize_no_touch_fdz+0x23>
xor    %eax,%eax
call   1040 <setsid@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @daemonize_no_touch_fdz() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %17
7: ; preds = %0
%8 = load i64, i64* %2
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @_exit(i32 0)
unreachable
12: ; preds = %7
%13 = call i64 (...) @setsid()
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 -1, i32* %1
br label %17
16: ; preds = %12
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15, %6
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @daemonize_no_touch_fdz() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0
%4 = icmp eq i64 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @_exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i64 (...) @setsid()
%9 = ashr i64 %8, 63
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %7, %0
%12 = phi i32 [ -1, %0 ], [ %10, %7 ]
ret i32 %12
}
__attribute__((always_)) void
flush_dcache_mmap_unlock(struct address_space *mapping) {}


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

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

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

LLVM IR (-O2):
%struct.address_space = type opaque
define void @flush_dcache_mmap_unlock(%struct.address_space* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char *argv[]) {
  printf("this is a %s with some of my %s in it ! ;p \n Understood, biaaaatch "
         "??? ! \n",
         "bullshit", "balls");
  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)
lea    0xed3(%rip),%rdi
lea    0xf17(%rip),%rsi
lea    0xf19(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf2c(%rip),%rsi
lea    0xf2e(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [75 x i8] c"this is a %s with some of my %s in it ! ;p \0A Understood, biaaaatch ??? ! \0A\00"
@.str.1 = [9 x i8] c"bullshit\00"
@.str.2 = [6 x i8] c"balls\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 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [75 x i8] c"this is a %s with some of my %s in it ! ;p \0A Understood, biaaaatch ??? ! \0A\00"
@.str.1 = [9 x i8] c"bullshit\00"
@.str.2 = [6 x i8] c"balls\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glutReshapeFunc(void (*)(int, int));
void s2winReshapeFunc(void (*func)(int width, int height)) {
  glutReshapeFunc(func);
}


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

x86 assembly (clang, -O2):
<s2winReshapeFunc>:
jmp    1030 <glutReshapeFunc@plt>

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

LLVM IR (-O2):
define void @s2winReshapeFunc(void (i32, i32)* %0) {
%2 = tail call i32 @glutReshapeFunc(void (i32, i32)* %0)
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double tox(double lat, double lon) {
  return (sin(lon * (3.14159265 / 180.0f)) * cos(lat * (3.14159265 / 180.0f)));
}


x86 assembly (clang, -O0):
<tox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xeaf(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tox>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mulsd  0xece(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xeb1(%rip),%xmm0
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tox(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 = fmul double %5, 0x3F91DF46A1FAE712
%7 = call double @sin(double %6)
%8 = load double, double* %3
%9 = fmul double %8, 0x3F91DF46A1FAE712
%10 = call double @cos(double %9)
%11 = fmul double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @tox(double %0, double %1) {
%3 = fmul double %1, 0x3F91DF46A1FAE712
%4 = tail call double @sin(double %3)
%5 = fmul double %0, 0x3F91DF46A1FAE712
%6 = tail call double @cos(double %5)
%7 = fmul double %4, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  for (int i = 0; i <= 10; i++) {
    if (i == 5) {
      break;
    }
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     115c <main+0x4c>
cmpl   $0x5,-0x8(%rbp)
jne    113f <main+0x2f>
jmp    115c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
unsigned long long fast_strtoull(const char *s) {
  register unsigned long long n = 0;
  register char c;
  for (c = *s; c >= '0' && c <= '9'; c = *(++s)) {
    n *= 10;
    n += c - '0';
  }
  return n;
}


x86 assembly (clang, -O0):
<fast_strtoull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x12(%rbp)
jl     1138 <fast_strtoull+0x38>
movsbl -0x11(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1148 <fast_strtoull+0x48>
jmp    117c <fast_strtoull+0x7c>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsbl -0x11(%rbp),%eax
sub    $0x30,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
jmp    1119 <fast_strtoull+0x19>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_strtoull>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%eax
cmp    $0x9,%al
ja     112e <fast_strtoull+0x2e>
add    $0x1,%rdi
xor    %eax,%eax
nop
lea    (%rax,%rax,4),%rax
movzbl %cl,%ecx
add    $0xffffffd0,%ecx
lea    (%rcx,%rax,2),%rax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1110 <fast_strtoull+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @fast_strtoull(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8
store i8* %0, i8** %2
store i64 0, i64* %3
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
store i8 %6, i8* %4
br label %7
7: ; preds = %26, %1
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 57
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ false, %7 ], [ %14, %11 ]
br i1 %16, label %17, label %30
17: ; preds = %15
%18 = load i64, i64* %3
%19 = mul i64 %18, 10
store i64 %19, i64* %3
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 48
%23 = sext i32 %22 to i64
%24 = load i64, i64* %3
%25 = add i64 %24, %23
store i64 %25, i64* %3
br label %26
26: ; preds = %17
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %2
%29 = load i8, i8* %28
store i8 %29, i8* %4
br label %7
30: ; preds = %15
%31 = load i64, i64* %3
ret i64 %31
}

LLVM IR (-O2):
define i64 @fast_strtoull(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i8 [ %15, %5 ], [ %2, %1 ]
%7 = phi i64 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %14, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i64
%10 = mul i64 %7, 10
%11 = add nuw nsw i64 %9, 4294967248
%12 = and i64 %11, 4294967295
%13 = add i64 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i64 [ 0, %1 ], [ %13, %5 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ handle_include(int /*<<< orphan*/);
void cm_include(void) { handle_include(0); }


x86 assembly (clang, -O0):
<cm_include>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_include@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_include>:
xor    %edi,%edi
jmp    1030 <handle_include@plt>

LLVM IR (-O0):
define void @cm_include() {
%1 = call i32 @handle_include(i32 0)
ret void
}

LLVM IR (-O2):
define void @cm_include() {
%1 = tail call i32 @handle_include(i32 0)
ret void
}
/* Variables and functions */
size_t get_pointer_array_length(void **pointerArray) {
  size_t count = 0;
  while (pointerArray[count] != NULL) {
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<get_pointer_array_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <get_pointer_array_length+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <get_pointer_array_length+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pointer_array_length>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <get_pointer_array_length+0x10>
ret

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

LLVM IR (-O2):
define i64 @get_pointer_array_length(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int bprime(long long int n) {
  int i = 2;
  while (i < n) {
    if (n % i == 0) {
      n /= i;
      i--;
    }
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<bprime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    115c <bprime+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    114e <bprime+0x4e>
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <bprime+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bprime>:
mov    $0x2,%r8d
cmp    $0x3,%rdi
jl     1159 <bprime+0x59>
mov    $0x2,%esi
jmp    1145 <bprime+0x45>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdi,%rax
cqto
idiv   %rsi
lea    -0x1(%r8),%ecx
test   %rdx,%rdx
cmove  %rax,%rdi
cmovne %r8d,%ecx
add    $0x1,%ecx
movslq %ecx,%rsi
mov    %ecx,%r8d
cmp    %rsi,%rdi
jle    115f <bprime+0x5f>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1120 <bprime+0x20>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1128 <bprime+0x28>
mov    $0x2,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bprime(i64 %0) {
%2 = icmp sgt i64 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1, %3
%4 = phi i64 [ %14, %3 ], [ 2, %1 ]
%5 = phi i32 [ %13, %3 ], [ 2, %1 ]
%6 = phi i64 [ %11, %3 ], [ %0, %1 ]
%7 = srem i64 %6, %4
%8 = sdiv i64 %6, %4
%9 = icmp eq i64 %7, 0
%10 = add nsw i32 %5, -1
%11 = select i1 %9, i64 %8, i64 %6
%12 = select i1 %9, i32 %10, i32 %5
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp sgt i64 %11, %14
br i1 %15, label %3, label %16
16: ; preds = %3, %1
%17 = phi i32 [ 2, %1 ], [ %13, %3 ]
ret i32 %17
}
int __syscall2(int call, unsigned long arg0, unsigned long arg1) {
  int rc;
  asm volatile(
      "movl %[call], %%eax	\n"
      "movl %[arg0], %%ebx	\n"
      "movl %[arg1], %%ecx	\n"
      "int  %[xnum]		\n"
      "movl %%eax, %[rc]	\n"
      : [rc] "=g"(rc)
      : [call] "g"(call), [arg0] "g"(arg0), [arg1] "g"(arg1), [xnum] "i"(0x80)
      : "%eax", "%ebx", "%ecx", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %edx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x30(%rbp),%ebx
mov    -0x38(%rbp),%ecx
int    $0x80
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall2(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
float bin_above_threshold(const float bin, const float threshold) {
  if (bin < threshold)
    return 0;
  return (bin - threshold) * (1 / (1 - threshold));
}


x86 assembly (clang, -O0):
<bin_above_threshold>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    112e <bin_above_threshold+0x2e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115a <bin_above_threshold+0x5a>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  0xec0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  0xeb3(%rip),%xmm1
divss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_above_threshold>:
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm1
ja     1123 <bin_above_threshold+0x23>
subss  %xmm1,%xmm0
movss  0xeec(%rip),%xmm2
movaps %xmm2,%xmm3
subss  %xmm1,%xmm3
divss  %xmm3,%xmm2
mulss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @bin_above_threshold(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store float 0.000000e+00, float* %3
br label %18
10: ; preds = %2
%11 = load float, float* %4
%12 = load float, float* %5
%13 = fsub float %11, %12
%14 = load float, float* %5
%15 = fsub float 1.000000e+00, %14
%16 = fdiv float 1.000000e+00, %15
%17 = fmul float %13, %16
store float %17, float* %3
br label %18
18: ; preds = %10, %9
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @bin_above_threshold(float %0, float %1) {
%3 = fcmp olt float %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fsub float %0, %1
%6 = fsub float 1.000000e+00, %1
%7 = fdiv float 1.000000e+00, %6
%8 = fmul float %5, %7
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ 0.000000e+00, %2 ]
ret float %10
}
void SetNewParms(void) {}


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

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

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

LLVM IR (-O2):
define void @SetNewParms() {
ret void
}
int _dwarf_string_valid(void *startptr, void *endptr) {
  char *start = startptr;
  char *end = endptr;
  while (start < end) {
    if (*start == 0) {
      return 1;
    }
    ++start;
    ++end;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_dwarf_string_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1163 <_dwarf_string_valid+0x63>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1146 <_dwarf_string_valid+0x46>
movl   $0x1,-0x4(%rbp)
jmp    116a <_dwarf_string_valid+0x6a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111c <_dwarf_string_valid+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dwarf_string_valid>:
xor    %eax,%eax
cmp    %rsi,%rdi
jae    1125 <_dwarf_string_valid+0x25>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi)
je     1126 <_dwarf_string_valid+0x26>
lea    0x1(%rdi),%rcx
add    $0x1,%rsi
cmp    %rsi,%rdi
mov    %rcx,%rdi
jb     1110 <_dwarf_string_valid+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_dwarf_string_valid(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %13
4: ; preds = %2, %9
%5 = phi i8* [ %11, %9 ], [ %1, %2 ]
%6 = phi i8* [ %10, %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 = getelementptr inbounds i8, i8* %6, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp ult i8* %6, %5
br i1 %12, label %4, label %13
13: ; preds = %4, %9, %2
%14 = phi i32 [ 0, %2 ], [ 0, %9 ], [ 1, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ _panic(char *);
void sys_newselect(void) { _panic("sys_newselect"); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"sys_newselect\00"
define void @sys_newselect() {
%1 = tail call i32 @_panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
uintptr_t syscall(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t,
                  uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t);
uintptr_t gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2,
                                  uintptr_t a3, uintptr_t a4, uintptr_t a5,
                                  uintptr_t a6, uintptr_t a7, uintptr_t a8,
                                  uintptr_t a9) {
  return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
}


x86 assembly (clang, -O0):
<gccgoRealSyscallNoError>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%rbx
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <syscall@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gccgoRealSyscallNoError>:
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i64 @gccgoRealSyscallNoError(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
store i64 %0, i64* %11
store i64 %1, i64* %12
store i64 %2, i64* %13
store i64 %3, i64* %14
store i64 %4, i64* %15
store i64 %5, i64* %16
store i64 %6, i64* %17
store i64 %7, i64* %18
store i64 %8, i64* %19
store i64 %9, i64* %20
%21 = load i64, i64* %11
%22 = load i64, i64* %12
%23 = load i64, i64* %13
%24 = load i64, i64* %14
%25 = load i64, i64* %15
%26 = load i64, i64* %16
%27 = load i64, i64* %17
%28 = load i64, i64* %18
%29 = load i64, i64* %19
%30 = load i64, i64* %20
%31 = call i64 @syscall(i64 %21, i64 %22, i64 %23, i64 %24, i64 %25, i64 %26, i64 %27, i64 %28, i64 %29, i64 %30)
ret i64 %31
}

LLVM IR (-O2):
define i64 @gccgoRealSyscallNoError(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = tail call i64 @syscall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9)
ret i64 %11
}
/* Variables and functions */
size_t divide_round_up(size_t, size_t);
size_t round_up(size_t n, size_t q) { return divide_round_up(n, q) * q; }


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

x86 assembly (clang, -O2):
<round_up>:
push   %rbx
mov    %rsi,%rbx
call   1030 <divide_round_up@plt>
imul   %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @round_up(i64 %0, i64 %1) {
%3 = tail call i64 @divide_round_up(i64 %0, i64 %1)
%4 = mul i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c() { printf("this is c\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"this is c\00"
define void @c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char macc(unsigned char, unsigned char, unsigned char);
unsigned char func1(unsigned char x, unsigned char y, unsigned char z) {
  x++;
  return macc(x, y, z);
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x3(%rbp),%edx
call   1030 <macc@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
add    $0x1,%dil
movzbl %dil,%edi
jmp    1030 <macc@plt>

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

LLVM IR (-O2):
define zeroext i8 @func1(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = add i8 %0, 1
%5 = tail call zeroext i8 @macc(i8 zeroext %4, i8 zeroext %1, i8 zeroext %2)
ret i8 %5
}
/* Type definitions */
struct trace_seq {
  int dummy;
};
typedef scalar_t__ dev;

/* Variables and functions */
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char *, unsigned int,
                                    unsigned int);
unsigned long long process_jbd2_dev_to_name(struct trace_seq *s,
                                            unsigned long long *args) {
  unsigned int dev = args[0];
  trace_seq_printf(s, "%d:%d", ((unsigned int)((dev) >> 20)),
                   ((unsigned int)((dev) & ((1U << 20) - 1))));
  return 0;
}


x86 assembly (clang, -O0):
<process_jbd2_dev_to_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
shr    $0x14,%edx
mov    -0x14(%rbp),%ecx
and    $0xfffff,%ecx
lea    0xebc(%rip),%rsi
call   1030 <trace_seq_printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_jbd2_dev_to_name>:
push   %rax
mov    (%rsi),%ecx
mov    %ecx,%edx
shr    $0x14,%edx
and    $0xfffff,%ecx
lea    0xedb(%rip),%rsi
call   1030 <trace_seq_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
@.str = [6 x i8] c"%d:%d\00"
define i64 @process_jbd2_dev_to_name(%struct.trace_seq* %0, i64* %1) {
%3 = alloca %struct.trace_seq*
%4 = alloca i64*
%5 = alloca i32
store %struct.trace_seq* %0, %struct.trace_seq** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
%10 = load %struct.trace_seq*, %struct.trace_seq** %3
%11 = load i32, i32* %5
%12 = lshr i32 %11, 20
%13 = load i32, i32* %5
%14 = and i32 %13, 1048575
%15 = call i32 @trace_seq_printf(%struct.trace_seq* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %14)
ret i64 0
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
@.str = [6 x i8] c"%d:%d\00"
define i64 @process_jbd2_dev_to_name(%struct.trace_seq* %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 20
%6 = and i32 %4, 1048575
%7 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ cov_module_exit();
void module_fini() { cov_module_exit(); }


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

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

LLVM IR (-O0):
define void @module_fini() {
%1 = call i32 (...) @cov_module_exit()
ret void
}

LLVM IR (-O2):
define void @module_fini() {
%1 = tail call i32 (...) @cov_module_exit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x3e() {
  Assert_real((ispunct(62)),
              "/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_ispunct.c",
              315, ("ispunct should be 1 for >"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x3e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%edi
call   1030 <ispunct@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x13b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x3e>:
push   %rax
mov    $0x3e,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x13b,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for >\00"
define void @t_ispunct_0x3e() {
%1 = call i32 @ispunct(i32 62)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for >\00"
define void @t_ispunct_0x3e() {
%1 = tail call i32 @ispunct(i32 62)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void tclr(void) {
  fprintf(stdout, "\033[2J");
  fprintf(stdout, "\033[1;1H");
}


x86 assembly (clang, -O0):
<tclr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tclr>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed6(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define void @tclr() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[1;1H\00"
define void @tclr() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int rand() {
  unsigned int x = sys_call(0x01, 0, 0, 0, 0);
  if ((x & 0xF) > 7)
    return (x * x & 0xFFFF);
  else
    return (x * x * x & 0xFFFF);
}


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
cmp    $0x7,%eax
jbe    1154 <rand+0x44>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <rand+0x57>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
push   %rbx
mov    $0x1,%ebx
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sys_call@plt>
test   $0x8,%al
cmove  %eax,%ebx
imul   %eax,%eax
imul   %ebx,%eax
movzwl %ax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i32 @sys_call(i32 1, i32 0, i32 0, i32 0, i32 0)
%2 = and i32 %1, 8
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 %1, i32 1
%5 = mul i32 %1, %1
%6 = mul i32 %5, %4
%7 = and i32 %6, 65535
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgldlw(int n) { ngen("%s\t%d(%%ebp),%%eax", "movl", n); }


x86 assembly (clang, -O0):
<cgldlw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldlw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s\09%d(%%ebp),%%eax\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgldlw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s\09%d(%%ebp),%%eax\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgldlw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
uintptr_t tag0(void *ptr) { return (uintptr_t)ptr; }


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

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

LLVM IR (-O0):
define i64 @tag0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @tag0(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}