xunge/DecIR huggingface dataset:
/* Variables and functions */
int line_length(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int line_size = 0;
  char sentence[1000];
  while ((line_size = line_length(sentence, 1000)) > 0)
    if (line_size > 80)
      printf("Valid line: %s\n", sentence);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <line_length@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1178 <main+0x58>
cmpl   $0x50,-0x8(%rbp)
jle    1173 <main+0x53>
lea    -0x3f0(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <line_length@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <line_length@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Valid line: %s\0A\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 @line_length(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @line_length(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int socket(int, int, int);
int w_socket(int domain, int type, int protocol) {
  int sockfd = socket(domain, type, protocol);
  return sockfd;
}


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

x86 assembly (clang, -O2):
<w_socket>:
jmp    1030 <socket@plt>

LLVM IR (-O0):
define i32 @w_socket(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* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @w_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void ComparatorIntUnregister(uint32_t ui32Base, uint32_t ui32Comp) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(1 << ui32Comp);
  IntDisable(41 + ui32Comp);
  IntUnregister(41 + ui32Comp);
}


x86 assembly (clang, -O0):
<ComparatorIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edi
add    $0x29,%edi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%edi
add    $0x29,%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntUnregister>:
push   %rbx
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
movslq %edi,%rdx
and    %eax,0x8(%rdx)
lea    0x29(%rcx),%ebx
mov    %ebx,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @ComparatorIntUnregister(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, %7
store volatile i32 %13, i32* %11
%14 = load i32, i32* %4
%15 = add nsw i32 41, %14
%16 = call i32 @IntDisable(i32 %15)
%17 = load i32, i32* %4
%18 = add nsw i32 41, %17
%19 = call i32 @IntUnregister(i32 %18)
ret void
}

LLVM IR (-O2):
define void @ComparatorIntUnregister(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = add nsw i32 %0, 8
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %4
store volatile i32 %9, i32* %7
%10 = add nsw i32 %1, 41
%11 = tail call i32 @IntDisable(i32 %10)
%12 = tail call i32 @IntUnregister(i32 %10)
ret void
}
/* Variables and functions */
int ft_atoi(char *);
int /*<<< orphan*/ ft_putnbr(int);
void ft_add(char *num1, char *num2) {
  int i_num1;
  int i_num2;
  i_num1 = ft_atoi(num1);
  i_num2 = ft_atoi(num2);
  ft_putnbr(i_num1 + i_num2);
}


x86 assembly (clang, -O0):
<ft_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    -0x18(%rbp),%edi
call   1030 <ft_putnbr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_add>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <ft_atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <ft_atoi@plt>
add    %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ft_putnbr@plt>

LLVM IR (-O0):
define void @ft_add(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @ft_atoi(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @ft_atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = call i32 @ft_putnbr(i32 %13)
ret void
}

LLVM IR (-O2):
define void @ft_add(i8* %0, i8* %1) {
%3 = tail call i32 @ft_atoi(i8* %0)
%4 = tail call i32 @ft_atoi(i8* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @ft_putnbr(i32 %5)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c, previousc;
  previousc = 0;
  while ((c = getchar()) != EOF) {
    if (c == ' ' && previousc == ' ') {
    } else {
      putchar(c);
    }
    previousc = c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     117b <main+0x5b>
cmpl   $0x20,-0x8(%rbp)
jne    1168 <main+0x48>
cmpl   $0x20,-0xc(%rbp)
jne    1168 <main+0x48>
jmp    1170 <main+0x50>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%eax
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %ebx,%ebx
jmp    1163 <main+0x43>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     1137 <main+0x17>
mov    %ebx,%ecx
mov    %eax,%ebx
cmp    $0x20,%ecx
jne    1150 <main+0x30>
cmp    $0x20,%ebx
je     1157 <main+0x37>
jmp    1150 <main+0x30>

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %16, label %4
4: ; preds = %0, %12
%5 = phi i32 [ %13, %12 ], [ %1, %0 ]
%6 = phi i32 [ %5, %12 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 32
%8 = icmp eq i32 %6, 32
%9 = and i1 %8, %7
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 @putchar(i32 %5)
br label %12
12: ; preds = %4, %10
%13 = tail call i32 (...) @getchar()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %4
16: ; preds = %12, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ collapse_horizontal();
int /*<<< orphan*/ collapse_vertical();
int /*<<< orphan*/ highlight_none();
int collapse() {
  collapse_vertical();
  collapse_horizontal();
  highlight_none();
  return 0;
}


x86 assembly (clang, -O0):
<collapse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <collapse_vertical@plt>
mov    $0x0,%al
call   1040 <collapse_horizontal@plt>
mov    $0x0,%al
call   1050 <highlight_none@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<collapse>:
push   %rax
xor    %eax,%eax
call   1030 <collapse_vertical@plt>
xor    %eax,%eax
call   1040 <collapse_horizontal@plt>
xor    %eax,%eax
call   1050 <highlight_none@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @collapse() {
%1 = call i32 (...) @collapse_vertical()
%2 = call i32 (...) @collapse_horizontal()
%3 = call i32 (...) @highlight_none()
ret i32 0
}

LLVM IR (-O2):
define i32 @collapse() {
%1 = tail call i32 (...) @collapse_vertical()
%2 = tail call i32 (...) @collapse_horizontal()
%3 = tail call i32 (...) @highlight_none()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void endDlgFunction(FILE *dst) {
  fprintf(dst, "        }\n\n");
  fprintf(dst, "    return hDlg;\n");
  fprintf(dst, "}\n\n");
}


x86 assembly (clang, -O0):
<endDlgFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endDlgFunction>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xed8(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xebb(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [12 x i8] c" }\0A\0A\00"
@.str.1 = [18 x i8] c" return hDlg;\0A\00"
@.str.2 = [4 x i8] c"}\0A\0A\00"
define void @endDlgFunction(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" }\0A\0A\00"
@.str.1 = [18 x i8] c" return hDlg;\0A\00"
@.str.2 = [4 x i8] c"}\0A\0A\00"
define void @endDlgFunction(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 17, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int cpspc_time();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  for (i = 0; i < 100000000; i++)
    ;
  printf("%d\n", cpspc_time());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    1156 <main+0x36>
jmp    1148 <main+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1030 <cpspc_time@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @cpspc_time()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
double getpagesize();
double pages_to_gb(int pages) {
  return pages * (getpagesize() / 1024.0 / 1024.0 / 1024.0);
}


x86 assembly (clang, -O0):
<pages_to_gb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xeb8(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xeac(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pages_to_gb>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <getpagesize@plt>
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pages_to_gb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double (...) @getpagesize()
%6 = fdiv double %5, 1.024000e+03
%7 = fdiv double %6, 1.024000e+03
%8 = fdiv double %7, 1.024000e+03
%9 = fmul double %4, %8
ret double %9
}

LLVM IR (-O2):
define double @pages_to_gb(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double (...) @getpagesize()
%4 = fmul double %3, 0x3F50000000000000
%5 = fmul double %4, 0x3F50000000000000
%6 = fmul double %5, 0x3F50000000000000
%7 = fmul double %6, %2
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ _scanf_getll(char *, long long *, int, int, int);
int /*<<< orphan*/ safe_gets(char *, int);
unsigned long long getlfnum(int base, int isSigned, int width) {
  char buf[80];
  safe_gets(buf, 80);
  if (width > 80)
    width = 80;
  unsigned long long x = 0;
  _scanf_getll(buf, (long long *)&x, base, width, isSigned);
  return x;
}


x86 assembly (clang, -O0):
<getlfnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x60(%rbp),%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
cmpl   $0x50,-0xc(%rbp)
jle    1150 <getlfnum+0x30>
movl   $0x50,-0xc(%rbp)
movq   $0x0,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    -0x68(%rbp),%rsi
call   1040 <_scanf_getll@plt>
mov    -0x68(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlfnum>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x60,%rsp
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%r12d
lea    0x10(%rsp),%r15
mov    $0x50,%ebp
mov    %r15,%rdi
mov    $0x50,%esi
call   1030 <safe_gets@plt>
cmp    $0x50,%ebx
cmovl  %ebx,%ebp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1040 <_scanf_getll@plt>
mov    0x8(%rsp),%rax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @getlfnum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [80 x i8]
%8 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%10 = call i32 @safe_gets(i8* %9, i32 80)
%11 = load i32, i32* %6
%12 = icmp sgt i32 %11, 80
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 80, i32* %6
br label %14
14: ; preds = %13, %3
store i64 0, i64* %8
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = load i32, i32* %5
%19 = call i32 @_scanf_getll(i8* %15, i64* %8, i32 %16, i32 %17, i32 %18)
%20 = load i64, i64* %8
ret i64 %20
}

LLVM IR (-O2):
define i64 @getlfnum(i32 %0, i32 %1, i32 %2) {
%4 = alloca [80 x i8]
%5 = alloca i64
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%7 = call i32 @safe_gets(i8* %6, i32 80)
%8 = icmp slt i32 %2, 80
%9 = select i1 %8, i32 %2, i32 80
%10 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%11 = call i32 @_scanf_getll(i8* %6, i64* %5, i32 %0, i32 %9, i32 %1)
%12 = load i64, i64* %5
ret i64 %12
}
/* Variables and functions */
void *init_qnode();
void *malloc(int);
void *init_slot(int type) {
  void *slot = NULL;
  if (type == 8) {
    slot = malloc(sizeof(int));
  } else if (type == 16) {
    slot = init_qnode();
  }
  return (slot);
}


x86 assembly (clang, -O0):
<init_slot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x4(%rbp)
jne    1150 <init_slot+0x30>
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
jmp    116a <init_slot+0x4a>
cmpl   $0x10,-0x4(%rbp)
jne    1165 <init_slot+0x45>
mov    $0x0,%al
call   1040 <init_qnode@plt>
mov    %rax,-0x10(%rbp)
jmp    116a <init_slot+0x4a>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_slot>:
cmp    $0x10,%edi
je     1134 <init_slot+0x14>
cmp    $0x8,%edi
jne    113b <init_slot+0x1b>
mov    $0x4,%edi
jmp    1030 <malloc@plt>
xor    %eax,%eax
jmp    1040 <init_qnode@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @init_slot(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 8
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i8* @malloc(i32 4)
store i8* %7, i8** %3
br label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 16
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i8* (...) @init_qnode()
store i8* %12, i8** %3
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13, %6
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @init_slot(i32 %0) {
switch i32 %0, label %6 [
i32 8, label %2
i32 16, label %4
]
2: ; preds = %1
%3 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
br label %6
4: ; preds = %1
%5 = tail call i8* (...) @init_qnode()
br label %6
6: ; preds = %1, %4, %2
%7 = phi i8* [ %3, %2 ], [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int i2c_smbus_write_byte(int, int);
int bananapiI2CWrite(int fd, int data) {
  return i2c_smbus_write_byte(fd, data);
}


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

x86 assembly (clang, -O2):
<bananapiI2CWrite>:
jmp    1030 <i2c_smbus_write_byte@plt>

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

LLVM IR (-O2):
define i32 @bananapiI2CWrite(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_write_byte(i32 %0, i32 %1)
ret i32 %3
}
int get_action_contrite(int myRep, int hisRep) {
  if (myRep == 0 || hisRep == 1) {
    return 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_action_contrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111e <get_action_contrite+0x1e>
cmpl   $0x1,-0xc(%rbp)
jne    112a <get_action_contrite+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <get_action_contrite+0x31>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_action_contrite>:
xor    %eax,%eax
cmp    $0x1,%esi
sete   %al
test   %edi,%edi
lea    -0x1(%rax,%rax,1),%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_action_contrite(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 1
%5 = or i1 %3, %4
%6 = select i1 %5, i32 1, i32 -1
ret i32 %6
}
double dlamc3_(double *a, double *b) {
  volatile double ret_val;
  ret_val = *a + *b;
  return ret_val;
}


x86 assembly (clang, -O0):
<dlamc3_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlamc3_>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  %xmm0,-0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @dlamc3_(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = fadd double %7, %9
store volatile double %10, double* %5
%11 = load volatile double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @dlamc3_(double* nocapture %0, double* nocapture %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = load double, double* %0
%6 = load double, double* %1
%7 = fadd double %5, %6
store volatile double %7, double* %3
%8 = load volatile double, double* %3
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_user_inputs(char *text) { printf("INFO: user input=%s\n", text); }


x86 assembly (clang, -O0):
<print_user_inputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_user_inputs>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"INFO: user input=%s\0A\00"
define void @print_user_inputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"INFO: user input=%s\0A\00"
define void @print_user_inputs(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
adrreg0adr1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= (*((unsigned short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
mov    $0xa98ac7,%ecx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <adrreg0adr1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <adrreg0adr1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adr1>:
movzwl 0x1312d00(%r8),%ecx
01
xor    %eax,%eax
cmp    0xa98ac7,%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @adrreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = zext i16 %18 to i32
%20 = load i16, i16* inttoptr (i64 11111111 to i16*)
%21 = zext i16 %20 to i32
%22 = icmp sle i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @adrreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = load i16, i16* inttoptr (i64 11111111 to i16*)
%10 = icmp ule i16 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
scalar_t__ chk_base2_palin(int);
int next_base10_palin(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int s = 0;
  int sum = 0;
  while (s < 1000000) {
    s = next_base10_palin(s);
    if (chk_base2_palin(s))
      sum += s;
  }
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf4240,-0x8(%rbp)
jge    1185 <main+0x55>
mov    -0x8(%rbp),%edi
call   1040 <next_base10_palin@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <chk_base2_palin@plt>
cmp    $0x0,%rax
je     1180 <main+0x50>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <next_base10_palin@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <chk_base2_palin@plt>
test   %rax,%rax
mov    %ebp,%eax
cmove  %r14d,%eax
add    %eax,%ebx
cmp    $0xf4240,%ebp
jl     1140 <main+0x10>
lea    0xe96(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %4, %1 ]
%4 = tail call i32 @next_base10_palin(i32 %3)
%5 = tail call i64 @chk_base2_palin(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 0, i32 %4
%8 = add nsw i32 %7, %2
%9 = icmp slt i32 %4, 1000000
br i1 %9, label %1, label %10
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ HashedTbl_isPrime(int);
int __HashedTbl_getOptSize(int suggest, int *lastIndex) {
  int cur;
  for (cur = suggest; cur < 1565807; cur++) {
    if (HashedTbl_isPrime(cur)) {
      return (cur);
    }
  }
  return (suggest);
}


x86 assembly (clang, -O0):
<__HashedTbl_getOptSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x17e46f,-0x14(%rbp)
jge    1162 <__HashedTbl_getOptSize+0x52>
mov    -0x14(%rbp),%edi
call   1030 <HashedTbl_isPrime@plt>
cmp    $0x0,%rax
je     114f <__HashedTbl_getOptSize+0x3f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <__HashedTbl_getOptSize+0x58>
jmp    1154 <__HashedTbl_getOptSize+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1125 <__HashedTbl_getOptSize+0x15>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__HashedTbl_getOptSize>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x17e46e,%edi
jg     113b <__HashedTbl_getOptSize+0x2b>
mov    %ebx,%ebp
nop
mov    %ebp,%edi
call   1030 <HashedTbl_isPrime@plt>
test   %rax,%rax
jne    1139 <__HashedTbl_getOptSize+0x29>
add    $0x1,%ebp
cmp    $0x17e46f,%ebp
jne    1120 <__HashedTbl_getOptSize+0x10>
jmp    113b <__HashedTbl_getOptSize+0x2b>
mov    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @__HashedTbl_getOptSize(i32 %0, i32* nocapture readnone %1) {
%3 = icmp slt i32 %0, 1565807
br i1 %3, label %4, label %11
4: ; preds = %2, %8
%5 = phi i32 [ %9, %8 ], [ %0, %2 ]
%6 = tail call i64 @HashedTbl_isPrime(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = add nsw i32 %5, 1
%10 = icmp eq i32 %9, 1565807
br i1 %10, label %11, label %4
11: ; preds = %4, %8, %2
%12 = phi i32 [ %0, %2 ], [ %0, %8 ], [ %5, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void clear_buffer(void) {
  char c;
  scanf("%c", &c);
  while (c != '\n') {
    scanf("%c", &c);
  }
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     114a <clear_buffer+0x3a>
lea    0xec4(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <scanf@plt>
jmp    1128 <clear_buffer+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
je     1152 <clear_buffer+0x42>
lea    0xecd(%rip),%r14
lea    0x7(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
jne    1140 <clear_buffer+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @clear_buffer() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %3
3: ; preds = %7, %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @clear_buffer() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 10
br i1 %4, label %9, label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %5
9: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ command_writers(char *);
int /*<<< orphan*/ wait_for_done_signal();
void command_writers_and_confirm(char *cmd) {
  command_writers(cmd);
  wait_for_done_signal();
}


x86 assembly (clang, -O0):
<command_writers_and_confirm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <command_writers@plt>
mov    $0x0,%al
call   1030 <wait_for_done_signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @command_writers_and_confirm(i8* %0) {
%2 = tail call i32 @command_writers(i8* %0)
%3 = tail call i32 (...) @wait_for_done_signal()
ret void
}
void thread_pool_abort() {}


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

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

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

LLVM IR (-O2):
define void @thread_pool_abort() {
ret void
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_setseq_64 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_64_xsl_rr_rr_64_random_r(struct pcg_state_setseq_64 *);
uint64_t
pcg_setseq_64_xsl_rr_rr_64_boundedrand_r(struct pcg_state_setseq_64 *rng,
                                         uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_setseq_64_xsl_rr_rr_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_64_xsl_rr_rr_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_64_xsl_rr_rr_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_64_xsl_rr_rr_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_64_xsl_rr_rr_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_64_xsl_rr_rr_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_64_xsl_rr_rr_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_64_xsl_rr_rr_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_64 = type { i32 }
define i32 @pcg_setseq_64_xsl_rr_rr_64_boundedrand_r(%struct.pcg_state_setseq_64* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_64* %0, %struct.pcg_state_setseq_64** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_64*, %struct.pcg_state_setseq_64** %3
%13 = call i32 @pcg_setseq_64_xsl_rr_rr_64_random_r(%struct.pcg_state_setseq_64* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_64 = type { i32 }
define i32 @pcg_setseq_64_xsl_rr_rr_64_boundedrand_r(%struct.pcg_state_setseq_64* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_64_xsl_rr_rr_64_random_r(%struct.pcg_state_setseq_64* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
struct timeval in() {
  struct timeval i;
  gettimeofday(&i, 0);
  return i;
}


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

x86 assembly (clang, -O2):
<in>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @in() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @in() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
void *memchr(const void *s1, int c, size_t n) {
  const unsigned char *s = s1;
  for (; n; --n, ++s) {
    if (*s == (unsigned char)c) {
      return (void *)s;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1166 <memchr+0x66>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1144 <memchr+0x44>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <memchr+0x6e>
jmp    1149 <memchr+0x49>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     111f <memchr+0x1f>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1121 <memchr+0x21>
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %12
%8 = phi i8* [ %0, %5 ], [ %14, %12 ]
%9 = phi i64 [ %2, %5 ], [ %13, %12 ]
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, %6
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = add i64 %9, -1
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = icmp eq i64 %13, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %12, %3
%17 = phi i8* [ null, %3 ], [ null, %12 ], [ %8, %7 ]
ret i8* %17
}
/* Variables and functions */
int atoi(char *);
int factorial(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int ans, sum;
  ans = factorial(atoi(argv[1]));
  printf("The factorial of %d is %d.\n", atoi(argv[1]), ans);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <factorial@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%esi
mov    -0x14(%rbp),%edx
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <factorial@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"The factorial of %d is %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
%11 = call i32 @factorial(i32 %10)
store i32 %11, i32* %5
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"The factorial of %d is %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @factorial(i32 %5)
%7 = load i8*, i8** %3
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ backtrack(unsigned int, unsigned int, unsigned int *,
                             int /*<<< orphan*/, unsigned int);
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ omp_set_num_threads(int);
int main(int argc, char *argv[]) {
  unsigned *tuple;
  unsigned size = 3;
  unsigned alphabet = 3;
  unsigned threading_depth = 1;
  tuple = (unsigned *)calloc(size, sizeof(unsigned));
  omp_set_num_threads(2);
  backtrack(size, alphabet, tuple, 0, threading_depth);
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x3,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
call   1050 <omp_set_num_threads@plt>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%r8d
xor    %ecx,%ecx
call   1040 <backtrack@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    $0x2,%edi
call   1050 <omp_set_num_threads@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1040 <backtrack@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %7
store i32 3, i32* %8
store i32 1, i32* %9
%10 = load i32, i32* %7
%11 = call i64 @calloc(i32 %10, i32 4)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %6
%13 = call i32 @omp_set_num_threads(i32 2)
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32*, i32** %6
%17 = load i32, i32* %9
%18 = call i32 @backtrack(i32 %14, i32 %15, i32* %16, i32 0, i32 %17)
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @calloc(i32 3, i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @omp_set_num_threads(i32 2)
%6 = tail call i32 @backtrack(i32 3, i32 3, i32* %4, i32 0, i32 1)
ret i32 1
}