xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigchld_handler() {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <sigchld_handler+0x9>
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    113f <sigchld_handler+0x2f>
jmp    1119 <sigchld_handler+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sigchld_handler+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigchld_handler() {
br label %1
1: ; preds = %5, %0
%2 = load i32, i32* @WNOHANG
%3 = call i64 @waitpid(i32 -1, i32* null, i32 %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigchld_handler() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @WNOHANG
%3 = tail call i64 @waitpid(i32 -1, i32* null, i32 %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
void test_exhausterr() { ; }


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

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

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

LLVM IR (-O2):
define void @test_exhausterr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RecursivePermute(char *, int /*<<< orphan*/);
void ListPermutations(char *str) { RecursivePermute(str, 0); }


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

x86 assembly (clang, -O2):
<ListPermutations>:
xor    %esi,%esi
jmp    1030 <RecursivePermute@plt>

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

LLVM IR (-O2):
define void @ListPermutations(i8* %0) {
%2 = tail call i32 @RecursivePermute(i8* %0, i32 0)
ret void
}
void spinlock_destroy(struct spinlock *lock) { (void)lock; }


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

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

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

LLVM IR (-O2):
%struct.spinlock = type opaque
define void @spinlock_destroy(%struct.spinlock* nocapture %0) {
ret void
}
int *radar11185138_baz() {
  int *x, *y;
  x = y = 0;
  return y;
}


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

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

LLVM IR (-O0):
define i32* @radar11185138_baz() {
%1 = alloca i32*
%2 = alloca i32*
store i32* null, i32** %2
store i32* null, i32** %1
%3 = load i32*, i32** %2
ret i32* %3
}

LLVM IR (-O2):
define noalias i32* @radar11185138_baz() {
ret i32* null
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int /*<<< orphan*/);
ssize_t doRecv(int sock, void *data, size_t len, int *ttl, int *tos) {
  *ttl = -1;
  *tos = -1;
  return recv(sock, data, len, 0);
}


x86 assembly (clang, -O0):
<doRecv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x28(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doRecv>:
movl   $0xffffffff,(%rcx)
movl   $0xffffffff,(%r8)
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @doRecv(i32 %0, i8* %1, i64 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
store i32 -1, i32* %3
store i32 -1, i32* %4
%6 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %6
}
int CHECK_DATA662(unsigned char v) { return (v & 0xf0) == 0x80; }


x86 assembly (clang, -O0):
<CHECK_DATA662>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf0,%eax
cmp    $0x80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHECK_DATA662>:
and    $0xf0,%dil
xor    %eax,%eax
cmp    $0x80,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @CHECK_DATA662(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 240
%6 = icmp eq i32 %5, 128
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @CHECK_DATA662(i8 zeroext %0) {
%2 = and i8 %0, -16
%3 = icmp eq i8 %2, -128
%4 = zext i1 %3 to i32
ret i32 %4
}
long findprevnl(pos)
long pos;
{
  if (pos)
    pos--;
  while (pos > 0 && soubor(pos - 1) != '\n')
    --pos;
  return pos;
}


x86 assembly (clang, -O0):
<findprevnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <findprevnl+0x23>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <findprevnl+0x28>
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1160 <findprevnl+0x50>
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
mov    $0x0,%al
call   1030 <soubor@plt>
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1170 <findprevnl+0x60>
jmp    1181 <findprevnl+0x71>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <findprevnl+0x28>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findprevnl>:
push   %r14
push   %rbx
push   %rax
sub    $0x1,%rdi
mov    $0x0,%ebx
cmovae %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%r14
test   %rbx,%rbx
jle    114b <findprevnl+0x3b>
lea    -0x1(%r14),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <soubor@plt>
cmp    $0xa,%eax
jne    1130 <findprevnl+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @findprevnl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = add nsw i64 %6, -1
store i64 %7, i64* %2
br label %8
8: ; preds = %5, %1
br label %9
9: ; preds = %19, %8
%10 = load i64, i64* %2
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i64, i64* %2
%14 = sub nsw i64 %13, 1
%15 = call i32 (i64, ...) bitcast (i32 (...)* @soubor to i32 (i64, ...)*)(i64 %14)
%16 = icmp ne i32 %15, 10
br label %17
17: ; preds = %12, %9
%18 = phi i1 [ false, %9 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i64, i64* %2
%21 = add nsw i64 %20, -1
store i64 %21, i64* %2
br label %9
22: ; preds = %17
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @findprevnl(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = add nsw i64 %0, -1
%4 = select i1 %2, i64 0, i64 %3
br label %5
5: ; preds = %1, %8
%6 = phi i64 [ %9, %8 ], [ %4, %1 ]
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = add nsw i64 %6, -1
%10 = tail call i32 (i64, ...) bitcast (i32 (...)* @soubor to i32 (i64, ...)*)(i64 %9)
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %5
12: ; preds = %5, %8
ret i64 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int add(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a;
  int b;
  printf("enter two numbers, like 22,32\n");
  scanf("%d,%d", &a, &b);
  int result = add(a, b);
  printf("sum of number = %d", result);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <add@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <add@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"enter two numbers, like 22,32\0A\00"
@.str.1 = [6 x i8] c"%d,%d\00"
@.str.2 = [19 x i8] c"sum of number = %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @add(i32 %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d,%d\00"
@.str.2 = [19 x i8] c"sum of number = %d\00"
@EXIT_SUCCESS = global i32 0
@str = [30 x i8] c"enter two numbers, like 22,32\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @add(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
int mlx5_fpga_init(struct mlx5_core_dev *mdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mlx5_core_dev = type opaque
define i32 @mlx5_fpga_init(%struct.mlx5_core_dev* nocapture readnone %0) {
ret i32 0
}
void syscalldbg(void) { __asm__ volatile("int	$0x30\n" : : : "memory"); }


x86 assembly (clang, -O0):
<syscalldbg>:
push   %rbp
mov    %rsp,%rbp
int    $0x30
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscalldbg>:
int    $0x30
ret

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

LLVM IR (-O2):
define void @syscalldbg() {
tail call void asm sideeffect "int\09$$0x30\0A", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ odd(long);
bool even_l(long n) { return !odd(n); }


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

x86 assembly (clang, -O2):
<even_l>:
push   %rax
call   1030 <odd@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @even_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @odd(i64 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @even_l(i64 %0) {
%2 = tail call i32 @odd(i64 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ get_all_grid_addresses(long **, long const *);
void rgd_get_all_grid_addresses(long grid_address[][3], const long mesh[3]) {
  get_all_grid_addresses(grid_address, mesh);
}


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

x86 assembly (clang, -O2):
<rgd_get_all_grid_addresses>:
jmp    1030 <get_all_grid_addresses@plt>

LLVM IR (-O0):
define void @rgd_get_all_grid_addresses([3 x i64]* %0, i64* %1) {
%3 = alloca [3 x i64]*
%4 = alloca i64*
store [3 x i64]* %0, [3 x i64]** %3
store i64* %1, i64** %4
%5 = load [3 x i64]*, [3 x i64]** %3
%6 = bitcast [3 x i64]* %5 to i64**
%7 = load i64*, i64** %4
%8 = call i32 @get_all_grid_addresses(i64** %6, i64* %7)
ret void
}

LLVM IR (-O2):
define void @rgd_get_all_grid_addresses([3 x i64]* %0, i64* %1) {
%3 = bitcast [3 x i64]* %0 to i64**
%4 = tail call i32 @get_all_grid_addresses(i64** %3, i64* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chmod(char *, int);
int unlink(char *);
int ridfile(char *fname) {
  int t;
  chmod(fname, 0777);
  t = unlink(fname);
  return t;
}


x86 assembly (clang, -O0):
<ridfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1ff,%esi
call   1040 <chmod@plt>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ridfile>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1ff,%esi
call   1040 <chmod@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unlink@plt>

LLVM IR (-O0):
define i32 @ridfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @chmod(i8* %4, i32 511)
%6 = load i8*, i8** %2
%7 = call i32 @unlink(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ridfile(i8* nocapture %0) {
%2 = tail call i32 @chmod(i8* %0, i32 511)
%3 = tail call i32 @unlink(i8* %0)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int intcelcon_dimension_of_points(int *dimension) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(744, dimension, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @intcelcon_dimension_of_points(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 744, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
void configurePrescaler(unsigned int configuration) {
  (*(unsigned int *)0x4000C00C) = configuration;
}


x86 assembly (clang, -O0):
<configurePrescaler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x4000c00c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<configurePrescaler>:
mov    %edi,0x4000c00c
ret

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

LLVM IR (-O2):
define void @configurePrescaler(i32 %0) {
store i32 %0, i32* inttoptr (i64 1073790988 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ ceil(unsigned int);
unsigned int uGetNumIPs(char *);
unsigned uGetNumNets(char *cCIDR4) {
  unsigned uNumIPs = 0;
  unsigned uNumNets = 0;
  uNumIPs = uGetNumIPs(cCIDR4);
  uNumNets = (unsigned)ceil((uNumIPs / 255));
  if (!uNumNets)
    uNumNets = 1;
  return (uNumNets);
}


x86 assembly (clang, -O0):
<uGetNumNets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <uGetNumIPs@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1040 <ceil@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    116d <uGetNumNets+0x4d>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uGetNumNets>:
push   %rax
call   1030 <uGetNumIPs@plt>
mov    %eax,%eax
mov    $0x80808081,%edi
imul   %rax,%rdi
shr    $0x27,%rdi
call   1040 <ceil@plt>
test   %eax,%eax
mov    $0x1,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uGetNumNets(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load i8*, i8** %2
%6 = call i32 @uGetNumIPs(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = udiv i32 %7, 255
%9 = call i64 @ceil(i32 %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %1
store i32 1, i32* %4
br label %14
14: ; preds = %13, %1
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
define i32 @uGetNumNets(i8* %0) {
%2 = tail call i32 @uGetNumIPs(i8* %0)
%3 = udiv i32 %2, 255
%4 = tail call i64 @ceil(i32 %3)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 %5
ret i32 %7
}
int fons__maxi(int a, int b) { return a > b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @fons__maxi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ floor(int /*<<< orphan*/);
int /*<<< orphan*/ fmod(short, short);
short mod(short x, short y) {
  double x1 = (double)x, y1 = (double)y;
  return (short)floor(fmod(x, y));
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movswl -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <floor@plt>
cwtl
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
push   %rax
call   1030 <fmod@plt>
mov    %eax,%edi
call   1040 <floor@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @mod(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca double
%6 = alloca double
store i16 %0, i16* %3
store i16 %1, i16* %4
%7 = load i16, i16* %3
%8 = sitofp i16 %7 to double
store double %8, double* %5
%9 = load i16, i16* %4
%10 = sitofp i16 %9 to double
store double %10, double* %6
%11 = load i16, i16* %3
%12 = load i16, i16* %4
%13 = call i32 @fmod(i16 signext %11, i16 signext %12)
%14 = call i64 @floor(i32 %13)
%15 = trunc i64 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @mod(i16 signext %0, i16 signext %1) {
%3 = tail call i32 @fmod(i16 signext %0, i16 signext %1)
%4 = tail call i64 @floor(i32 %3)
%5 = trunc i64 %4 to i16
ret i16 %5
}
/* Type definitions */
struct rtattr {
  int dummy;
};
struct qdisc_util {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int tbf_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @tbf_print_xstats(%struct.qdisc_util* %0, i32* %1, %struct.rtattr* %2) {
%4 = alloca %struct.qdisc_util*
%5 = alloca i32*
%6 = alloca %struct.rtattr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %4
store i32* %1, i32** %5
store %struct.rtattr* %2, %struct.rtattr** %6
ret i32 0
}

LLVM IR (-O2):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @tbf_print_xstats(%struct.qdisc_util* nocapture readnone %0, i32* nocapture readnone %1, %struct.rtattr* nocapture readnone %2) {
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double MPI_Wtime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec * 1.0E-6;
}


x86 assembly (clang, -O0):
<MPI_Wtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Wtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @MPI_Wtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @MPI_Wtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ flushkeys();
int getkey();
int /*<<< orphan*/ idle();
int /*<<< orphan*/ keypressed();
int waitforkey(void) {
  flushkeys();
  while (!keypressed())
    idle();
  return getkey();
}


x86 assembly (clang, -O0):
<waitforkey>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <flushkeys@plt>
mov    $0x0,%al
call   1030 <keypressed@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1167 <waitforkey+0x27>
jmp    1173 <waitforkey+0x33>
mov    $0x0,%al
call   1040 <idle@plt>
jmp    114b <waitforkey+0xb>
mov    $0x0,%al
call   1060 <getkey@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitforkey>:
push   %rax
xor    %eax,%eax
call   1050 <flushkeys@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keypressed@plt>
test   %eax,%eax
jne    1164 <waitforkey+0x24>
xor    %eax,%eax
call   1040 <idle@plt>
jmp    1150 <waitforkey+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1060 <getkey@plt>

LLVM IR (-O0):
define i32 @waitforkey() {
%1 = call i32 (...) @flushkeys()
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @keypressed()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 (...) @idle()
br label %2
8: ; preds = %2
%9 = call i32 (...) @getkey()
ret i32 %9
}

LLVM IR (-O2):
define i32 @waitforkey() {
%1 = tail call i32 (...) @flushkeys()
%2 = tail call i32 (...) @keypressed()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0, %4
%5 = tail call i32 (...) @idle()
%6 = tail call i32 (...) @keypressed()
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %0
%9 = tail call i32 (...) @getkey()
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _esp8266_print(char *);
int /*<<< orphan*/ _esp8266_putch(unsigned char);
int /*<<< orphan*/ _esp8266_waitResponse();
void esp8266_mode(unsigned char mode) {
  _esp8266_print("AT+CWMODE=");
  _esp8266_putch(mode + '0');
  _esp8266_print("\r\n");
  _esp8266_waitResponse();
}


x86 assembly (clang, -O0):
<esp8266_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xebb(%rip),%rdi
call   1050 <_esp8266_print@plt>
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
movzbl %al,%edi
call   1040 <_esp8266_putch@plt>
lea    0xeab(%rip),%rdi
call   1050 <_esp8266_print@plt>
mov    $0x0,%al
call   1030 <_esp8266_waitResponse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp8266_mode>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1050 <_esp8266_print@plt>
add    $0x30,%bl
movzbl %bl,%edi
call   1040 <_esp8266_putch@plt>
lea    0xeba(%rip),%rdi
call   1050 <_esp8266_print@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <_esp8266_waitResponse@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"AT+CWMODE=\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @esp8266_mode(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @_esp8266_print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = add nsw i32 %5, 48
%7 = trunc i32 %6 to i8
%8 = call i32 @_esp8266_putch(i8 zeroext %7)
%9 = call i32 @_esp8266_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @_esp8266_waitResponse()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"AT+CWMODE=\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @esp8266_mode(i8 zeroext %0) {
%2 = tail call i32 @_esp8266_print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = add i8 %0, 48
%4 = tail call i32 @_esp8266_putch(i8 zeroext %3)
%5 = tail call i32 @_esp8266_print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @_esp8266_waitResponse()
ret void
}
int __test_and_set_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  __asm__("bts %2,%1\n\t"
          "sbb %0,%0"
          : "=r"(oldbit), "+m"(*(volatile long *)(addr))
          : "Ir"(nr));
  return (oldbit);
}


x86 assembly (clang, -O0):
<__test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_set_bit>:
bts    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
int ft_strcchr(const char *str, int c) {
  int out;
  out = 0;
  while (str[out] != '\0' && str[out] != c)
    ++out;
  return (str[out] == '\0' ? -1 : out);
}


x86 assembly (clang, -O0):
<ft_strcchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1141 <ft_strcchr+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1151 <ft_strcchr+0x51>
jmp    115f <ft_strcchr+0x5f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <ft_strcchr+0x12>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1181 <ft_strcchr+0x81>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1187 <ft_strcchr+0x87>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcchr>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rdi),%eax
add    $0x1,%ecx
test   %eax,%eax
je     1122 <ft_strcchr+0x22>
add    $0x1,%rdi
cmp    %esi,%eax
jne    1110 <ft_strcchr+0x10>
cmp    $0x1,%al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ft_strcchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i32, i32* %4
%22 = icmp ne i32 %20, %21
br label %23
23: ; preds = %14, %6
%24 = phi i1 [ false, %6 ], [ %22, %14 ]
br i1 %24, label %25, label %28
25: ; preds = %23
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %28
br label %39
37: ; preds = %28
%38 = load i32, i32* %5
br label %39
39: ; preds = %37, %36
%40 = phi i32 [ -1, %36 ], [ %38, %37 ]
ret i32 %40
}

LLVM IR (-O2):
define i32 @ft_strcchr(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %11, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
%10 = or i1 %7, %9
%11 = add nuw i64 %4, 1
br i1 %10, label %12, label %3
12: ; preds = %3
%13 = trunc i64 %4 to i32
%14 = select i1 %7, i32 -1, i32 %13
ret i32 %14
}
void __renderer_software_render() {
  NOT_IMPLEMENTED("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/rdavison/claytracer/refs/"
                  "heads/master/software_renderer.c",
                  11, __func__);
}


x86 assembly (clang, -O0):
<__renderer_software_render>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xb,%esi
lea    0xf6d(%rip),%rdx
mov    $0x0,%al
call   1030 <NOT_IMPLEMENTED@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__renderer_software_render>:
lea    0xee9(%rip),%rdi
lea    0xf76(%rip),%rdx
mov    $0xb,%esi
xor    %eax,%eax
jmp    1030 <NOT_IMPLEMENTED@plt>

LLVM IR (-O0):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rdavison/claytracer/refs/heads/master/software_renderer.c\00"
@__func__.__renderer_software_render = [27 x i8] c"__renderer_software_render\00"
define void @__renderer_software_render() {
%1 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @NOT_IMPLEMENTED to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.__renderer_software_render, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/rdavison/claytracer/refs/heads/master/software_renderer.c\00"
@__func__.__renderer_software_render = [27 x i8] c"__renderer_software_render\00"
define void @__renderer_software_render() {
%1 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @NOT_IMPLEMENTED to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.__renderer_software_render, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
unsigned int ccd_c2ad(double t) {
  double r = 3.0 * exp(0.94390589891 * (25.0 - t) / 25.0);
  unsigned int ret = 4096.0 / (10.0 / r + 1.0);
  if (ret > 4096)
    ret = 4096;
  return ret;
}


x86 assembly (clang, -O0):
<ccd_c2ad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm2
movsd  0xed6(%rip),%xmm1
movaps %xmm1,%xmm0
subsd  %xmm2,%xmm0
movsd  0xecf(%rip),%xmm2
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0xec2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x1000,-0x14(%rbp)
jbe    119c <ccd_c2ad+0x8c>
movl   $0x1000,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccd_c2ad>:
push   %rax
movsd  0xee7(%rip),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
mulsd  0xedf(%rip),%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xed2(%rip),%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xece(%rip),%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
cmp    $0x1000,%ecx
mov    $0x1000,%eax
cmovb  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ccd_c2ad(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = fsub double 2.500000e+01, %5
%7 = fmul double 0x3FEE347A24CA3CE2, %6
%8 = fdiv double %7, 2.500000e+01
%9 = call double @exp(double %8)
%10 = fmul double 3.000000e+00, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = fdiv double 1.000000e+01, %11
%13 = fadd double %12, 1.000000e+00
%14 = fdiv double 4.096000e+03, %13
%15 = fptoui double %14 to i32
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = icmp ugt i32 %16, 4096
br i1 %17, label %18, label %19
18: ; preds = %1
store i32 4096, i32* %4
br label %19
19: ; preds = %18, %1
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @ccd_c2ad(double %0) {
%2 = fsub double 2.500000e+01, %0
%3 = fmul double %2, 0x3FEE347A24CA3CE2
%4 = fdiv double %3, 2.500000e+01
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 3.000000e+00
%7 = fdiv double 1.000000e+01, %6
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double 4.096000e+03, %8
%10 = fptoui double %9 to i32
%11 = icmp ult i32 %10, 4096
%12 = select i1 %11, i32 %10, i32 4096
ret i32 %12
}
/* Variables and functions */
int poly(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("%d\n", poly(92));
  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)
mov    $0x5c,%edi
call   1040 <poly@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5c,%edi
call   1040 <poly@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = call i32 @poly(i32 92)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @poly(i32 92)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRE4_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRE4_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRE4_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ geteuid();
scalar_t__ getuid();
int /*<<< orphan*/ panic(char *);
void check_for_root_maybe_die(void) {
  if (geteuid() != 0 || geteuid() != getuid())
    panic("Uhhuh, not root?!\n");
}


x86 assembly (clang, -O0):
<check_for_root_maybe_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <geteuid@plt>
cmp    $0x0,%rax
jne    116b <check_for_root_maybe_die+0x3b>
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
je     1177 <check_for_root_maybe_die+0x47>
lea    0xe8e(%rip),%rdi
call   1040 <panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_root_maybe_die>:
push   %rbx
xor    %eax,%eax
call   1050 <geteuid@plt>
test   %rax,%rax
jne    1155 <check_for_root_maybe_die+0x25>
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getuid@plt>
cmp    %rax,%rbx
jne    1155 <check_for_root_maybe_die+0x25>
pop    %rbx
ret
lea    0xea4(%rip),%rdi
pop    %rbx
jmp    1040 <panic@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Uhhuh, not root?!\0A\00"
define void @check_for_root_maybe_die() {
%1 = call i64 (...) @geteuid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i64 (...) @geteuid()
%5 = call i64 (...) @getuid()
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3, %0
%8 = call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Uhhuh, not root?!\0A\00"
define void @check_for_root_maybe_die() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @geteuid()
%5 = tail call i64 (...) @getuid()
%6 = icmp eq i64 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3, %0
%8 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RFM69_WriteByte(int, int);
void RFM69_TriggerTemp(void) { RFM69_WriteByte(0x08, 0x4E); }


x86 assembly (clang, -O0):
<RFM69_TriggerTemp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x4e,%esi
call   1030 <RFM69_WriteByte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RFM69_TriggerTemp>:
mov    $0x8,%edi
mov    $0x4e,%esi
jmp    1030 <RFM69_WriteByte@plt>

LLVM IR (-O0):
define void @RFM69_TriggerTemp() {
%1 = call i32 @RFM69_WriteByte(i32 8, i32 78)
ret void
}

LLVM IR (-O2):
define void @RFM69_TriggerTemp() {
%1 = tail call i32 @RFM69_WriteByte(i32 8, i32 78)
ret void
}
void s2i_ASN1_INTEGER(void) {}


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

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

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

LLVM IR (-O2):
define void @s2i_ASN1_INTEGER() {
ret void
}
/* Type definitions */
struct edge {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_edge(struct edge *edg) { free_object(14, (short *)edg); }


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

x86 assembly (clang, -O2):
<free_edge>:
mov    %rdi,%rsi
mov    $0xe,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.edge = type { i32 }
define void @free_edge(%struct.edge* %0) {
%2 = alloca %struct.edge*
store %struct.edge* %0, %struct.edge** %2
%3 = load %struct.edge*, %struct.edge** %2
%4 = bitcast %struct.edge* %3 to i16*
%5 = call i32 @free_object(i32 14, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.edge = type { i32 }
define void @free_edge(%struct.edge* %0) {
%2 = bitcast %struct.edge* %0 to i16*
%3 = tail call i32 @free_object(i32 14, i16* %2)
ret void
}
/* Variables and functions */
void *init_sum_c(int);
void *init_c(int n) { return init_sum_c(n); }


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

x86 assembly (clang, -O2):
<init_c>:
jmp    1030 <init_sum_c@plt>

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

LLVM IR (-O2):
define i8* @init_c(i32 %0) {
%2 = tail call i8* @init_sum_c(i32 %0)
ret i8* %2
}
void s2e_warning(const char *message) {
  __s2e_touch_string(message);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x10, 0x01, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       :
                       : "a"(message));
}


x86 assembly (clang, -O0):
<s2e_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <__s2e_touch_string@plt>
mov    -0x8(%rbp),%rax
(bad)
add    %dl,(%rax)
add    %eax,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_warning>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__s2e_touch_string@plt>
mov    %rbx,%rax
(bad)
add    %dl,(%rax)
add    %eax,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @s2e_warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %3)
%5 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @s2e_warning(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %0)
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x10, 0x01, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void ud2(void) { asm volatile("ud2"); }


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

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

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

LLVM IR (-O2):
define void @ud2() {
tail call void asm sideeffect "ud2", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
char tohex(char hexdigit) {
  return hexdigit > 9 ? hexdigit + 'a' - 10 : hexdigit + '0';
}


x86 assembly (clang, -O0):
<tohex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jle    1129 <tohex+0x29>
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <tohex+0x33>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohex>:
cmp    $0xa,%dil
mov    $0x57,%ecx
mov    $0x30,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @tohex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 9
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, 97
%10 = sub nsw i32 %9, 10
br label %15
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 48
br label %15
15: ; preds = %11, %6
%16 = phi i32 [ %10, %6 ], [ %14, %11 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @tohex(i8 signext %0) {
%2 = icmp sgt i8 %0, 9
%3 = select i1 %2, i8 87, i8 48
%4 = add i8 %3, %0
ret i8 %4
}