xunge/DecIR huggingface dataset:
void freeMat(const int row, int **matrix) {
  assert(row >= 0);
  for (int i = 0; i < row; i++) {
    free(matrix[i]);
  }
  free(matrix);
}


x86 assembly (clang, -O0):
<freeMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1174 <freeMat+0x54>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <freeMat+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMat>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
not    %edi
shr    $0x1f,%edi
xor    %eax,%eax
call   1040 <assert@plt>
test   %ebp,%ebp
jle    1152 <freeMat+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <freeMat+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeMat(i32 %0, i32** nocapture %1) {
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %4)
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = zext i32 %0 to i64
br label %11
9: ; preds = %11, %2
%10 = bitcast i32** %1 to i8*
tail call void @free(i8* %10)
ret void
11: ; preds = %7, %11
%12 = phi i64 [ 0, %7 ], [ %16, %11 ]
%13 = getelementptr inbounds i32*, i32** %1, i64 %12
%14 = bitcast i32** %13 to i8**
%15 = load i8*, i8** %14
tail call void @free(i8* %15)
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, %8
br i1 %17, label %9, label %11
}
/* Variables and functions */
int Fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 40; i++)
    printf("%d\t", Fib(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x28,-0x8(%rbp)
jge    1164 <main+0x44>
mov    -0x8(%rbp),%edi
call   1040 <Fib@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1040 <Fib@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x28,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @Fib(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 40
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
char divpp(char x, char y) { return (x % y) ? (x / y + 1) : (x / y); }


x86 assembly (clang, -O0):
<divpp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113a <divpp+0x3a>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <divpp+0x48>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divpp>:
mov    %edi,%eax
cwtd
idiv   %si
cmp    $0x1,%dx
sbb    $0xff,%al
ret

LLVM IR (-O0):
define signext i8 @divpp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = srem i32 %6, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = sdiv i32 %13, %15
%17 = add nsw i32 %16, 1
br label %24
18: ; preds = %2
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = sdiv i32 %20, %22
br label %24
24: ; preds = %18, %11
%25 = phi i32 [ %17, %11 ], [ %23, %18 ]
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @divpp(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = srem i16 %3, %4
%6 = icmp ne i16 %5, 0
%7 = sdiv i16 %3, %4
%8 = trunc i16 %7 to i8
%9 = zext i1 %6 to i8
%10 = add i8 %8, %9
ret i8 %10
}
int test1(int a) { return ~(unsigned int)a; }


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

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

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

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
void gtk_list_store_insert() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_insert() {
ret void
}
unsigned pt_flags_to_bin_noC(const unsigned flags) {
  return ((flags >> 4 & 3u) * 3 + (flags >> 2 & 3u)) * 3 + (flags & 3u);
}


x86 assembly (clang, -O0):
<pt_flags_to_bin_noC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    $0x3,%eax
imul   $0x3,%eax,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x3,%ecx
add    %ecx,%eax
imul   $0x3,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_flags_to_bin_noC>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0x3,%eax
lea    (%rax,%rax,2),%eax
mov    %edi,%ecx
shr    $0x2,%ecx
and    $0x3,%ecx
add    %eax,%ecx
lea    (%rcx,%rcx,2),%eax
and    $0x3,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @pt_flags_to_bin_noC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = and i32 %4, 3
%6 = mul i32 %5, 3
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = and i32 %8, 3
%10 = add i32 %6, %9
%11 = mul i32 %10, 3
%12 = load i32, i32* %2
%13 = and i32 %12, 3
%14 = add i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @pt_flags_to_bin_noC(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 3
%4 = mul nuw nsw i32 %3, 3
%5 = lshr i32 %0, 2
%6 = and i32 %5, 3
%7 = add nuw nsw i32 %4, %6
%8 = mul nuw nsw i32 %7, 3
%9 = and i32 %0, 3
%10 = add nuw nsw i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo1(int);
void bar1(int y) { foo1(y); }


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

x86 assembly (clang, -O2):
<bar1>:
jmp    1030 <foo1@plt>

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

LLVM IR (-O2):
define void @bar1(i32 %0) {
%2 = tail call i32 @foo1(i32 %0)
ret void
}
void pad(s, n) char *s;
int n;
{
  int i;
  i = strlen(s);
  while (i++ < n) {
    addch(' ');
  }
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0xc(%rbp),%eax
jge    1160 <pad+0x40>
mov    $0x20,%edi
mov    $0x0,%al
call   1040 <addch@plt>
jmp    113b <pad+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %rbx
mov    %esi,%ebx
call   1030 <strlen@plt>
cmp    %ebx,%eax
jge    1141 <pad+0x21>
sub    %eax,%ebx
xchg   %ax,%ax
mov    $0x20,%edi
xor    %eax,%eax
call   1040 <addch@plt>
add    $0xffffffff,%ebx
jne    1130 <pad+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @pad(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
br label %9
9: ; preds = %14, %2
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %10, %12
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 (i32, ...) bitcast (i32 (...)* @addch to i32 (i32, ...)*)(i32 32)
br label %9
16: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @pad(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = phi i32 [ %8, %6 ], [ %4, %2 ]
%8 = add i32 %7, 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @addch to i32 (i32, ...)*)(i32 32)
%10 = icmp eq i32 %8, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  x = __VERIFIER_nondet_int();
  while (x > 0) {
    x = -2 * x + 10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1145 <main+0x35>
imul   $0xfffffffe,-0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %2
%9 = mul nsw i32 -2, %8
%10 = add nsw i32 %9, 10
store i32 %10, i32* %2
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(unsigned char, int);
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int usb_raw_configure(int fd) { return ioctl(fd, _IO('U', 9), 0); }


x86 assembly (clang, -O0):
<usb_raw_configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x55,%edi
mov    $0x9,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_raw_configure>:
push   %rbx
mov    %edi,%ebx
mov    $0x55,%edi
mov    $0x9,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @usb_raw_configure(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 zeroext 85, i32 9)
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @usb_raw_configure(i32 %0) {
%2 = tail call i32 @_IO(i8 zeroext 85, i32 9)
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
void do_fwait(void) { asm volatile("fwait"); }


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

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

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

LLVM IR (-O2):
define void @do_fwait() {
tail call void asm sideeffect "fwait", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int system(char *);
int launch_displaz(const char *fileName, const char *options) {
  if (!options)
    options = "-add";
  char cmd[1024];
  snprintf(cmd, 1024, "displaz -script %s %s", options, fileName);
  cmd[1023] = '\0';
  return system(cmd);
}


x86 assembly (clang, -O0):
<launch_displaz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <launch_displaz+0x29>
lea    0xebb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x400,%esi
lea    0xea1(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<launch_displaz>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%r8
test   %rsi,%rsi
lea    0xecb(%rip),%rcx
cmovne %rsi,%rcx
lea    0xec5(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
movb   $0x0,0x3ff(%rsp)
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"-add\00"
@.str.1 = [22 x i8] c"displaz -script %s %s\00"
define i32 @launch_displaz(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %4
br label %9
9: ; preds = %8, %2
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = call i32 @snprintf(i8* %10, i32 1024, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 1023
store i8 0, i8* %14
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%16 = call i32 @system(i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"-add\00"
@.str.1 = [22 x i8] c"displaz -script %s %s\00"
define i32 @launch_displaz(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 1024, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %0)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1023
store i8 0, i8* %8
%9 = call i32 @system(i8* %6)
ret i32 %9
}
/* Variables and functions */
int getStringLength(char *);
char *get_stringLength() {
  int value = getStringLength("1234567890");
  do {
    if (!(value == 10))
      return "Get length of a string";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<get_stringLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getStringLength@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
je     1141 <get_stringLength+0x31>
lea    0xed3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <get_stringLength+0x3e>
jmp    1146 <get_stringLength+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stringLength>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getStringLength@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
lea    0xee2(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [23 x i8] c"Get length of a string\00"
define i8* @get_stringLength() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @getStringLength(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 10
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"1234567890\00"
@.str.1 = [23 x i8] c"Get length of a string\00"
define i8* @get_stringLength() {
%1 = tail call i32 @getStringLength(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 10
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ swapBytes(char *, int);
void swapNBytes(char *p, int size, int count) {
  int cnt;
  for (cnt = 0; cnt < count; cnt++) {
    swapBytes(p + cnt * size, size);
  }
}


x86 assembly (clang, -O0):
<swapNBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115b <swapNBytes+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0xc(%rbp),%esi
call   1030 <swapBytes@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <swapNBytes+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapNBytes>:
push   %r15
push   %r14
push   %rbx
test   %edx,%edx
jle    1144 <swapNBytes+0x34>
mov    %rdi,%rbx
movslq %esi,%r14
mov    %edx,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <swapBytes@plt>
add    %r14,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <swapNBytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @swapNBytes(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = mul nsw i64 %9, %6
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = tail call i32 @swapBytes(i8* %11, i32 %1)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned long);
void srandom(unsigned long input) { srand(input); }


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

x86 assembly (clang, -O2):
<srandom>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @srandom(i64 %0) {
%2 = tail call i32 @srand(i64 %0)
ret void
}
int is_deflated_callback(const void *pBuf, int len, void *pUser) {
  int *decomp_size = pUser;
  *decomp_size += len;
  if (len > 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_deflated_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
cmpl   $0x0,-0x14(%rbp)
jle    1138 <is_deflated_callback+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <is_deflated_callback+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_deflated_callback>:
add    %esi,(%rdx)
xor    %eax,%eax
test   %esi,%esi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @is_deflated_callback(i8* nocapture readnone %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %1
store i32 %6, i32* %4
%7 = icmp sgt i32 %1, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *__builtin___bnd_null_ptr_bounds(void *);
void *chkp_test(void *p) { return __builtin___bnd_null_ptr_bounds(p); }


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

x86 assembly (clang, -O2):
<chkp_test>:
jmp    1030 <__builtin___bnd_null_ptr_bounds@plt>

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

LLVM IR (-O2):
define i8* @chkp_test(i8* %0) {
%2 = tail call i8* @__builtin___bnd_null_ptr_bounds(i8* %0)
ret i8* %2
}
void do_fldl2e(void *p) {
  asm __volatile__("fninit");
  asm __volatile__("fldl2e");
  asm __volatile__("fstpl (%0)" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<do_fldl2e>:
fninit
fldl2e
fstpl  (%rdi)
ret

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

LLVM IR (-O2):
define void @do_fldl2e(i8* %0) {
tail call void asm sideeffect "fninit", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fldl2e", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fstpl ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int num1, num2;
  int n;
  for (n; n <= 10; n++) {
    if (n <= 0) {
      scanf("%d%d", &num1, &num2);
      printf("%d", num1 + num2);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x10(%rbp)
jg     117c <main+0x5c>
cmpl   $0x0,-0x10(%rbp)
jg     1169 <main+0x49>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x4e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void snck_passwd_cleanup(struct snck_ctxt const *const p_ctxt) {
  (void)(p_ctxt);
}


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

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

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

LLVM IR (-O2):
%struct.snck_ctxt = type opaque
define void @snck_passwd_cleanup(%struct.snck_ctxt* nocapture %0) {
ret void
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t _get_tss(void) {
  uint16_t sel;
  __asm__ __volatile__("str %0" : "=r"(sel));
  return sel;
}


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

x86 assembly (clang, -O2):
<_get_tss>:
str    %rax
ret

LLVM IR (-O0):
define i8* @_get_tss() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "str $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @_get_tss() {
%1 = tail call i8* asm sideeffect "str $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
void TerminateTask(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @TerminateTask() {
ret void
}
void machine_debug() {}


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

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

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

LLVM IR (-O2):
define void @machine_debug() {
ret void
}
/* Variables and functions */
int *malloc(int);
void f1() {
  int *p = malloc(12);
  return;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    $0xc,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call i32* @malloc(i32 12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile __uint32_t;

/* Variables and functions */
__uint32_t _read_raw(__uint32_t *ptr) { return *((volatile __uint32_t *)ptr); }


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

x86 assembly (clang, -O2):
<_read_raw>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @_read_raw(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
int binaryEqual(a, b, len)
register char *a, *b;
register unsigned len;
{
  while (len--)
    if (*a++ != *b++)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<binaryEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1160 <binaryEqual+0x60>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115b <binaryEqual+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1167 <binaryEqual+0x67>
jmp    110f <binaryEqual+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binaryEqual>:
mov    %edx,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %ecx,%r8d
je     1128 <binaryEqual+0x28>
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <binaryEqual+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @binaryEqual(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ messErr(int);
int /*<<< orphan*/ rotateBid(long, int /*<<< orphan*/);
void IF_rot(void) {
  if (!rotateBid(3L, 0))
    messErr(4);
}


x86 assembly (clang, -O0):
<IF_rot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <rotateBid@plt>
cmp    $0x0,%eax
jne    1143 <IF_rot+0x23>
mov    $0x4,%edi
call   1030 <messErr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_rot>:
push   %rax
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <rotateBid@plt>
test   %eax,%eax
je     1133 <IF_rot+0x13>
pop    %rax
ret
mov    $0x4,%edi
pop    %rax
jmp    1030 <messErr@plt>

LLVM IR (-O0):
define void @IF_rot() {
%1 = call i32 @rotateBid(i64 3, i32 0)
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 @messErr(i32 4)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @IF_rot() {
%1 = tail call i32 @rotateBid(i64 3, i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @messErr(i32 4)
br label %5
5: ; preds = %3, %0
ret void
}
void *__attribute__((no)) dummy(void *x) { return x; }


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

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

LLVM IR (-O0):
define i8* @dummy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @dummy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, void const *, int);
int xwrite(int fd, const void *from, int len) {
  int ret;
  do {
    ret = write(fd, from, len);
  } while (ret < 0 && errno == EINTR);
  return ret;
}


x86 assembly (clang, -O0):
<xwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jge    115d <xwrite+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <xwrite+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwrite>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    114a <xwrite+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <xwrite+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @xwrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @xwrite(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int close(int);
int closesocket(int handle) { return close(handle); }


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

x86 assembly (clang, -O2):
<closesocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closesocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
__attribute((always_)) f(int x) {
  int counts[] = {x - 1, x, x + 1};
  int t = 0;
  for (int i = 0; i < sizeof(counts) / sizeof(counts[0]); i++)
    t += counts[i];
  return t;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x3,%rax
jae    1157 <f+0x57>
movslq -0x18(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112d <f+0x2d>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = mul i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
void str_clearcopy(char *dest, const char *src, size_t len) {
  memset(dest, '\0', len);
  memcpy(dest, src, len - 1);
}


x86 assembly (clang, -O0):
<str_clearcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_clearcopy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %esi,%esi
call   1030 <memset@plt>
add    $0xffffffffffffffff,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @str_clearcopy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %6
%9 = call i32 @memset(i8* %7, i8 signext 0, i64 %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i64 %13)
ret void
}

LLVM IR (-O2):
define void @str_clearcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext 0, i64 %2)
%5 = add i64 %2, -1
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %5)
ret void
}
int hashFunction_1(char a[20]) { return (int)a[0]; }


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

x86 assembly (clang, -O2):
<hashFunction_1>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hashFunction_1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @hashFunction_1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
void MapsWithMe_TransformName(char *s) {
  for (; *s != 0; ++s) {
    if (*s == ' ')
      *s = '_';
    else if (*s == '_')
      *s = ' ';
  }
}


x86 assembly (clang, -O0):
<MapsWithMe_TransformName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <MapsWithMe_TransformName+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1134 <MapsWithMe_TransformName+0x34>
mov    -0x8(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1150 <MapsWithMe_TransformName+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
jne    114b <MapsWithMe_TransformName+0x4b>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
jmp    1150 <MapsWithMe_TransformName+0x50>
jmp    1155 <MapsWithMe_TransformName+0x55>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <MapsWithMe_TransformName+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MapsWithMe_TransformName>:
jmp    1118 <MapsWithMe_TransformName+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%al
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x20,%al
je     1130 <MapsWithMe_TransformName+0x30>
cmp    $0x5f,%al
je     1110 <MapsWithMe_TransformName+0x10>
test   %al,%al
jne    1114 <MapsWithMe_TransformName+0x14>
jmp    1134 <MapsWithMe_TransformName+0x34>
nopl   0x0(%rax)
mov    $0x5f,%al
jmp    1112 <MapsWithMe_TransformName+0x12>
ret

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

LLVM IR (-O2):
define void @MapsWithMe_TransformName(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %10
i8 32, label %6
i8 95, label %5
]
5: ; preds = %2
br label %6
6: ; preds = %2, %5
%7 = phi i8 [ 32, %5 ], [ 95, %2 ]
store i8 %7, i8* %3
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fclose(int /*<<< orphan*/ *);
int CPCloseFile(FILE *fileRef) {
  if (fclose(fileRef))
    return 10001;
  return 0;
}


x86 assembly (clang, -O0):
<CPCloseFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     113b <CPCloseFile+0x2b>
movl   $0x2711,-0x4(%rbp)
jmp    1142 <CPCloseFile+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPCloseFile>:
push   %rax
call   1030 <fclose@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0x2711,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CPCloseFile(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i64 @fclose(i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 10001, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @CPCloseFile(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 10001
ret i32 %4
}
double opr_c(struct lifo *stack) { return 299792458; }


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

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

LLVM IR (-O0):
%struct.lifo = type opaque
define double @opr_c(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
ret double 0x41B1DE784A000000
}

LLVM IR (-O2):
%struct.lifo = type opaque
define double @opr_c(%struct.lifo* nocapture readnone %0) {
ret double 0x41B1DE784A000000
}
/* Variables and functions */
int /*<<< orphan*/ eat();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rave();
int /*<<< orphan*/ usleep(int);
int main(void) {
  puts("https://www.youtube.com/watch?v=VYwMmDkRCEo");
  while (1) {
    eat();
    printf("SLEEP ");
    usleep(10000);
    rave();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1030 <eat@plt>
lea    0xeb3(%rip),%rdi
call   1050 <printf@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
mov    $0x0,%al
call   1060 <rave@plt>
jmp    116b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
lea    0xec8(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <eat@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
xor    %eax,%eax
call   1060 <rave@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
@.str = [44 x i8] c"https://www.youtube.com/watch?v=VYwMmDkRCEo\00"
@.str.1 = [7 x i8] c"SLEEP \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @eat()
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @usleep(i32 10000)
%7 = call i32 (...) @rave()
br label %3
}

LLVM IR (-O2):
@.str = [44 x i8] c"https://www.youtube.com/watch?v=VYwMmDkRCEo\00"
@.str.1 = [7 x i8] c"SLEEP \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @eat()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @usleep(i32 10000)
%6 = tail call i32 (...) @rave()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage_error() {
  printf("usage is the same as perfect (which see)\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"usage is the same as perfect (which see)\0A\00"
define void @usage_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [41 x i8] c"usage is the same as perfect (which see)\00"
define void @usage_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}