xunge/DecIR huggingface dataset:
int decrypt(char *flag) {
  for (int i = 0; flag[i]; i++) {
    flag[i] = flag[i] - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<decrypt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114b <decrypt+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x1,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <decrypt+0xf>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt>:
mov    (%rdi),%al
test   %al,%al
je     1120 <decrypt+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
add    $0xff,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <decrypt+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @decrypt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret i32 0
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8 [ %12, %5 ], [ %2, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = add i8 %7, -1
store i8 %9, i8* %8
%10 = add nuw nsw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %4, label %5
}
/* Variables and functions */
char *malloc(size_t);
char *ft_strnew(size_t size) {
  char *tmp;
  int i;
  if (!(tmp = malloc(size + 1)))
    return (NULL);
  i = 0;
  while (i < (int)size + 1)
    *(tmp + i++) = 0;
  return (tmp);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1144 <ft_strnew+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1180 <ft_strnew+0x70>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1178 <ft_strnew+0x68>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    114b <ft_strnew+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1154 <ft_strnew+0x34>
mov    %ebx,%eax
and    $0x80000000,%eax
test   %rax,%rax
jne    1154 <ft_strnew+0x34>
mov    %ebx,%edx
add    $0x1,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp ne i8* %3, null
%5 = and i64 %0, 2147483648
%6 = icmp eq i64 %5, 0
%7 = and i1 %4, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = and i64 %0, 4294967295
%10 = add nuw nsw i64 %9, 1
br label %11
11: ; preds = %8, %1
ret i8* %3
}
/* Variables and functions */
long double expl(int);
int logl(long double);
long double cbrtl(long double num) { return expl(logl(num) / 3); }


x86 assembly (clang, -O0):
<cbrtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
mov    %ecx,%edi
add    %eax,%edi
call   1040 <expl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <logl@plt>
cltq
imul   $0x55555556,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
shr    $0x20,%rdi
add    %eax,%edi
add    $0x18,%rsp
jmp    1040 <expl@plt>

LLVM IR (-O0):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i32 @logl(x86_fp80 %3)
%5 = sdiv i32 %4, 3
%6 = call x86_fp80 @expl(i32 %5)
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @cbrtl(x86_fp80 %0) {
%2 = tail call i32 @logl(x86_fp80 %0)
%3 = sdiv i32 %2, 3
%4 = tail call x86_fp80 @expl(i32 %3)
ret x86_fp80 %4
}
/* Variables and functions */
double my_random_double();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
main(int argc, char *argv[]) {
  int i;
  double x;
  srandom(time(NULL));
  for (i = 0; i < 10000; i++) {
    x = my_random_double();
    printf("%lf\n", x);
  }
}


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)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    11a5 <main+0x65>
mov    $0x0,%al
call   1050 <my_random_double@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x2d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    $0x2710,%ebp
lea    0xea3(%rip),%rbx
nopl   (%rax)
xor    %eax,%eax
call   1050 <my_random_double@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srandom(i32 %3)
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %9, %5 ]
%7 = tail call double (...) @my_random_double()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %7)
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, 10000
br i1 %10, label %11, label %5
11: ; preds = %5
ret i32 0
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EVBUFFER_INPUT(struct bufferevent *);
scalar_t__ pubsubclient_parse_one_message(int /*<<< orphan*/, void *);
void pubsubclient_source_readcb(struct bufferevent *bev, void *arg) {
  while (pubsubclient_parse_one_message(EVBUFFER_INPUT(bev), arg)) {
  }
}


