xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ marker();
int main(void) {
  int pid;
  pid = fork();
  if (pid == 0) {
    _exit(0);
  } else {
  }
  pid = fork();
  if (pid == 0) {
    marker();
    _exit(0);
  } else {
    marker();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1153 <main+0x23>
xor    %edi,%edi
call   1030 <_exit@plt>
jmp    1158 <main+0x28>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    117a <main+0x4a>
mov    $0x0,%al
call   1050 <marker@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0x0,%al
call   1050 <marker@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     1154 <main+0x24>
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <marker@plt>
test   %ebx,%ebx
je     1154 <main+0x24>
xor    %eax,%eax
pop    %rbx
ret
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @_exit(i32 0)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @fork()
%7 = icmp eq i32 %6, 0
%8 = tail call i32 (...) @marker()
br i1 %7, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @_exit(i32 0)
unreachable
11: ; preds = %5
ret i32 0
}
/* Variables and functions */
scalar_t__ numBytesInFile(char *);
unsigned long long int numBytesInAllFiles(char **fileNames, int numFiles) {
  unsigned long long int sum = 0;
  int i;
  for (i = 0; i < numFiles; i++) {
    sum += numBytesInFile(fileNames[i]);
  }
  return sum;
}


x86 assembly (clang, -O0):
<numBytesInAllFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <numBytesInAllFiles+0x51>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <numBytesInFile@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <numBytesInAllFiles+0x1e>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numBytesInAllFiles>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <numBytesInAllFiles+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <numBytesInFile@plt>
add    %rax,%r12
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <numBytesInAllFiles+0x20>
jmp    114a <numBytesInAllFiles+0x3a>
xor    %r12d,%r12d
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @numBytesInAllFiles(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = phi i64 [ 0, %4 ], [ %12, %6 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i64 @numBytesInFile(i8* %10)
%12 = add i64 %11, %8
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i64 [ 0, %2 ], [ %12, %6 ]
ret i64 %16
}
unsigned int md5_I(unsigned int X, unsigned int Y, unsigned int Z) {
  return Y ^ (X | ~Z);
}


x86 assembly (clang, -O0):
<md5_I>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_I>:
mov    %edx,%eax
not    %eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @md5_I(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = or i32 %8, %10
%12 = xor i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @md5_I(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %1
ret i32 %6
}
int sound_deinit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sound_deinit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @sound_deinit() {
ret i32 0
}
void different_line(int *x) {
label_here:
label_in_between:
  *x = 1;
}


x86 assembly (clang, -O0):
<different_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <different_line+0xd>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<different_line>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @different_line(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i32*, i32** %2
store i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @different_line(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x5a() {
  Assert_real((isxdigit(90) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              455, ("isxdigit should be 0 for Z"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x5a>:
push   %rax
mov    $0x5a,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1c7,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for Z\00"
define void @t_isxdigit_0x5a() {
%1 = tail call i64 @isxdigit(i32 90)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 455, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int notok() { return 1; }


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

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

LLVM IR (-O0):
define i32 @notok() {
ret i32 1
}

LLVM IR (-O2):
define i32 @notok() {
ret i32 1
}
f(int *p) { --*p; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
addl   $0xffffffff,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, -1
store i32 %3, i32* %0
ret i32 undef
}
/* Variables and functions */
int spawnve(int, char const *, char const **, char const **);
int spawnle(int mode, const char *path, const char *argv0, ...) {
  char const **ptr;
  for (ptr = &argv0; *ptr; ptr++)
    ;
  ptr = (char const **)(*++ptr);
  ;
  return spawnve(mode, path, &argv0, ptr);
}


x86 assembly (clang, -O0):
<spawnle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <spawnle+0x3f>
jmp    113e <spawnle+0x2e>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <spawnle+0x1b>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x18(%rbp),%rdx
call   1030 <spawnve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawnle>:
push   %rax
mov    %rdx,(%rsp)
test   %rdx,%rdx
je     1130 <spawnle+0x20>
mov    %rsp,%rcx
nopl   (%rax)
lea    0x8(%rcx),%rax
cmpq   $0x0,0x8(%rcx)
mov    %rax,%rcx
jne    1120 <spawnle+0x10>
jmp    1133 <spawnle+0x23>
mov    %rsp,%rax
mov    0x8(%rax),%rcx
mov    %rsp,%rdx
call   1030 <spawnve@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @spawnle(i32 %0, i8* %1, i8* %2, ...) {
%4 = alloca i8*
store i8* %2, i8** %4
%5 = icmp eq i8* %2, null
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8** [ %8, %6 ], [ %4, %3 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %3
%12 = phi i8** [ %4, %3 ], [ %8, %6 ]
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = bitcast i8** %13 to i8***
%15 = load i8**, i8*** %14
%16 = call i32 @spawnve(i32 %0, i8* %1, i8** %4, i8** %15)
ret i32 %16
}
double core_timer_fetch_frequency(struct core_timer *timer) {
  double frequency;
  frequency = 1;
  return frequency;
}


x86 assembly (clang, -O0):
<core_timer_fetch_frequency>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.core_timer = type opaque
define double @core_timer_fetch_frequency(%struct.core_timer* %0) {
%2 = alloca %struct.core_timer*
%3 = alloca double
store %struct.core_timer* %0, %struct.core_timer** %2
store double 1.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
%struct.core_timer = type opaque
define double @core_timer_fetch_frequency(%struct.core_timer* nocapture readnone %0) {
ret double 1.000000e+00
}
int main(int argc, char *argv[]) {
  printf("*");
  asm("call "
      "x1");
  asm("call "
      "x2");
  asm("call "
      "x3");
  callx4();
  asm("call "
      "x5");
  callx5_again();
  x6();
  printf(" *\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
call   1080 <x1@plt>
call   1060 <x2@plt>
call   10a0 <x3@plt>
mov    $0x0,%al
call   1090 <callx4@plt>
call   1070 <x5@plt>
mov    $0x0,%al
call   1030 <callx5_again@plt>
mov    $0x0,%al
call   1040 <x6@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
call   1090 <x1@plt>
call   1070 <x2@plt>
call   10b0 <x3@plt>
xor    %eax,%eax
call   10a0 <callx4@plt>
call   1080 <x5@plt>
xor    %eax,%eax
call   1040 <callx5_again@plt>
xor    %eax,%eax
call   1060 <x6@plt>
lea    0xe35(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c" *\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 42)
tail call void asm sideeffect "call x1", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "call x2", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "call x3", "~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 (...) @callx4()
tail call void asm sideeffect "call x5", "~{dirflag},~{fpsr},~{flags}"()
%5 = tail call i32 (...) @callx5_again()
%6 = tail call i32 (...) @x6()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void do_nop(void) {}


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

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

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

LLVM IR (-O2):
define void @do_nop() {
ret void
}
int kbhit() {
  return ((*(volatile unsigned long *)(0xE000C000 + 0x14)) & 0x1) != 0;
}


x86 assembly (clang, -O0):
<kbhit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbhit>:
mov    $0xe000c014,%eax
mov    (%rax),%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @kbhit() {
%1 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%2 = and i64 %1, 1
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @kbhit() {
%1 = load volatile i64, i64* inttoptr (i64 3758145556 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 1
ret i32 %3
}
char *get_file_mode_w(char binary_on) { return binary_on ? "wb" : "w"; }


x86 assembly (clang, -O0):
<get_file_mode_w>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
lea    0xeee(%rip),%rax
lea    0xee4(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_mode_w>:
test   %dil,%dil
lea    0xef9(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
@.str.1 = [2 x i8] c"w\00"
define i8* @get_file_mode_w(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
ret i8* %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
@.str.1 = [2 x i8] c"w\00"
define i8* @get_file_mode_w(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ backing_pixel;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
unsigned long get_XWindowAttributes_backing_pixel(void *_p) {
  return (unsigned long)((XWindowAttributes *)_p)->backing_pixel;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XWindowAttributes_backing_pixel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XWindowAttributes_backing_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  switch (a) {
  case 1:
    printf("a birdir");
    break;
  case 2:
    printf("a ikidir");
    break;
  default:
    printf("a hicbiseydir");
    break;
  }
}


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),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1164 <main+0x44>
jmp    1153 <main+0x33>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1175 <main+0x55>
jmp    1186 <main+0x66>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x72>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x72>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%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>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
lea    0xecc(%rip),%rcx
lea    0xece(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x1,%eax
lea    0xeae(%rip),%rdi
cmovne %rdx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"a birdir\00"
@.str.2 = [9 x i8] c"a ikidir\00"
@.str.3 = [14 x i8] c"a hicbiseydir\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
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %7
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %11
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %7, %5
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"a birdir\00"
@.str.2 = [9 x i8] c"a ikidir\00"
@.str.3 = [14 x i8] c"a hicbiseydir\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 = icmp eq i32 %4, 2
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0)
%7 = icmp eq i32 %4, 1
%8 = select i1 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %6
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
int maxi(int i, int j) { return i; }


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

x86 assembly (clang, -O2):
<maxi>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @maxi(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_container_to_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(8, a, b, c, 0);
  return fail;
}


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

LLVM IR (-O0):
define i32 @copy_container_to_start_solutions() {
%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 8, 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_container_to_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 8, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int main() {
  int arr[] = {1, 2, 3, 4, 5, 6};
  arr[2] = 0;
  arr[6] = 10;
  arr[-1] = 10;
  for (int i = 0; i < 10; ++i) {
    arr[i] = 5;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0x24(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    116c <main+0x6c>
movslq -0x24(%rbp),%rax
movl   $0x5,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1148 <main+0x48>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 2
store i32 0, i32* %5
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 6
store i32 10, i32* %6
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 -1
store i32 10, i32* %7
store i32 0, i32* %3
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %13
store i32 5, i32* %14
br label %15
15: ; preds = %11
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo76() {}


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

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

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

LLVM IR (-O2):
define void @foo76() {
ret void
}
int main(int x1) {
  int p;
  int y1, z1;
  int x2, y2, z2;
  {
    if (p)
      y1 = 1;
    else
      y1 = 256;
  };
  z1 = x1 | y1;
  {
    if (p)
      x2 = 0;
    else
      x2 = 15;
  };
  {
    if (p)
      y2 = -1048576;
    else
      y2 = 1048560;
  };
  z2 = x2 | y2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1124 <main+0x24>
movl   $0x1,-0x10(%rbp)
jmp    112b <main+0x2b>
movl   $0x100,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <main+0x4a>
movl   $0x0,-0x18(%rbp)
jmp    1151 <main+0x51>
movl   $0xf,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1167 <main+0x67>
movl   $0xfff00000,-0x1c(%rbp)
jmp    116e <main+0x6e>
movl   $0xffff0,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %5
br label %14
13: ; preds = %1
store i32 256, i32* %5
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = or i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 0, i32* %7
br label %22
21: ; preds = %14
store i32 15, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 -1048576, i32* %8
br label %27
26: ; preds = %22
store i32 1048560, i32* %8
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = or i32 %28, %29
store i32 %30, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
ret i32 0
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SetPageChecked(struct page *);
void set_cold_data(struct page *page) { SetPageChecked(page); }


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

x86 assembly (clang, -O2):
<set_cold_data>:
jmp    1030 <SetPageChecked@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @set_cold_data(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i32 @SetPageChecked(%struct.page* %3)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @set_cold_data(%struct.page* %0) {
%2 = tail call i32 @SetPageChecked(%struct.page* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_nop();
void nop() { __builtin_arm_nop(); }


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

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

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

LLVM IR (-O2):
define void @nop() {
%1 = tail call i32 (...) @__builtin_arm_nop()
ret void
}
/* Type definitions */
struct MIDIKeyboard {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct MIDIKeyboard *);
void MIDIKeyboardRelease(struct MIDIKeyboard *keyboard) { free(keyboard); }


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

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

LLVM IR (-O0):
%struct.MIDIKeyboard = type { i32 }
define void @MIDIKeyboardRelease(%struct.MIDIKeyboard* %0) {
%2 = alloca %struct.MIDIKeyboard*
store %struct.MIDIKeyboard* %0, %struct.MIDIKeyboard** %2
%3 = load %struct.MIDIKeyboard*, %struct.MIDIKeyboard** %2
%4 = call i32 @free(%struct.MIDIKeyboard* %3)
ret void
}

LLVM IR (-O2):
%struct.MIDIKeyboard = type { i32 }
define void @MIDIKeyboardRelease(%struct.MIDIKeyboard* nocapture %0) {
%2 = tail call i32 @free(%struct.MIDIKeyboard* %0)
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_h8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h8_12_sse4() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ dump_serial_regs(int);
int rpi_gpio_header_type(int);
int rpi_version();
int main(int argc, char **argv) {
  int version, header_type;
  version = rpi_version();
  header_type = rpi_gpio_header_type(version);
  dump_serial_regs(header_type);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rpi_version@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <rpi_gpio_header_type@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <dump_serial_regs@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rpi_version@plt>
mov    %eax,%edi
call   1050 <rpi_gpio_header_type@plt>
mov    %eax,%edi
call   1030 <dump_serial_regs@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rpi_version()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @rpi_gpio_header_type(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @dump_serial_regs(i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rpi_version()
%4 = tail call i32 @rpi_gpio_header_type(i32 %3)
%5 = tail call i32 @dump_serial_regs(i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
void UCRCClear(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<UCRCClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UCRCClear>:
orq    $0x1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @UCRCClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UCRCClear(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int set_nonblock(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFL);
  if (flags == -1)
    return -1;
  return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1147 <set_nonblock+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <set_nonblock+0x59>
mov    -0x8(%rbp),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e8b(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1146 <set_nonblock+0x36>
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb0(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %18
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* @F_SETFL
%14 = load i32, i32* %4
%15 = load i32, i32* @O_NONBLOCK
%16 = or i32 %14, %15
%17 = call i32 (i32, i32, ...) @fcntl(i32 %12, i32 %13, i32 %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
void put4b(unsigned int i, unsigned char *p) {
  p[0] = i & 0xff;
  p[1] = (i >> 8) & 0xff;
  p[2] = (i >> 16) & 0xff;
  p[3] = (i >> 24) & 0xff;
  return;
}


x86 assembly (clang, -O0):
<put4b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put4b>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @put4b(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %3
%17 = lshr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %3
%23 = lshr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @put4b(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *__original_fopen64(char const *, char const *);
FILE *fopen64(const char *path, const char *mode) {
  FILE *ret = 0;
  ret = __original_fopen64(path, mode);
  return ret;
}


x86 assembly (clang, -O0):
<fopen64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__original_fopen64@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen64>:
jmp    1030 <__original_fopen64@plt>

LLVM IR (-O0):
define i32* @fopen64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32* null, i32** %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @__original_fopen64(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
ret i32* %9
}

LLVM IR (-O2):
define i32* @fopen64(i8* %0, i8* %1) {
%3 = tail call i32* @__original_fopen64(i8* %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int temp;
  printf("Enter temperature in Celsius:\n");
  scanf("%d", &temp);
  double newtemp = ((temp * 9) / 5) + 32;
  printf("Temperature in Fahrenheit is: %lf \n", newtemp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x9,-0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
lea    (%rax,%rax,8),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x21,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x20,%eax
cvtsi2sd %eax,%xmm0
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Enter temperature in Celsius:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Temperature in Fahrenheit is: %lf \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 9
%8 = sdiv i32 %7, 5
%9 = add nsw i32 %8, 32
%10 = sitofp i32 %9 to double
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Temperature in Fahrenheit is: %lf \0A\00"
@str = [30 x i8] c"Enter temperature in Celsius:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 9
%7 = sdiv i32 %6, 5
%8 = add nsw i32 %7, 32
%9 = sitofp i32 %8 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free_potential_structs();
int /*<<< orphan*/ init_potential_structs();
void reset_potential_structs() {
  free_potential_structs();
  init_potential_structs();
}


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

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

LLVM IR (-O0):
define void @reset_potential_structs() {
%1 = call i32 (...) @free_potential_structs()
%2 = call i32 (...) @init_potential_structs()
ret void
}

LLVM IR (-O2):
define void @reset_potential_structs() {
%1 = tail call i32 (...) @free_potential_structs()
%2 = tail call i32 (...) @init_potential_structs()
ret void
}
void X509_find_by_issuer_and_serial(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_find_by_issuer_and_serial() {
ret void
}
unsigned int bcd2i(int bcd) { return ((bcd >> 4) * 10 + (bcd & 0x0f)); }


x86 assembly (clang, -O0):
<bcd2i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2i>:
mov    %edi,%eax
sar    $0x4,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @bcd2i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = mul nsw i32 %4, 10
%6 = load i32, i32* %2
%7 = and i32 %6, 15
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bcd2i(i32 %0) {
%2 = ashr i32 %0, 4
%3 = mul nsw i32 %2, 10
%4 = and i32 %0, 15
%5 = add nsw i32 %3, %4
ret i32 %5
}
memory_explorer(int *p) {
  int *q = p;
  while (*p--)
    ;
  while (*q++)
    ;
  return q - p - 3;
}


x86 assembly (clang, -O0):
<memory_explorer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
je     112d <memory_explorer+0x2d>
jmp    1110 <memory_explorer+0x10>
jmp    1132 <memory_explorer+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
cmpl   $0x0,(%rax)
je     114f <memory_explorer+0x4f>
jmp    1132 <memory_explorer+0x32>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
sub    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_explorer>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpl   $0x0,(%rdi,%rax,1)
lea    -0x4(%rax),%rax
jne    1110 <memory_explorer+0x10>
neg    %rax
nopl   (%rax)
add    $0x4,%rax
cmpl   $0x0,(%rdi)
lea    0x4(%rdi),%rdi
jne    1120 <memory_explorer+0x20>
shr    $0x2,%rax
add    $0xfffffffd,%eax
ret

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

LLVM IR (-O2):
define i32 @memory_explorer(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2, %7
%8 = phi i32* [ %9, %7 ], [ %0, %2 ]
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7
%13 = ptrtoint i32* %9 to i64
%14 = ptrtoint i32* %4 to i64
%15 = sub i64 %13, %14
%16 = lshr exact i64 %15, 2
%17 = trunc i64 %16 to i32
%18 = add i32 %17, -3
ret i32 %18
}
int onetwothree() { return 123; }


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

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

LLVM IR (-O0):
define i32 @onetwothree() {
ret i32 123
}

LLVM IR (-O2):
define i32 @onetwothree() {
ret i32 123
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("Inside func.\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Inside func.\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}