xunge/DecIR huggingface dataset:
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  i = 0;
  if (s && f)
    while (*(s + i))
      f(s + i++);
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <ft_striter+0x69>
cmpq   $0x0,-0x10(%rbp)
je     1169 <ft_striter+0x69>
jmp    1132 <ft_striter+0x32>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1164 <ft_striter+0x64>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
add    %rcx,%rdi
call   *%rax
jmp    1132 <ft_striter+0x32>
jmp    1169 <ft_striter+0x69>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
%12 = add nuw i64 %10, 1
tail call void %1(i8* %11)
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int function1(int, int);
int main() {
  int x;
  x = function1(3, 5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <function1@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @function1(i32 3, i32 5)
ret i32 0
}
int lib_add(const int a, const int b) { return a + b; }


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

x86 assembly (clang, -O2):
<lib_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @lib_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @lib_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
scalar_t__ isDivisible(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char str[1000];
  scanf("%s", str);
  if (isDivisible(str))
    printf("Is Divisible");
  else
    printf("Not Divisible");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1030 <isDivisible@plt>
cmp    $0x0,%rax
je     117c <main+0x4c>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
jmp    1188 <main+0x58>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <isDivisible@plt>
test   %rax,%rax
lea    0xeb4(%rip),%rax
lea    0xea0(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"Is Divisible\00"
@.str.2 = [14 x i8] c"Not Divisible\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i64 @isDivisible(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [13 x i8] c"Is Divisible\00"
@.str.2 = [14 x i8] c"Not Divisible\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @isDivisible(i8* %2)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%7 = call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
int x7_process_request(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x7_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
void SPIDMADisable(unsigned long ulBase, unsigned long ulDmaMode) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~ulDmaMode;
}


x86 assembly (clang, -O0):
<SPIDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDMADisable>:
not    %rsi
and    %rsi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @SPIDMADisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 4
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @SPIDMADisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_configure_buffers(unsigned short);
int /*<<< orphan*/ serial_configure_line(unsigned short, int, int, int);
int /*<<< orphan*/ serial_configure_modem(unsigned short);
int /*<<< orphan*/ serial_set_baud_rate(unsigned short, int);
void serial_init(unsigned short com) {
  serial_set_baud_rate(com, 115200);
  serial_configure_buffers(com);
  serial_configure_line(com, 0x03, 0x00, 0X00);
  serial_configure_modem(com);
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1c200,%esi
movzwl -0x2(%rbp),%edi
call   1030 <serial_set_baud_rate@plt>
movzwl -0x2(%rbp),%edi
call   1050 <serial_configure_buffers@plt>
mov    $0x3,%esi
xor    %ecx,%ecx
movzwl -0x2(%rbp),%edi
mov    %ecx,%edx
call   1060 <serial_configure_line@plt>
movzwl -0x2(%rbp),%edi
call   1040 <serial_configure_modem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
push   %rbx
mov    %edi,%ebx
mov    $0x1c200,%esi
call   1030 <serial_set_baud_rate@plt>
mov    %ebx,%edi
call   1050 <serial_configure_buffers@plt>
mov    %ebx,%edi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1060 <serial_configure_line@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <serial_configure_modem@plt>

LLVM IR (-O0):
define void @serial_init(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @serial_set_baud_rate(i16 zeroext %3, i32 115200)
%5 = load i16, i16* %2
%6 = call i32 @serial_configure_buffers(i16 zeroext %5)
%7 = load i16, i16* %2
%8 = call i32 @serial_configure_line(i16 zeroext %7, i32 3, i32 0, i32 0)
%9 = load i16, i16* %2
%10 = call i32 @serial_configure_modem(i16 zeroext %9)
ret void
}

LLVM IR (-O2):
define void @serial_init(i16 zeroext %0) {
%2 = tail call i32 @serial_set_baud_rate(i16 zeroext %0, i32 115200)
%3 = tail call i32 @serial_configure_buffers(i16 zeroext %0)
%4 = tail call i32 @serial_configure_line(i16 zeroext %0, i32 3, i32 0, i32 0)
%5 = tail call i32 @serial_configure_modem(i16 zeroext %0)
ret void
}
/* Type definitions */
typedef int ssize_t;
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ lseek(int, scalar_t__, int /*<<< orphan*/);
int read(int, void *, size_t);
ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
  if (lseek(fd, offset, SEEK_SET) != offset)
    return -1;
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<pread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    -0x20(%rbp),%rax
je     1162 <pread+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <pread+0x55>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pread>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    %rcx,%rsi
call   1030 <lseek@plt>
cmp    %rbx,%rax
jne    115f <pread+0x3f>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <read@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @pread(i32 %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i64 @lseek(i32 %0, i64 %3, i32 %5)
%7 = icmp eq i64 %6, %3
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
int strspn(str, class) char *str, *class;
{
  register char *st = str;
  while (*st && index(class, *st))
    ++st;
  return st - str;
}


x86 assembly (clang, -O0):
<strspn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1157 <strspn+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
call   1030 <index@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1167 <strspn+0x57>
jmp    1178 <strspn+0x68>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <strspn+0x18>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strspn>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%al
mov    %rdi,%rbx
test   %al,%al
je     114c <strspn+0x3c>
mov    %rsi,%r15
mov    %r14,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r15,%rdi
call   1030 <index@plt>
test   %rax,%rax
je     114c <strspn+0x3c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strspn+0x20>
sub    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @strspn(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %13, %11 ], [ %3, %2 ]
%7 = phi i8* [ %12, %11 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = tail call i8* @index(i8* %1, i32 %8)
%10 = icmp eq i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %11, %2
%16 = phi i8* [ %0, %2 ], [ %12, %11 ], [ %7, %5 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ push_float(double);
void fn_pi(void) { push_float(3.14159265358979323846); }


x86 assembly (clang, -O0):
<fn_pi>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <push_float@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_pi>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <push_float@plt>

LLVM IR (-O0):
define void @fn_pi() {
%1 = call i32 @push_float(double 0x400921FB54442D18)
ret void
}

LLVM IR (-O2):
define void @fn_pi() {
%1 = tail call i32 @push_float(double 0x400921FB54442D18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_init() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_init>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_init() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void init_net(double *v, int n) {
  int i;
  for (i = 0; i < n; i++)
    v[i] = 0.0;
}


x86 assembly (clang, -O0):
<init_net>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <init_net+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <init_net+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_net>:
test   %esi,%esi
jle    1126 <init_net+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @init_net(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
store double 0.000000e+00, double* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @init_net(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int write(int, unsigned char *, int);
int send_byte(unsigned char ch) { return ((write(1, &ch, 1) < 1) ? -1 : 0); }


x86 assembly (clang, -O0):
<send_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x1,%edx
cmovl  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_byte>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @send_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
%4 = icmp slt i32 %3, 1
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 -1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @send_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
%4 = icmp slt i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int N;
  scanf("%d", &N);
  printf("%d\n", N + (N % 10) + (int)(N / 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    %edx,%esi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %eax,%esi
sub    %edx,%esi
add    %eax,%esi
add    %ecx,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 10
%6 = add nsw i32 %5, %4
%7 = sdiv i32 %4, 10
%8 = add nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void trim(char *buf) {
  while (*buf && *buf != '\n')
    buf++;
  *buf = '\0';
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <trim+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <trim+0x3d>
jmp    114e <trim+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trim+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <trim+0x11>
cmp    $0xa,%al
je     1111 <trim+0x11>
add    $0x1,%rdi
jmp    1100 <trim>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
store i8 0, i8* %19
ret void
}

LLVM IR (-O2):
define void @trim(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
ret void
}
int cycle_get_xpos(unsigned int flags) {
  return ((flags & 0x003f0000) >> 16) << 3;
}


x86 assembly (clang, -O0):
<cycle_get_xpos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f0000,%eax
shr    $0x10,%eax
shl    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_get_xpos>:
mov    %edi,%eax
shr    $0xd,%eax
and    $0x1f8,%eax
ret

LLVM IR (-O0):
define i32 @cycle_get_xpos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4128768
%5 = lshr i32 %4, 16
%6 = shl i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @cycle_get_xpos(i32 %0) {
%2 = lshr i32 %0, 13
%3 = and i32 %2, 504
ret i32 %3
}
void cth_startloop_helper(void *_start) {
  void (*start)(void) = _start;
  while (1)
    start();
}


x86 assembly (clang, -O0):
<cth_startloop_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
call   *-0x10(%rbp)
jmp    1114 <cth_startloop_helper+0x14>

x86 assembly (clang, -O2):
<cth_startloop_helper>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   *%rbx
jmp    1110 <cth_startloop_helper+0x10>

LLVM IR (-O0):
define void @cth_startloop_helper(i8* %0) {
%2 = alloca i8*
%3 = alloca void ()*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to void ()*
store void ()* %5, void ()** %3
br label %6
6: ; preds = %1, %6
%7 = load void ()*, void ()** %3
br label %6
}

LLVM IR (-O2):
define void @cth_startloop_helper(i8* nocapture %0) {
%2 = bitcast i8* %0 to void ()*
br label %3
3: ; preds = %3, %1
tail call void %2()
br label %3
}
/* Variables and functions */
void *string_dup(char *);
void *guppy_rawnamenode_hook_copy(void *hook) {
  char *rawname = (char *)hook;
  if (rawname) {
    return string_dup(rawname);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<guppy_rawnamenode_hook_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1141 <guppy_rawnamenode_hook_copy+0x31>
mov    -0x18(%rbp),%rdi
call   1030 <string_dup@plt>
mov    %rax,-0x8(%rbp)
jmp    1149 <guppy_rawnamenode_hook_copy+0x39>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guppy_rawnamenode_hook_copy>:
test   %rdi,%rdi
je     111a <guppy_rawnamenode_hook_copy+0xa>
jmp    1030 <string_dup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @guppy_rawnamenode_hook_copy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @string_dup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
const char *rrdset_type_name(int chart_type) {
  static char line[] = "line";
  static char area[] = "area";
  static char stacked[] = "stacked";
  switch (chart_type) {
  case 0:
    return line;
  case 1:
    return area;
  case 2:
    return stacked;
  }
  return line;
}


x86 assembly (clang, -O0):
<rrdset_type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <rrdset_type_name+0x3c>
jmp    111a <rrdset_type_name+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <rrdset_type_name+0x4c>
jmp    112b <rrdset_type_name+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <rrdset_type_name+0x5c>
jmp    116c <rrdset_type_name+0x6c>
lea    0x2edd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <rrdset_type_name+0x77>
lea    0x2ed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <rrdset_type_name+0x77>
lea    0x2ec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <rrdset_type_name+0x77>
lea    0x2ead(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrdset_type_name>:
cmp    $0x1,%edi
lea    0x2f1b(%rip),%rax
lea    0x2f0f(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x2,%edi
lea    0x2f0b(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@rrdset_type_name.line = internal global [5 x i8] c"line\00"
@rrdset_type_name.area = internal global [5 x i8] c"area\00"
@rrdset_type_name.stacked = internal global [8 x i8] c"stacked\00"
define i8* @rrdset_type_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @rrdset_type_name.line, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @rrdset_type_name.area, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @rrdset_type_name.stacked, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @rrdset_type_name.line, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@rrdset_type_name.line = internal global [5 x i8] c"line\00"
@rrdset_type_name.area = internal global [5 x i8] c"area\00"
@rrdset_type_name.stacked = internal global [8 x i8] c"stacked\00"
define i8* @rrdset_type_name(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @rrdset_type_name.area, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @rrdset_type_name.line, i64 0, i64 0)
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @rrdset_type_name.stacked, i64 0, i64 0), i8* %3
ret i8* %5
}
double mm2in(double d) { return d / 25.4; }


x86 assembly (clang, -O0):
<mm2in>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm2in>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mm2in(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 2.540000e+01
ret double %4
}

LLVM IR (-O2):
define double @mm2in(double %0) {
%2 = fdiv double %0, 2.540000e+01
ret double %2
}
char *procprt_LOCKSZ_e(struct tstat *curstat, int avgval, int nsecs) {
  return "    0K";
}


x86 assembly (clang, -O0):
<procprt_LOCKSZ_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_LOCKSZ_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [7 x i8] c" 0K\00"
define i8* @procprt_LOCKSZ_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_start_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(287, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_start_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11f,%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):
<copy_multprec_start_solutions_to_container>:
mov    $0x11f,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @copy_multprec_start_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 287, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int get_week(int c, int y, int m, int d) {
  return y + y / 4 + c / 4 - 2 * c + 26 * (m + 1) / 10 + d - 1;
}


x86 assembly (clang, -O0):
<get_week>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
imul   $0x1a,%eax,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    -0x10(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_week>:
lea    0x3(%rsi),%r8d
test   %esi,%esi
cmovns %esi,%r8d
sar    $0x2,%r8d
lea    0x3(%rdi),%r9d
test   %edi,%edi
cmovns %edi,%r9d
sar    $0x2,%r9d
add    %edi,%edi
lea    (%rdx,%rdx,4),%eax
lea    (%rax,%rax,4),%eax
add    %edx,%eax
add    $0x1a,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
add    %esi,%r9d
sub    %edi,%r9d
add    %r8d,%r9d
add    %ecx,%r9d
add    %r9d,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_week(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = sdiv i32 %10, 4
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %5
%14 = sdiv i32 %13, 4
%15 = add nsw i32 %12, %14
%16 = load i32, i32* %5
%17 = mul nsw i32 2, %16
%18 = sub nsw i32 %15, %17
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
%21 = mul nsw i32 26, %20
%22 = sdiv i32 %21, 10
%23 = add nsw i32 %18, %22
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
%26 = sub nsw i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_week(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sdiv i32 %1, 4
%6 = sdiv i32 %0, 4
%7 = mul i32 %0, -2
%8 = mul i32 %2, 26
%9 = add i32 %8, 26
%10 = sdiv i32 %9, 10
%11 = add i32 %1, -1
%12 = add i32 %11, %6
%13 = add i32 %12, %7
%14 = add i32 %13, %5
%15 = add i32 %14, %3
%16 = add i32 %15, %10
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ _BIOS_RET();
void _BIOS_LIST() { _BIOS_RET(); }


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

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

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

LLVM IR (-O2):
define void @_BIOS_LIST() {
%1 = tail call i32 (...) @_BIOS_RET()
ret void
}
void MITLogFlush(void) {}


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

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

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

LLVM IR (-O2):
define void @MITLogFlush() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ port_byte_out(int, unsigned char);
void set_cursor(int offset) {
  offset /= 2;
  port_byte_out(0x3d4, 14);
  port_byte_out(0x3d5, (unsigned char)(offset >> 8));
  port_byte_out(0x3d4, 15);
  port_byte_out(0x3d5, (unsigned char)(offset));
}


x86 assembly (clang, -O0):
<set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
mov    -0x4(%rbp),%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <port_byte_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor>:
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%ebx
add    %edi,%ebx
sar    %ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <port_byte_out@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
call   1030 <port_byte_out@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <port_byte_out@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <port_byte_out@plt>

LLVM IR (-O0):
define void @set_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
store i32 %4, i32* %2
%5 = call i32 @port_byte_out(i32 980, i8 zeroext 14)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = call i32 @port_byte_out(i32 981, i8 zeroext %8)
%10 = call i32 @port_byte_out(i32 980, i8 zeroext 15)
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
%13 = call i32 @port_byte_out(i32 981, i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @set_cursor(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 @port_byte_out(i32 980, i8 zeroext 14)
%4 = lshr i32 %2, 8
%5 = trunc i32 %4 to i8
%6 = tail call i32 @port_byte_out(i32 981, i8 zeroext %5)
%7 = tail call i32 @port_byte_out(i32 980, i8 zeroext 15)
%8 = trunc i32 %2 to i8
%9 = tail call i32 @port_byte_out(i32 981, i8 zeroext %8)
ret void
}
void clk_register_dump_ops(struct clk_dump_ops *ops) {}


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

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

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

LLVM IR (-O2):
%struct.clk_dump_ops = type opaque
define void @clk_register_dump_ops(%struct.clk_dump_ops* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_POINTS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2i(int, int);
void setPixel(int x, int y) {
  glBegin(GL_POINTS);
  glVertex2i(x, y);
  glEnd();
}


x86 assembly (clang, -O0):
<setPixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <glVertex2i@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPixel>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <glVertex2i@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_POINTS = global i32 0
define void @setPixel(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_POINTS
%6 = call i32 @glBegin(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @glVertex2i(i32 %7, i32 %8)
%10 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_POINTS = global i32 0
define void @setPixel(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_POINTS
%4 = tail call i32 @glBegin(i32 %3)
%5 = tail call i32 @glVertex2i(i32 %0, i32 %1)
%6 = tail call i32 (...) @glEnd()
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int arr[], int lowIndex, int highIndex) {
  if (lowIndex < highIndex) {
    int pivot = partition(arr, lowIndex, highIndex);
    quickSort(arr, lowIndex, pivot - 1);
    quickSort(arr, pivot + 1, highIndex);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
float ResDiv(float, float);
int /*<<< orphan*/ splash(int);
int square(int);
int main() {
  int a = 8;
  int b = 2;
  splash(a);
  float k1 = 50.0 * a;
  float k2 = 150.0 * b;
  float k = ResDiv(k1, k2);
  int c = a / b;
  c /= 3 * (2 - b) + 4;
  return square(c + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <splash@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xea6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe84(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1050 <ResDiv@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x1c(%rbp)
mov    $0x2,%eax
sub    -0xc(%rbp),%eax
imul   $0x3,%eax,%ecx
add    $0x4,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
add    $0x1,%edi
call   1030 <square@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <splash@plt>
movss  0xebd(%rip),%xmm0
movss  0xeb9(%rip),%xmm1
call   1050 <ResDiv@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <square@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i32 0, i32* %1
store i32 8, i32* %2
store i32 2, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @splash(i32 %8)
%10 = load i32, i32* %2
%11 = sitofp i32 %10 to double
%12 = fmul double 5.000000e+01, %11
%13 = fptrunc double %12 to float
store float %13, float* %4
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fmul double 1.500000e+02, %15
%17 = fptrunc double %16 to float
store float %17, float* %5
%18 = load float, float* %4
%19 = load float, float* %5
%20 = call float @ResDiv(float %18, float %19)
store float %20, float* %6
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = sdiv i32 %21, %22
store i32 %23, i32* %7
%24 = load i32, i32* %3
%25 = sub nsw i32 2, %24
%26 = mul nsw i32 3, %25
%27 = add nsw i32 %26, 4
%28 = load i32, i32* %7
%29 = sdiv i32 %28, %27
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
%32 = call i32 @square(i32 %31)
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @splash(i32 8)
%2 = tail call float @ResDiv(float 4.000000e+02, float 3.000000e+02)
%3 = tail call i32 @square(i32 2)
ret i32 %3
}
long double ldabs(long double n) {
  if (n < 0) {
    n *= -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<ldabs>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    1126 <ldabs+0x26>
jmp    111e <ldabs+0x1e>
fldt   -0x10(%rbp)
fchs
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldabs>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @ldabs(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 %3, 0xK00000000000000000000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load x86_fp80, x86_fp80* %2
%7 = fmul x86_fp80 %6, 0xKBFFF8000000000000000
store x86_fp80 %7, x86_fp80* %2
br label %8
8: ; preds = %5, %1
%9 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @ldabs(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %3, x86_fp80 %0
ret x86_fp80 %4
}