x86 assembly (clang, -O0):
<pubsubclient_source_readcb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <EVBUFFER_INPUT@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <pubsubclient_parse_one_message@plt>
cmp    $0x0,%rax
je     1153 <pubsubclient_source_readcb+0x33>
jmp    1130 <pubsubclient_source_readcb+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pubsubclient_source_readcb>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <EVBUFFER_INPUT@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <pubsubclient_parse_one_message@plt>
test   %rax,%rax
jne    1130 <pubsubclient_source_readcb+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
define void @pubsubclient_source_readcb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %11, %2
%6 = load %struct.bufferevent*, %struct.bufferevent** %3
%7 = call i32 @EVBUFFER_INPUT(%struct.bufferevent* %6)
%8 = load i8*, i8** %4
%9 = call i64 @pubsubclient_parse_one_message(i32 %7, i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %5
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
define void @pubsubclient_source_readcb(%struct.bufferevent* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @EVBUFFER_INPUT(%struct.bufferevent* %0)
%5 = tail call i64 @pubsubclient_parse_one_message(i32 %4, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void create_blank(int blank) {
  while (blank-- > 0) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<create_blank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <create_blank+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <create_blank+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_blank>:
push   %rbx
test   %edi,%edi
jle    1132 <create_blank+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <create_blank+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @create_blank(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i32 32)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write_lcd(int);
void write_nibbles(int bits) {
  write_lcd((bits >> 4) & 0x0F);
  write_lcd(bits & 0x0F);
  usleep(500);
}


x86 assembly (clang, -O0):
<write_nibbles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x4,%edi
and    $0xf,%edi
call   1030 <write_lcd@plt>
mov    -0x4(%rbp),%edi
and    $0xf,%edi
call   1030 <write_lcd@plt>
mov    $0x1f4,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_nibbles>:
push   %rbx
mov    %edi,%ebx
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <write_lcd@plt>
and    $0xf,%ebx
mov    %ebx,%edi
call   1030 <write_lcd@plt>
mov    $0x1f4,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @write_nibbles(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = and i32 %4, 15
%6 = call i32 @write_lcd(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 15
%9 = call i32 @write_lcd(i32 %8)
%10 = call i32 @usleep(i32 500)
ret void
}

LLVM IR (-O2):
define void @write_nibbles(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = tail call i32 @write_lcd(i32 %3)
%5 = and i32 %0, 15
%6 = tail call i32 @write_lcd(i32 %5)
%7 = tail call i32 @usleep(i32 500)
ret void
}
void test_libsym3_3(void) {}


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

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

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

LLVM IR (-O2):
define void @test_libsym3_3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crmode();
int endwin();
int initscr();
int /*<<< orphan*/ noecho();
int start_scene(char, int /*<<< orphan*/);
int main() {
  while (initscr(), crmode(), noecho(), 0) {
  }
  while (start_scene(' ', 0), 0) {
  }
  while (endwin(), 0) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1070 <crmode@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1183 <main+0x33>
jmp    1188 <main+0x38>
jmp    115f <main+0xf>
jmp    118d <main+0x3d>
mov    $0x20,%edi
xor    %esi,%esi
call   1040 <start_scene@plt>
xor    %eax,%eax
test   $0x1,%al
jne    11a8 <main+0x58>
jmp    11ad <main+0x5d>
jmp    118d <main+0x3d>
jmp    11b2 <main+0x62>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %eax,%eax
test   $0x1,%al
jne    11c8 <main+0x78>
jmp    11cd <main+0x7d>
jmp    11b2 <main+0x62>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1070 <crmode@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1040 <start_scene@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @initscr()
%4 = call i32 (...) @crmode()
%5 = call i32 (...) @noecho()
br i1 false, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
br label %8
8: ; preds = %10, %7
%9 = call i32 @start_scene(i8 signext 32, i32 0)
br i1 false, label %10, label %11
10: ; preds = %8
br label %8
11: ; preds = %8
br label %12
12: ; preds = %14, %11
%13 = call i32 (...) @endwin()
br i1 false, label %14, label %15
14: ; preds = %12
br label %12
15: ; preds = %12
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @crmode()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 @start_scene(i8 signext 32, i32 0)
%5 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
scalar_t__ unlink(char const *);
void do_rm(int argc, const char **argv) {
  while (argc-- > 1) {
    if (unlink(argv[1]) < 0)
      perror(argv[1]);
    argv++;
  }
}


x86 assembly (clang, -O0):
<do_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x1,%eax
jle    1178 <do_rm+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jge    1167 <do_rm+0x47>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <do_rm+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rm>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1163 <do_rm+0x43>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
jmp    114c <do_rm+0x2c>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
jbe    1163 <do_rm+0x43>
mov    (%rbx),%rdi
call   1030 <unlink@plt>
test   %rax,%rax
jns    1140 <do_rm+0x20>
mov    (%rbx),%rdi
call   1040 <perror@plt>
jmp    1140 <do_rm+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @do_rm(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %17
4: ; preds = %2, %15
%5 = phi i32 [ %7, %15 ], [ %0, %2 ]
%6 = phi i8** [ %8, %15 ], [ %1, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @unlink(i8* %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %8
%14 = tail call i32 @perror(i8* %13)
br label %15
15: ; preds = %12, %4
%16 = icmp ugt i32 %5, 2
br i1 %16, label %4, label %17
17: ; preds = %15, %2
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_is_stable(int *flag) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(879, flag, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_is_stable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x36f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_is_stable>:
mov    %rdi,%rsi
mov    $0x36f,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @celcon_is_stable(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 879, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double get_time() {
  struct timeval t;
  gettimeofday(&t, 0);
  return (t.tv_sec + t.tv_usec * 1e-6) * 1000.0;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl (%rsp),%xmm1
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
%10 = fmul double %9, 1.000000e+03
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
%11 = fmul double %10, 1.000000e+03
ret double %11
}
int str_index_of_char(char *str, char c) {
  char *pos = str;
  while (*pos != '\0' && *pos != c)
    pos++;
  if (*pos == '\0')
    return -1;
  else
    return pos - str;
}


x86 assembly (clang, -O0):
<str_index_of_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     113e <str_index_of_char+0x3e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    114e <str_index_of_char+0x4e>
jmp    115f <str_index_of_char+0x5f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1116 <str_index_of_char+0x16>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117b <str_index_of_char+0x7b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <str_index_of_char+0x89>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_index_of_char>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%eax
add    $0x1,%ecx
test   %al,%al
je     1123 <str_index_of_char+0x23>
add    $0x1,%rdi
cmp    %sil,%al
jne    1110 <str_index_of_char+0x10>
cmp    $0x1,%al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @str_index_of_char(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
%7 = load i8*, i8** %4
store i8* %7, i8** %6
br label %8
8: ; preds = %22, %2
%9 = load i8*, i8** %6
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %8
%14 = load i8*, i8** %6
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %16, %18
br label %20
20: ; preds = %13, %8
%21 = phi i1 [ false, %8 ], [ %19, %13 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %6
br label %8
25: ; preds = %20
%26 = load i8*, i8** %6
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 -1, i32* %3
br label %38
31: ; preds = %25
%32 = load i8*, i8** %6
%33 = load i8*, i8** %4
%34 = ptrtoint i8* %32 to i64
%35 = ptrtoint i8* %33 to i64
%36 = sub i64 %34, %35
%37 = trunc i64 %36 to i32
store i32 %37, i32* %3
br label %38
38: ; preds = %31, %30
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
define i32 @str_index_of_char(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = ptrtoint i8* %4 to i64
%12 = ptrtoint i8* %0 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
%15 = select i1 %6, i32 -1, i32 %14
ret i32 %15
}
int main(void) {
  int l;
  asm("" : "=r"(l) : "0"(0));
  if (f(l + 0, l + 1, l + 4) != -1)
    abort();
  if (f(l + 4, l + 1, l + 4) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
add    $0x0,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x4,%edx
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0xffffffff,%eax
je     115b <main+0x3b>
call   1030 <abort@plt>
mov    -0x8(%rbp),%edi
add    $0x4,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x4,%edx
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x1,%eax
je     1182 <main+0x62>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
lea    0x1(%rdi),%ebx
lea    0x4(%rdi),%ebp
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0xffffffff,%eax
jne    1156 <main+0x36>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x1,%eax
jne    1156 <main+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 4
%10 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %7, i32 %9)
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %0
unreachable
13: ; preds = %0
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 4
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 4
%20 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, i32, ...)*)(i32 %15, i32 %17, i32 %19)
%21 = icmp ne i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %13
unreachable
23: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = add nsw i32 %1, 1
%3 = add nsw i32 %1, 4
%4 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, i32, ...)*)(i32 %1, i32 %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %7, label %6
6: ; preds = %0
tail call void @abort()
unreachable
7: ; preds = %0
%8 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, i32, ...)*)(i32 %3, i32 %2, i32 %3)
%9 = icmp eq i32 %8, 1
br i1 %9, label %11, label %10
10: ; preds = %7
tail call void @abort()
unreachable
11: ; preds = %7
ret i32 0
}
/* Variables and functions */
int runServer();
int main(int argc, char *argv[]) { return runServer(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <runServer@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @runServer()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @runServer()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Sys_ConsoleInputShutdown();
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ exit(int);
void Sys_Exit(int code) {
  Sys_ConsoleInputShutdown();
  assert(code == 0);
  exit(code);
}


x86 assembly (clang, -O0):
<Sys_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Sys_ConsoleInputShutdown@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Sys_Exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Sys_ConsoleInputShutdown@plt>
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
call   1040 <assert@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @Sys_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Sys_ConsoleInputShutdown()
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
define void @Sys_Exit(i32 %0) {
%2 = tail call i32 (...) @Sys_ConsoleInputShutdown()
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ A(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello world\n");
  A(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <A@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @A(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void print_progress(int processed_files, int total_files) {
  time_t now;
  time(&now);
  fprintf(stderr, "[%.24s] hashdup: %i / %i files processed\n", ctime(&now),
          processed_files, total_files);
}


x86 assembly (clang, -O0):
<print_progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0x10(%rbp),%edi
mov    %rax,%rdx
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_progress>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1030 <ctime@plt>
lea    0xe9e(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1040 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"[%.24s] hashdup: %i / %i files processed\0A\00"
define void @print_progress(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @time(i32* %5)
%7 = load i32, i32* @stderr
%8 = call i8* @ctime(i32* %5)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"[%.24s] hashdup: %i / %i files processed\0A\00"
define void @print_progress(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = load i32, i32* @stderr
%7 = call i8* @ctime(i32* %3)
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %0, i32 %1)
ret void
}
unsigned int eruConfigureETL3(unsigned int exs_a_input,
                              unsigned int exs_b_input, unsigned int exicon) {
  unsigned int exisel = (*((volatile unsigned int *const)(0x40010600 + 0x00)));
  exisel &= !((3 << 12) | (3 << 14));
  exisel |= ((exs_a_input << 12) | (exs_b_input << 14));
  (*((volatile unsigned int *const)(0x40010600 + 0x00))) = exisel;
  (*((volatile unsigned int *const)(0x40010600 + 0x1c))) = exicon;
  return 0;
}


x86 assembly (clang, -O0):
<eruConfigureETL3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x40010600,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xc,%eax
mov    -0x8(%rbp),%ecx
shl    $0xe,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x40010600,%eax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0x4001061c,%eax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eruConfigureETL3>:
mov    0x40010600,%eax
shl    $0xc,%edi
shl    $0xe,%esi
or     %edi,%esi
mov    %esi,0x40010600
mov    %edx,0x4001061c
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @eruConfigureETL3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load volatile i32, i32* inttoptr (i64 1073808896 to i32*)
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = and i32 %9, 0
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = shl i32 %11, 12
%13 = load i32, i32* %5
%14 = shl i32 %13, 14
%15 = or i32 %12, %14
%16 = load i32, i32* %7
%17 = or i32 %16, %15
store i32 %17, i32* %7
%18 = load i32, i32* %7
store volatile i32 %18, i32* inttoptr (i64 1073808896 to i32*)
%19 = load i32, i32* %6
store volatile i32 %19, i32* inttoptr (i64 1073808924 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @eruConfigureETL3(i32 %0, i32 %1, i32 %2) {
%4 = load volatile i32, i32* inttoptr (i64 1073808896 to i32*)
%5 = shl i32 %0, 12
%6 = shl i32 %1, 14
%7 = or i32 %6, %5
store volatile i32 %7, i32* inttoptr (i64 1073808896 to i32*)
store volatile i32 %2, i32* inttoptr (i64 1073808924 to i32*)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error_message();
int /*<<< orphan*/ sprintf(int /*<<< orphan*/, char *);
int prefix_update(const char *ifname, int ifindex, const char *prefixPlain,
                  int prefixLength, unsigned long prefered,
                  unsigned long valid) {
  sprintf(error_message(),
          "Prefix configuration on BSD systems not implemented yet.");
  return -12;
}


x86 assembly (clang, -O0):
<prefix_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x0,%al
call   1030 <error_message@plt>
mov    %eax,%edi
lea    0xeb2(%rip),%rsi
call   1040 <sprintf@plt>
mov    $0xfffffff4,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_update>:
push   %rax
xor    %eax,%eax
call   1030 <error_message@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1040 <sprintf@plt>
mov    $0xfffffff4,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Prefix configuration on BSD systems not implemented yet.\00"
define i32 @prefix_update(i8* %0, i32 %1, i8* %2, i32 %3, i64 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = call i32 (...) @error_message()
%14 = call i32 @sprintf(i32 %13, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -12
}

LLVM IR (-O2):
@.str = [57 x i8] c"Prefix configuration on BSD systems not implemented yet.\00"
define i32 @prefix_update(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i64 %4, i64 %5) {
%7 = tail call i32 (...) @error_message()
%8 = tail call i32 @sprintf(i32 %7, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 -12
}
unsigned short timerRead() { return (*(unsigned int *)0x4000C008); }


x86 assembly (clang, -O0):
<timerRead>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000c008,%eax
mov    (%rax),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerRead>:
movzwl 0x4000c008,%eax
40
ret

LLVM IR (-O0):
define zeroext i16 @timerRead() {
%1 = load i32, i32* inttoptr (i64 1073790984 to i32*)
%2 = trunc i32 %1 to i16
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @timerRead() {
%1 = load i32, i32* inttoptr (i64 1073790984 to i32*)
%2 = trunc i32 %1 to i16
ret i16 %2
}
void next3() {
  asm("#"
      "3");
}


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

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

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

LLVM IR (-O2):
define void @next3() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int check_enable(char *password) { return !strcasecmp(password, "topsecret"); }


x86 assembly (clang, -O0):
<check_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_enable>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"topsecret\00"
define i32 @check_enable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"topsecret\00"
define i32 @check_enable(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int syscall(int, int, int, int);
int uv__dup3(int oldfd, int newfd, int flags) {
  return syscall(292, oldfd, newfd, flags);
}


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

x86 assembly (clang, -O2):
<uv__dup3>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x124,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @uv__dup3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 292, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @uv__dup3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 292, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int studCount = 0;
  printf("This is a new line from checkout 2");
  for (studCount; studCount < 3; studCount++) {
  }
  printf("This is a new line from checkout 1");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
jge    114f <main+0x3f>
jmp    1141 <main+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [35 x i8] c"This is a new line from checkout 2\00"
@.str.1 = [35 x i8] c"This is a new line from checkout 1\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int randLIB_get_64bit();
uint16_t randLIB_get_16bit(void) {
  uint64_t r = randLIB_get_64bit();
  return (uint16_t)(r >> 48);
}


x86 assembly (clang, -O0):
<randLIB_get_16bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <randLIB_get_64bit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @randLIB_get_16bit() {
%1 = alloca i32
%2 = call i32 (...) @randLIB_get_64bit()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 48
ret i32 %4
}

LLVM IR (-O2):
define i32 @randLIB_get_16bit() {
%1 = tail call i32 (...) @randLIB_get_64bit()
ret i32 poison
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long parent;
};
typedef TYPE_1__ XMapRequestEvent;

/* Variables and functions */
void set_XMapRequestEvent_parent(void *_p, unsigned long _v) {
  ((XMapRequestEvent *)_p)->parent = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XMapRequestEvent_parent>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XMapRequestEvent_parent(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void irq_poll(void) {}


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

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

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

LLVM IR (-O2):
define void @irq_poll() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mill_choose_init(char *);
void go_select_init() { mill_choose_init(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @go_select_init() {
%1 = call i32 @mill_choose_init(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @go_select_init() {
%1 = tail call i32 @mill_choose_init(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ portWrite(char *);
int set_TemmaSolarRate(void) {
  if (portWrite("LK") < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<set_TemmaSolarRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <portWrite@plt>
cmp    $0x0,%rax
jge    113a <set_TemmaSolarRate+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <set_TemmaSolarRate+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_TemmaSolarRate>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <portWrite@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"LK\00"
define i32 @set_TemmaSolarRate() {
%1 = alloca i32
%2 = call i64 @portWrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"LK\00"
define i32 @set_TemmaSolarRate() {
%1 = tail call i64 @portWrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = ashr i64 %1, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}