xunge/DecIR huggingface dataset:
int last_unordered(int n[], int size) {
  for (int i = size - 2; i >= 0; i--) {
    if (n[i] > n[i + 1])
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<last_unordered>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     115d <last_unordered+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    114a <last_unordered+0x4a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <last_unordered+0x64>
jmp    114f <last_unordered+0x4f>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <last_unordered+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_unordered>:
mov    $0xffffffff,%eax
cmp    $0x2,%esi
jl     1126 <last_unordered+0x26>
add    $0xfffffffe,%esi
nopl   (%rax)
mov    %esi,%ecx
mov    (%rdi,%rcx,4),%ecx
lea    0x1(%rsi),%edx
cmp    (%rdi,%rdx,4),%ecx
jg     1127 <last_unordered+0x27>
lea    -0x1(%rsi),%ecx
test   %esi,%esi
mov    %ecx,%esi
jg     1110 <last_unordered+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @last_unordered(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = add nsw i32 %1, -2
br label %6
6: ; preds = %4, %16
%7 = phi i32 [ %17, %16 ], [ %5, %4 ]
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = add nuw nsw i32 %7, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %10, %14
br i1 %15, label %19, label %16
16: ; preds = %6
%17 = add nsw i32 %7, -1
%18 = icmp sgt i32 %7, 0
br i1 %18, label %6, label %19
19: ; preds = %16, %6, %2
%20 = phi i32 [ -1, %2 ], [ %7, %6 ], [ -1, %16 ]
ret i32 %20
}
void av_packet_rescale_ts() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_rescale_ts() {
ret void
}
void unsigned_char_add_signed_char_unsigned_char(unsigned char *LHS,
                                                 unsigned char RHS) {
  (*LHS) += RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_add_signed_char_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_add_signed_char_unsigned_char>:
add    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_add_signed_char_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @unsigned_char_add_signed_char_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ box_double(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ fmod(double, double);
double untag_float_fast(int /*<<< orphan*/);
void primitive_float_mod_impl(void) {
  double y = untag_float_fast(dpop());
  double x = untag_float_fast(dpop());
  ;
  box_double(fmod(x, y));
}


x86 assembly (clang, -O0):
<primitive_float_mod_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1040 <fmod@plt>
mov    %eax,%edi
call   1060 <box_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_mod_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_float_fast@plt>
movsd  (%rsp),%xmm1
call   1040 <fmod@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <box_double@plt>

LLVM IR (-O0):
define void @primitive_float_mod_impl() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @dpop()
%4 = call double @untag_float_fast(i32 %3)
store double %4, double* %1
%5 = call i32 (...) @dpop()
%6 = call double @untag_float_fast(i32 %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = load double, double* %1
%9 = call i32 @fmod(double %7, double %8)
%10 = call i32 @box_double(i32 %9)
ret void
}

LLVM IR (-O2):
define void @primitive_float_mod_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call double @untag_float_fast(i32 %1)
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float_fast(i32 %3)
%5 = tail call i32 @fmod(double %4, double %2)
%6 = tail call i32 @box_double(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main5() {
  printf("Hola mundo!!\n\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hola mundo!!\0A\0A\00"
define i32 @main5() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hola mundo!!\0A\00"
define i32 @main5() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((visibility("default"))) void cond_br(void) {}


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

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

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

LLVM IR (-O2):
define void @cond_br() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void U32TO8_LE(unsigned char *p, const uint32_t v) {
  p[0] = (unsigned char)(v);
  p[1] = (unsigned char)(v >> 8);
  p[2] = (unsigned char)(v >> 16);
  p[3] = (unsigned char)(v >> 24);
}


x86 assembly (clang, -O0):
<U32TO8_LE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<U32TO8_LE>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @U32TO8_LE(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int _strlen(const char *str) {
  int len = 0;
  while (str && *str) {
    len++;
    str++;
  }
  return len;
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     112f <_strlen+0x2f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113f <_strlen+0x3f>
jmp    1159 <_strlen+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <_strlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <_strlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen+0x10>
ret

LLVM IR (-O0):
define i32 @_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %7, %4
%13 = phi i1 [ false, %4 ], [ %11, %7 ]
br i1 %13, label %14, label %19
14: ; preds = %12
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %4
19: ; preds = %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %10, %6 ], [ %0, %3 ]
%8 = phi i32 [ %9, %6 ], [ 0, %3 ]
%9 = add nuw nsw i32 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ put_text(int, int, char *);
int /*<<< orphan*/ scale_to_screen(double, double, int *, int *);
void text_abs(double x, double y, char *text) {
  int xp, yp;
  scale_to_screen(x, y, &xp, &yp);
  put_text(xp, yp, text);
}


x86 assembly (clang, -O0):
<text_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scale_to_screen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <put_text@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_abs>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scale_to_screen@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %rbx,%rdx
call   1030 <put_text@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @text_abs(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call i32 @scale_to_screen(double %9, double %10, i32* %7, i32* %8)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %6
%15 = call i32 @put_text(i32 %12, i32 %13, i8* %14)
ret void
}

LLVM IR (-O2):
define void @text_abs(double %0, double %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 @scale_to_screen(double %0, double %1, i32* %4, i32* %5)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @put_text(i32 %9, i32 %10, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_2807() {
  Assert_real((isqrt(2807) == 52),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1325, ("Integer square root of 2807 should be 52"));
}


x86 assembly (clang, -O0):
<t_sqrt_2807>:
push   %rbp
mov    %rsp,%rbp
mov    $0xaf7,%edi
call   1030 <isqrt@plt>
cmp    $0x34,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x52d,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_2807>:
push   %rax
mov    $0xaf7,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x34,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x52d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 2807 should be 52\00"
define void @t_sqrt_2807() {
%1 = call i32 @isqrt(i32 2807)
%2 = icmp eq i32 %1, 52
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1325, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 2807 should be 52\00"
define void @t_sqrt_2807() {
%1 = tail call i32 @isqrt(i32 2807)
%2 = icmp eq i32 %1, 52
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1325, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
unsigned char Get_Byte();
int /*<<< orphan*/ Send_Byte(unsigned long);
unsigned char Read(unsigned long Dst) {
  unsigned char byte = 0;
  CE_Low();
  Send_Byte(0x03);
  Send_Byte(((Dst & 0xFFFFFF) >> 16));
  Send_Byte(((Dst & 0xFFFF) >> 8));
  Send_Byte(Dst & 0xFF);
  byte = Get_Byte();
  CE_High();
  return byte;
}


x86 assembly (clang, -O0):
<Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    $0x0,%al
call   1060 <CE_Low@plt>
mov    $0x3,%edi
call   1040 <Send_Byte@plt>
mov    -0x8(%rbp),%rdi
and    $0xffffff,%rdi
shr    $0x10,%rdi
call   1040 <Send_Byte@plt>
mov    -0x8(%rbp),%rdi
and    $0xffff,%rdi
shr    $0x8,%rdi
call   1040 <Send_Byte@plt>
mov    -0x8(%rbp),%rdi
and    $0xff,%rdi
call   1040 <Send_Byte@plt>
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1050 <CE_High@plt>
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <CE_Low@plt>
mov    $0x3,%edi
call   1040 <Send_Byte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1040 <Send_Byte@plt>
movzbl %bh,%edi
call   1040 <Send_Byte@plt>
movzbl %bl,%edi
call   1040 <Send_Byte@plt>
xor    %eax,%eax
call   1030 <Get_Byte@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <CE_High@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @Read(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
store i8 0, i8* %3
%4 = call i32 (...) @CE_Low()
%5 = call i32 @Send_Byte(i64 3)
%6 = load i64, i64* %2
%7 = and i64 %6, 16777215
%8 = lshr i64 %7, 16
%9 = call i32 @Send_Byte(i64 %8)
%10 = load i64, i64* %2
%11 = and i64 %10, 65535
%12 = lshr i64 %11, 8
%13 = call i32 @Send_Byte(i64 %12)
%14 = load i64, i64* %2
%15 = and i64 %14, 255
%16 = call i32 @Send_Byte(i64 %15)
%17 = call zeroext i8 (...) @Get_Byte()
store i8 %17, i8* %3
%18 = call i32 (...) @CE_High()
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @Read(i64 %0) {
%2 = tail call i32 (...) @CE_Low()
%3 = tail call i32 @Send_Byte(i64 3)
%4 = lshr i64 %0, 16
%5 = and i64 %4, 255
%6 = tail call i32 @Send_Byte(i64 %5)
%7 = lshr i64 %0, 8
%8 = and i64 %7, 255
%9 = tail call i32 @Send_Byte(i64 %8)
%10 = and i64 %0, 255
%11 = tail call i32 @Send_Byte(i64 %10)
%12 = tail call zeroext i8 (...) @Get_Byte()
%13 = tail call i32 (...) @CE_High()
ret i8 %12
}
void isr_hard_fault(void) {
  puts("##### HARD FAULT #####");
  while (1) {
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<isr_hard_fault>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
nop
jmp    1122 <isr_hard_fault+0x12>

x86 assembly (clang, -O2):
<isr_hard_fault>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
nop
nop
jmp    1120 <isr_hard_fault+0x10>

LLVM IR (-O0):
@.str = [23 x i8] c"##### HARD FAULT #####\00"
define void @isr_hard_fault() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [23 x i8] c"##### HARD FAULT #####\00"
define void @isr_hard_fault() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x44() {
  Assert_real((isascii(68)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              345, ("isascii should be 1 for D"));
}


x86 assembly (clang, -O0):
<t_isascii_0x44>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x159,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x44>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x159,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for D\00"
define void @t_isascii_0x44() {
%1 = call i32 @isascii(i32 68)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for D\00"
define void @t_isascii_0x44() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __dos_store_4le(unsigned char *p, unsigned int val) {
  p[0] = (val & 0xff);
  p[1] = ((val >> 8) & 0xff);
  p[2] = ((val >> 16) & 0xff);
  p[3] = ((val >> 24) & 0xff);
}


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

x86 assembly (clang, -O2):
<__dos_store_4le>:
mov    %esi,(%rdi)
ret

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

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

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
uid_t fsop_path_owner(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return st.st_uid;
}


x86 assembly (clang, -O0):
<fsop_path_owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <fsop_path_owner+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <fsop_path_owner+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_owner>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1129 <fsop_path_owner+0x19>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fsop_path_owner(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fsop_path_owner(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void blk_start_plug(struct blk_plug *plug) {}


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

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

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

LLVM IR (-O2):
%struct.blk_plug = type opaque
define void @blk_start_plug(%struct.blk_plug* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clrtobot();
int /*<<< orphan*/ delwins();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ isendwin();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void textgfx_end() {
  int x, y;
  delwins();
  if (!isendwin()) {
    getmaxyx(stdscr, y, x);
    move(y - 1, 0);
    clrtobot();
    refresh();
    endwin();
  }
}


x86 assembly (clang, -O0):
<textgfx_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <delwins@plt>
mov    $0x0,%al
call   1080 <isendwin@plt>
cmp    $0x0,%eax
jne    11c5 <textgfx_end+0x55>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1040 <getmaxyx@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    $0x0,%al
call   1030 <clrtobot@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textgfx_end>:
push   %rax
xor    %eax,%eax
call   1070 <delwins@plt>
xor    %eax,%eax
call   1080 <isendwin@plt>
test   %eax,%eax
je     1185 <textgfx_end+0x15>
pop    %rax
ret
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1040 <getmaxyx@plt>
xor    %esi,%esi
call   1090 <move@plt>
xor    %eax,%eax
call   1030 <clrtobot@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <endwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @textgfx_end() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @delwins()
%4 = call i32 (...) @isendwin()
%5 = icmp ne i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %0
%7 = load i32, i32* @stdscr
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = call i32 @getmaxyx(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = call i32 @move(i32 %12, i32 0)
%14 = call i32 (...) @clrtobot()
%15 = call i32 (...) @refresh()
%16 = call i32 (...) @endwin()
br label %17
17: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @textgfx_end() {
%1 = tail call i32 (...) @delwins()
%2 = tail call i32 (...) @isendwin()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %0
%5 = load i32, i32* @stdscr
%6 = tail call i32 @getmaxyx(i32 %5, i32 undef, i32 undef)
%7 = tail call i32 @move(i32 undef, i32 0)
%8 = tail call i32 (...) @clrtobot()
%9 = tail call i32 (...) @refresh()
%10 = tail call i32 (...) @endwin()
br label %11
11: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M3_f(char *s) {
  debug("M3_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M3_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M3_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"M3_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M3_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"M3_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M3_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int phChangeAudioDevices(const char *devstr) {
  char reqbuf[521];
  snprintf(reqbuf, sizeof(reqbuf), "AUDIO DEV=%s", devstr ? devstr : "");
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phChangeAudioDevices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x220(%rbp),%rax
mov    %rax,-0x228(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <phChangeAudioDevices+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x230(%rbp)
jmp    116b <phChangeAudioDevices+0x4b>
lea    0xead(%rip),%rax
mov    %rax,-0x230(%rbp)
jmp    116b <phChangeAudioDevices+0x4b>
mov    -0x228(%rbp),%rdi
mov    -0x230(%rbp),%rcx
mov    $0x209,%esi
lea    0xe7b(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x220(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phChangeAudioDevices>:
push   %rbx
sub    $0x210,%rsp
test   %rdi,%rdi
lea    0xeda(%rip),%rcx
cmovne %rdi,%rcx
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x209,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x210,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"AUDIO DEV=%s\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @phChangeAudioDevices(i8* %0) {
%2 = alloca i8*
%3 = alloca [521 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [521 x i8], [521 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %2
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %7
%11 = phi i8* [ %8, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %9 ]
%12 = call i32 @snprintf(i8* %4, i32 521, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [521 x i8], [521 x i8]* %3, i64 0, i64 0
%14 = call i32 @ph_rpc(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"AUDIO DEV=%s\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @phChangeAudioDevices(i8* %0) {
%2 = alloca [521 x i8]
%3 = getelementptr inbounds [521 x i8], [521 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0
%6 = call i32 @snprintf(i8* %3, i32 521, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @ph_rpc(i8* %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex32array(void *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 32));
}


x86 assembly (clang, -O0):
<lookcomplex32array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x5,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookcomplex32array>:
shl    $0x5,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex32array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 32
%8 = call i32 @lookNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @lookcomplex32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_random();
int main() {
  int i;
  for (i = 0; i < 20000000; i++)
    get_random();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1312d00,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0x0,%al
call   1030 <get_random@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1312d00,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_random@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @get_random()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 20000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
char *GetLastChar(char *, char);
const char *basename(char *path) {
  const char *last = GetLastChar(path, '/');
  if (!last) {
    last = GetLastChar(path, '\\');
  }
  if (!last) {
    return path;
  }
  return last + 1;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <GetLastChar@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114b <basename+0x3b>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <GetLastChar@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1163 <basename+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <basename+0x5f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <GetLastChar@plt>
test   %rax,%rax
jne    1130 <basename+0x20>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <GetLastChar@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @GetLastChar(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i8* @GetLastChar(i8* %10, i8 signext 92)
store i8* %11, i8** %4
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = load i8*, i8** %3
store i8* %16, i8** %2
br label %20
17: ; preds = %12
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8* %19, i8** %2
br label %20
20: ; preds = %17, %15
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @GetLastChar(i8* %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @GetLastChar(i8* %0, i8 signext 92)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %2, %1 ], [ %5, %4 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
/* Variables and functions */
char *rindex(char const *, char);
bool bb_is_file_or_dir_hidden(char const *name) {
  char const *last_slash = rindex(name, '/');
  return (last_slash ? last_slash[1] : name[0]) == '.';
}


x86 assembly (clang, -O0):
<bb_is_file_or_dir_hidden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <rindex@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <bb_is_file_or_dir_hidden+0x39>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <bb_is_file_or_dir_hidden+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_is_file_or_dir_hidden>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <rindex@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
xor    %eax,%eax
cmpb   $0x2e,(%rcx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bb_is_file_or_dir_hidden(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @rindex(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
br label %18
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %13, %8
%19 = phi i32 [ %12, %8 ], [ %17, %13 ]
%20 = icmp eq i32 %19, 46
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @bb_is_file_or_dir_hidden(i8* %0) {
%2 = tail call i8* @rindex(i8* %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 46
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ domain_freeall();
int /*<<< orphan*/ restype_freeall();
int /*<<< orphan*/ tuple_freeall();
void data_exit() {
  domain_freeall();
  restype_freeall();
  tuple_freeall();
}


x86 assembly (clang, -O0):
<data_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <domain_freeall@plt>
mov    $0x0,%al
call   1050 <restype_freeall@plt>
mov    $0x0,%al
call   1030 <tuple_freeall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_exit>:
push   %rax
xor    %eax,%eax
call   1040 <domain_freeall@plt>
xor    %eax,%eax
call   1050 <restype_freeall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tuple_freeall@plt>

LLVM IR (-O0):
define void @data_exit() {
%1 = call i32 (...) @domain_freeall()
%2 = call i32 (...) @restype_freeall()
%3 = call i32 (...) @tuple_freeall()
ret void
}

LLVM IR (-O2):
define void @data_exit() {
%1 = tail call i32 (...) @domain_freeall()
%2 = tail call i32 (...) @restype_freeall()
%3 = tail call i32 (...) @tuple_freeall()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void test_6(void) {
  int i6_1 = 3;
  i6_1 = !!i6_1;
  int i6_2 = -1;
  if (i6_2)
    i6_2 = 0;
  else
    i6_2 = 1;
  int i6_3 = 3 || 2 && 0;
  printf("%d %d %d\n", i6_1, i6_2, i6_3);
}


x86 assembly (clang, -O0):
<test_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114f <test_6+0x3f>
movl   $0x0,-0x8(%rbp)
jmp    1156 <test_6+0x46>
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_6>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
define void @test_6() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
store i32 %8, i32* %1
store i32 -1, i32* %2
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 0, i32* %2
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
store i32 1, i32* %3
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define void @test_6() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 0, i32 1)
ret void
}
/* Variables and functions */
int pdp10_freadwrite_bad_params(size_t size, size_t nmemb) {
  return !(size == 1 || (nmemb == 1 && (size == 2 || size == 4)));
}


x86 assembly (clang, -O0):
<pdp10_freadwrite_bad_params>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x1,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1153 <pdp10_freadwrite_bad_params+0x53>
xor    %eax,%eax
cmpq   $0x1,-0x10(%rbp)
mov    %al,-0x12(%rbp)
jne    114d <pdp10_freadwrite_bad_params+0x4d>
mov    $0x1,%al
cmpq   $0x2,-0x8(%rbp)
mov    %al,-0x13(%rbp)
je     1147 <pdp10_freadwrite_bad_params+0x47>
cmpq   $0x4,-0x8(%rbp)
sete   %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdp10_freadwrite_bad_params>:
xor    %eax,%eax
cmp    $0x1,%rdi
je     1123 <pdp10_freadwrite_bad_params+0x23>
mov    $0x1,%eax
cmp    $0x1,%rsi
jne    1123 <pdp10_freadwrite_bad_params+0x23>
add    $0xfffffffffffffffe,%rdi
xor    %eax,%eax
test   $0xfffffffffffffffd,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @pdp10_freadwrite_bad_params(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = icmp eq i64 %1, 1
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = icmp ne i64 %0, 2
%8 = icmp ne i64 %0, 4
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %6, %2
%12 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %10, %6 ]
ret i32 %12
}
int mdt_hsm_coordinator_get_actions(struct mdt_thread_info *mti,
                                    struct hsm_action_list *hal) {
  return 0;
}


x86 assembly (clang, -O0):
<mdt_hsm_coordinator_get_actions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mdt_thread_info = type opaque
%struct.hsm_action_list = type opaque
define i32 @mdt_hsm_coordinator_get_actions(%struct.mdt_thread_info* %0, %struct.hsm_action_list* %1) {
%3 = alloca %struct.mdt_thread_info*
%4 = alloca %struct.hsm_action_list*
store %struct.mdt_thread_info* %0, %struct.mdt_thread_info** %3
store %struct.hsm_action_list* %1, %struct.hsm_action_list** %4
ret i32 0
}

LLVM IR (-O2):
%struct.mdt_thread_info = type opaque
%struct.hsm_action_list = type opaque
define i32 @mdt_hsm_coordinator_get_actions(%struct.mdt_thread_info* nocapture readnone %0, %struct.hsm_action_list* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ ts_broadcast(char, int /*<<< orphan*/ *, int *);
void ts_broadcast_string(char *string, fd_set *fd_set, int *client_socket) {
  while (*string != 0) {
    ts_broadcast(*string, fd_set, client_socket);
    string++;
  }
}


x86 assembly (clang, -O0):
<ts_broadcast_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <ts_broadcast_string+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsbl %al,%edi
call   1030 <ts_broadcast@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <ts_broadcast_string+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_broadcast_string>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1149 <ts_broadcast_string+0x39>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <ts_broadcast@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ts_broadcast_string+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ts_broadcast_string(i8* nocapture %0, i32* %1, i32* %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @ts_broadcast(i8 signext %7, i32* %1, i32* %2)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}
/* Variables and functions */
int f2fstat_main(int, char **);
int main(int argc, char **argv) { return f2fstat_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <f2fstat_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <f2fstat_main@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @f2fstat_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @f2fstat_main(i32 %0, i8** %1)
ret i32 %3
}