xunge/DecIR huggingface dataset:
int scan_buffer(char *buf, char tgt) {
  char newval = 'c';
  while (*buf) {
    if (*buf == newval)
      return 1;
    buf++;
  }
  if (*buf == tgt)
    buf++;
  return *buf;
}


x86 assembly (clang, -O0):
<scan_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movb   $0x63,-0x12(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <scan_buffer+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <scan_buffer+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1178 <scan_buffer+0x78>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1112 <scan_buffer+0x12>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    116e <scan_buffer+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_buffer>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <scan_buffer+0x11>
cmp    $0x63,%al
je     111d <scan_buffer+0x1d>
add    $0x1,%rdi
jmp    1100 <scan_buffer>
cmp    $0x1,%sil
adc    $0x0,%rdi
movsbl (%rdi),%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @scan_buffer(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8* [ %0, %2 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 99, label %14
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
%9 = icmp eq i8 %1, 0
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %4, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
br label %14
14: ; preds = %3, %8
%15 = phi i32 [ %13, %8 ], [ 1, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int waitpid(int, int *, int /*<<< orphan*/);
int wait_nohang(int *wstat) { return waitpid(-1, wstat, WNOHANG); }


x86 assembly (clang, -O0):
<wait_nohang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_nohang>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
jmp    1030 <waitpid@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
define i32 @wait_nohang(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define i32 @wait_nohang(i32* %0) {
%2 = load i32, i32* @WNOHANG
%3 = tail call i32 @waitpid(i32 -1, i32* %0, i32 %2)
ret i32 %3
}
int filterResponse(int responscode) {
  if ((responscode == 200) || (responscode == 203)) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<filterResponse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
je     1121 <filterResponse+0x21>
cmpl   $0xcb,-0x8(%rbp)
jne    112d <filterResponse+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1134 <filterResponse+0x34>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterResponse>:
cmp    $0xcb,%edi
setne  %al
cmp    $0xc8,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @filterResponse(i32 %0) {
%2 = icmp ne i32 %0, 203
%3 = icmp ne i32 %0, 200
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
intptr_t ptoi(void *p) { return (intptr_t)p; }


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

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

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

LLVM IR (-O2):
define i64 @ptoi(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
int c027(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c027() {
ret i32 0
}
int SCOTCH_memCur() { return ((int)-1); }


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

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

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

LLVM IR (-O2):
define i32 @SCOTCH_memCur() {
ret i32 -1
}
void test_four(int x, int y) {
#pragma omp distribute simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int, int);
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int fork() {
  int child;
  child = syscall(7, 0, 0, 0);
  if (child) {
    printf("parent %d return form fork, child=%d\n", getpid(), child);
  } else {
    printf("child %d return from fork, child=%d\n", getpid(), child);
  }
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1172 <fork+0x42>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
jmp    118a <fork+0x5a>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
push   %rbx
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <syscall@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
test   %ebx,%ebx
je     115b <fork+0x2b>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
jmp    1166 <fork+0x36>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"parent %d return form fork, child=%d\0A\00"
@.str.1 = [37 x i8] c"child %d return from fork, child=%d\0A\00"
define i32 @fork() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @syscall(i32 7, i32 0, i32 0, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 (...) @getpid()
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %14
10: ; preds = %0
%11 = call i32 (...) @getpid()
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [38 x i8] c"parent %d return form fork, child=%d\0A\00"
@.str.1 = [37 x i8] c"child %d return from fork, child=%d\0A\00"
define i32 @fork() {
%1 = tail call i32 @syscall(i32 7, i32 0, i32 0, i32 0)
%2 = icmp eq i32 %1, 0
%3 = tail call i32 (...) @getpid()
br i1 %2, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1)
br label %8
6: ; preds = %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 0)
br label %8
8: ; preds = %6, %4
ret i32 undef
}
/* Variables and functions */
char *hdate_string(int, int const, int /*<<< orphan*/, int /*<<< orphan*/);
char *hdate_get_omer_string(int const omer_day) {
  return hdate_string(6, omer_day, 0, 0);
}


x86 assembly (clang, -O0):
<hdate_get_omer_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <hdate_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdate_get_omer_string>:
mov    %edi,%esi
mov    $0x6,%edi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <hdate_string@plt>

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

LLVM IR (-O2):
define i8* @hdate_get_omer_string(i32 %0) {
%2 = tail call i8* @hdate_string(i32 6, i32 %0, i32 0, i32 0)
ret i8* %2
}
/* Variables and functions */
int errno;
int read(int, void *, int);
int os_read_file(int fd, void *buf, int len) {
  int n = read(fd, buf, len);
  if (n < 0)
    return -errno;
  return n;
}


x86 assembly (clang, -O0):
<os_read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1151 <os_read_file+0x41>
xor    %eax,%eax
mov    0x2e99(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <os_read_file+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_read_file>:
push   %rax
call   1030 <read@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_read_file(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
void Init_empty(void) {}


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

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

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

LLVM IR (-O2):
define void @Init_empty() {
ret void
}
int ft_max(char *tab, int length) {
  int i;
  int y;
  y = 0;
  i = 0;
  while (tab[i]) {
    if (tab[i] > y)
      y = tab[i];
    i++;
  }
  return (y);
}


x86 assembly (clang, -O0):
<ft_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <ft_max+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0x14(%rbp),%eax
jle    114f <ft_max+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <ft_max+0x19>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_max>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <ft_max+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %ecx,%eax
cmovl  %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_max+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_max(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = sext i8 %7 to i32
%10 = icmp slt i32 %8, %9
%11 = select i1 %10, i32 %9, i32 %8
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char getPreviousChar(FILE *f) {
  fseek(f, -1, SEEK_CUR);
  return fgetc(f);
}


x86 assembly (clang, -O0):
<getPreviousChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPreviousChar>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define signext i8 @getPreviousChar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_CUR
%5 = call i32 @fseek(i32* %3, i32 -1, i32 %4)
%6 = load i32*, i32** %2
%7 = call signext i8 @fgetc(i32* %6)
ret i8 %7
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define signext i8 @getPreviousChar(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @fseek(i32* %0, i32 -1, i32 %2)
%4 = tail call signext i8 @fgetc(i32* %0)
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char const *);
int /*<<< orphan*/ write(int, char *, int);
void ft_putendl(char const *s) {
  if (s) {
    ft_putstr(s);
    write(1, "\n", 1);
  }
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <ft_putendl+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    $0x1,%edx
lea    0xeb4(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     1142 <ft_putendl+0x22>
push   %rax
call   1040 <ft_putstr@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_putstr(i8* %0)
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int among(char *, int);
int ise(int c) { return among("eE", c); }


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

x86 assembly (clang, -O2):
<ise>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <among@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"eE\00"
define i32 @ise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @among(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"eE\00"
define i32 @ise(i32 %0) {
%2 = tail call i32 @among(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
OP(dd, e0) {
  illegal_1();
  op_e0();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_e0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_e0()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_e0()
ret i32 undef
}
int graphicMode() {
  static int pDummy = 1;
  return pDummy;
}


x86 assembly (clang, -O0):
<graphicMode>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@graphicMode.pDummy = internal global i32 1
define i32 @graphicMode() {
%1 = load i32, i32* @graphicMode.pDummy
ret i32 %1
}

LLVM IR (-O2):
define i32 @graphicMode() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ print_msg(char *);
extern void tswrite_help_testing(void) {
  print_msg(
      "Testing:\n"
      "In order to support some form of automatic 'jitter' in the output,\n"
      "the child process's idea of time can be randomly perturbed:\n"
      "\n"
      "  -perturb <seed> <range> <verbose>\n"
      "\n"
      "<seed> is the initial seed for the random number generator (1 is a\n"
      "traditional default), and <range> is the maximum amount to perturb\n"
      "time by -- this will be used in both the positive and negative\n"
      "directions, and is in milliseconds. <verbose> is either 0 or 1 --\n"
      "if it is 1 then each perturbation time will be reported.\n"
      "It is probably worth selecting a large value for -maxnowait when\n"
      "using -perturb.\n");
}


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

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

LLVM IR (-O0):
@.str = [576 x i8] c"Testing:\0AIn order to support some form of automatic 'jitter' in the output,\0Athe child process's idea of time can be randomly perturbed:\0A\0A -perturb <seed> <range> <verbose>\0A\0A<seed> is the initial seed for the random number generator (1 is a\0Atraditional default), and <range> is the maximum amount to perturb\0Atime by -- this will be used in both the positive and negative\0Adirections, and is in milliseconds. <verbose> is either 0 or 1 --\0Aif it is 1 then each perturbation time will be reported.\0AIt is probably worth selecting a large value for -maxnowait when\0Ausing -perturb.\0A\00"
define void @tswrite_help_testing() {
%1 = call i32 @print_msg(i8* getelementptr inbounds ([576 x i8], [576 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [576 x i8] c"Testing:\0AIn order to support some form of automatic 'jitter' in the output,\0Athe child process's idea of time can be randomly perturbed:\0A\0A -perturb <seed> <range> <verbose>\0A\0A<seed> is the initial seed for the random number generator (1 is a\0Atraditional default), and <range> is the maximum amount to perturb\0Atime by -- this will be used in both the positive and negative\0Adirections, and is in milliseconds. <verbose> is either 0 or 1 --\0Aif it is 1 then each perturbation time will be reported.\0AIt is probably worth selecting a large value for -maxnowait when\0Ausing -perturb.\0A\00"
define void @tswrite_help_testing() {
%1 = tail call i32 @print_msg(i8* getelementptr inbounds ([576 x i8], [576 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test(int, int);
int main(void) {
  test(456, 1234);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1c8,%edi
mov    $0x4d2,%esi
call   1040 <test@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1c8,%edi
mov    $0x4d2,%esi
call   1040 <test@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 456, i32 1234)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 456, i32 1234)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int rok;
  printf("Podaj rok urodzenia: ");
  scanf("%d", &rok);
  printf("Masz %d lat\n", 2017 - rok);
  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)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x7e1,%esi
sub    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x7e1,%esi
sub    0x4(%rsp),%esi
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Podaj rok urodzenia: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Masz %d lat\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = sub nsw i32 2017, %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [22 x i8] c"Podaj rok urodzenia: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Masz %d lat\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = sub nsw i32 2017, %7
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
/* Variables and functions */
float expf(float);
void sExp_process(float bIn, float *bOut) { *bOut = expf(bIn); }


x86 assembly (clang, -O0):
<sExp_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sExp_process>:
push   %rbx
mov    %rdi,%rbx
call   1030 <expf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sExp_process(float %0, float* nocapture writeonly %1) {
%3 = tail call float @expf(float %0)
store float %3, float* %1
ret void
}
float avg(float v[]) {
  float average = 0;
  for (int i = 0; i < 10; ++i) {
    average += v[i];
  }
  average /= 10.f;
  return average;
}


x86 assembly (clang, -O0):
<avg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1146 <avg+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1117 <avg+0x17>
movss  -0xc(%rbp),%xmm0
movss  0xead(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg>:
xorps  %xmm0,%xmm0
addss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
addss  0x8(%rdi),%xmm0
addss  0xc(%rdi),%xmm0
addss  0x10(%rdi),%xmm0
addss  0x14(%rdi),%xmm0
addss  0x18(%rdi),%xmm0
addss  0x1c(%rdi),%xmm0
addss  0x20(%rdi),%xmm0
addss  0x24(%rdi),%xmm0
divss  0xec4(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @avg(float* nocapture %0) {
%2 = load float, float* %0
%3 = fadd float %2, 0.000000e+00
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fadd float %3, %5
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fadd float %6, %8
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = fadd float %9, %11
%13 = getelementptr inbounds float, float* %0, i64 4
%14 = load float, float* %13
%15 = fadd float %12, %14
%16 = getelementptr inbounds float, float* %0, i64 5
%17 = load float, float* %16
%18 = fadd float %15, %17
%19 = getelementptr inbounds float, float* %0, i64 6
%20 = load float, float* %19
%21 = fadd float %18, %20
%22 = getelementptr inbounds float, float* %0, i64 7
%23 = load float, float* %22
%24 = fadd float %21, %23
%25 = getelementptr inbounds float, float* %0, i64 8
%26 = load float, float* %25
%27 = fadd float %24, %26
%28 = getelementptr inbounds float, float* %0, i64 9
%29 = load float, float* %28
%30 = fadd float %27, %29
%31 = fdiv float %30, 1.000000e+01
ret float %31
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, unsigned int *, int);
unsigned int get_random_int(unsigned int min, unsigned int max) {
  int randomData = open("/dev/urandom", O_RDONLY);
  unsigned int rInt;
  read(randomData, &rInt, sizeof rInt);
  rInt = rInt % (max - min) + min;
  close(randomData);
  return rInt;
}


x86 assembly (clang, -O0):
<get_random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_int>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%r14d
lea    0xc(%rsp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    0xc(%rsp),%eax
sub    %ebx,%ebp
xor    %edx,%edx
div    %ebp
add    %edx,%ebx
mov    %r14d,%edi
call   1030 <close@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @get_random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @read(i32 %9, i32* %6, i32 4)
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub i32 %12, %13
%15 = urem i32 %11, %14
%16 = load i32, i32* %3
%17 = add i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = call i32 @close(i32 %18)
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @get_random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = bitcast i32* %3 to i8*
%7 = call i32 @read(i32 %5, i32* %3, i32 4)
%8 = load i32, i32* %3
%9 = sub i32 %1, %0
%10 = urem i32 %8, %9
%11 = add i32 %10, %0
%12 = tail call i32 @close(i32 %5)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ left_motor(int);
int /*<<< orphan*/ right_motor(int);
void move(int speed) {
  left_motor(-speed);
  right_motor(speed);
}


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

x86 assembly (clang, -O2):
<move>:
push   %rbx
mov    %edi,%ebx
neg    %edi
call   1030 <left_motor@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <right_motor@plt>

LLVM IR (-O0):
define void @move(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = call i32 @left_motor(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @right_motor(i32 %6)
ret void
}

LLVM IR (-O2):
define void @move(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call i32 @left_motor(i32 %2)
%4 = tail call i32 @right_motor(i32 %0)
ret void
}
void avcodec_open2() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_open2() {
ret void
}
/* Variables and functions */
int ANALOG_READ(int);
int /*<<< orphan*/ Welcome();
int /*<<< orphan*/ printf(char *, int);
main(int argc, char **argv) {
  int pinIn = 60;
  int pinOut = 44;
  int entrada = 0;
  int analogdev = 0;
  Welcome();
  while (1 == 1) {
    entrada = ANALOG_READ(analogdev);
    printf("El valor del pin es :%d \n", entrada);
  }
}


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)
movl   $0x3c,-0x14(%rbp)
movl   $0x2c,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1050 <Welcome@plt>
mov    -0x20(%rbp),%edi
call   1030 <ANALOG_READ@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
jmp    1169 <main+0x39>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <Welcome@plt>
lea    0xec1(%rip),%rbx
nop
xor    %edi,%edi
call   1030 <ANALOG_READ@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [26 x i8] c"El valor del pin es :%d \0A\00"
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 60, i32* %6
store i32 44, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%10 = call i32 (...) @Welcome()
br label %11
11: ; preds = %2, %11
%12 = load i32, i32* %9
%13 = call i32 @ANALOG_READ(i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"El valor del pin es :%d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Welcome()
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @ANALOG_READ(i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %4
}
int Mod_SurfaceFlags(int oldflags) {
  int flags = 0;
  if (oldflags & 0x4)
    flags |= 0x4 | 0x10 | 0x20 | 0x20000;
  if (oldflags & 0x8)
    flags |= 0x20;
  if ((oldflags & (0x80 | 0x4)) == 0x80)
    flags |= 0x80;
  return flags;
}


x86 assembly (clang, -O0):
<Mod_SurfaceFlags>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1128 <Mod_SurfaceFlags+0x28>
mov    -0x8(%rbp),%eax
or     $0x20034,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1140 <Mod_SurfaceFlags+0x40>
mov    -0x8(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x84,%eax
cmp    $0x80,%eax
jne    115e <Mod_SurfaceFlags+0x5e>
mov    -0x8(%rbp),%eax
or     $0x80,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mod_SurfaceFlags>:
mov    %edi,%eax
shl    $0x1d,%eax
sar    $0x1f,%eax
and    $0x20034,%eax
lea    0x0(,%rdi,4),%ecx
and    $0x20,%ecx
or     %eax,%ecx
and    $0x84,%edi
lea    0x80(%rcx),%eax
cmp    $0x80,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Mod_SurfaceFlags(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 131124
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 8
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %3
%16 = or i32 %15, 32
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
%19 = and i32 %18, 132
%20 = icmp eq i32 %19, 128
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %3
%23 = or i32 %22, 128
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @Mod_SurfaceFlags(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 131124
%5 = shl i32 %0, 2
%6 = and i32 %5, 32
%7 = or i32 %4, %6
%8 = and i32 %0, 132
%9 = icmp eq i32 %8, 128
%10 = or i32 %7, 128
%11 = select i1 %9, i32 %10, i32 %7
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ child_main(int, int, int);
int /*<<< orphan*/ fork();
pid_t child_make(int i, int listenfd, int addrlen) {
  pid_t pid;
  if ((pid = fork()) > 0)
    return pid;
  child_main(i, listenfd, addrlen);
}


x86 assembly (clang, -O0):
<child_make>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    114f <child_make+0x2f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <child_make+0x3d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <child_main@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_make>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ebp
test   %eax,%eax
jg     1149 <child_make+0x29>
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <child_main@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @child_make(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @fork()
%5 = icmp sgt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @child_main(i32 %0, i32 %1, i32 %2)
br label %8
8: ; preds = %3, %6
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_srcptr;
typedef int /*<<< orphan*/ mpfr_ptr;

/* Variables and functions */
int /*<<< orphan*/ MPFR_RNDN;
int mpfr_atan2(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/);
int p1788_fwd_atan2_1(mpfr_ptr rop, mpfr_srcptr op, const void *env) {
  mpfr_srcptr op2 = (mpfr_srcptr)env;
  int t = mpfr_atan2(rop, op, op2, MPFR_RNDN);
  return t;
}


x86 assembly (clang, -O0):
<p1788_fwd_atan2_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
call   1030 <mpfr_atan2@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p1788_fwd_atan2_1>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <mpfr_atan2@plt>

LLVM IR (-O0):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_atan2_1(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i32
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = load i32, i32* @MPFR_RNDN
%15 = call i32 @mpfr_atan2(i32 %11, i32 %12, i32 %13, i32 %14)
store i32 %15, i32* %8
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
@MPFR_RNDN = global i32 0
define i32 @p1788_fwd_atan2_1(i32 %0, i32 %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = load i32, i32* @MPFR_RNDN
%7 = tail call i32 @mpfr_atan2(i32 %0, i32 %1, i32 %5, i32 %6)
ret i32 %7
}
int test_imm_ADint64_lowword_reg(long long val) {
  return ((val) & (0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xad,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ADint64_lowword_reg>:
test   $0xad,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ADint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 173
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_ADint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 173
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double cos(int);
int drand();
int log(int);
double sqrt(int);
double rand_normal(double mean, double var) {
  return sqrt(var) * sqrt(-2 * log(drand())) *
             cos(2 * (3.141592653589793) * drand()) +
         mean;
}


x86 assembly (clang, -O0):
<rand_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <drand@plt>
mov    %eax,%edi
call   1050 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <drand@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe62(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_normal>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
cvttsd2si %xmm1,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <drand@plt>
mov    %eax,%edi
call   1050 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1060 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <drand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe6d(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_normal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = call double @sqrt(i32 %6)
%8 = call i32 (...) @drand()
%9 = call i32 @log(i32 %8)
%10 = mul nsw i32 -2, %9
%11 = call double @sqrt(i32 %10)
%12 = fmul double %7, %11
%13 = call i32 (...) @drand()
%14 = sitofp i32 %13 to double
%15 = fmul double 0x401921FB54442D18, %14
%16 = fptosi double %15 to i32
%17 = call double @cos(i32 %16)
%18 = load double, double* %3
%19 = call double @llvm.fmuladd.f64(double %12, double %17, double %18)
ret double %19
}

LLVM IR (-O2):
define double @rand_normal(double %0, double %1) {
%3 = fptosi double %1 to i32
%4 = tail call double @sqrt(i32 %3)
%5 = tail call i32 (...) @drand()
%6 = tail call i32 @log(i32 %5)
%7 = mul nsw i32 %6, -2
%8 = tail call double @sqrt(i32 %7)
%9 = fmul double %4, %8
%10 = tail call i32 (...) @drand()
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 0x401921FB54442D18
%13 = fptosi double %12 to i32
%14 = tail call double @cos(i32 %13)
%15 = tail call double @llvm.fmuladd.f64(double %9, double %14, double %0)
ret double %15
}
int test_imm_07uint8_reg(unsigned char val) {
  return ((val) & (0x07 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_07uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_07uint8_reg>:
test   $0x7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_07uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 7
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_07uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 7
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}