xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int str_digit(char *s, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (!isdigit(s[i]))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<str_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116b <str_digit+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1158 <str_digit+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1172 <str_digit+0x62>
jmp    115d <str_digit+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <str_digit+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_digit>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
test   %esi,%esi
jle    114c <str_digit+0x3c>
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <str_digit+0x39>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <str_digit+0x20>
jmp    114c <str_digit+0x3c>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @str_digit(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %14, %5
br i1 %7, label %15, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %14, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @isdigit(i8 signext %11)
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i64 %9, 1
br i1 %13, label %15, label %6
15: ; preds = %8, %6, %2
%16 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int socket_sctp4b(void) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<socket_sctp4b>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_sctp4b>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @socket_sctp4b() {
%1 = load i32, i32* @EINVAL
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @socket_sctp4b() {
%1 = load i32, i32* @EINVAL
store i32 %1, i32* @errno
ret i32 -1
}
/* Type definitions */
struct nxtd_nxt_usb {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t nxtd_usb_recv(struct nxtd_nxt_usb *nxt, void *data, size_t size) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.nxtd_nxt_usb = type { i32 }
define i32 @nxtd_usb_recv(%struct.nxtd_nxt_usb* %0, i8* %1, i64 %2) {
%4 = alloca %struct.nxtd_nxt_usb*
%5 = alloca i8*
%6 = alloca i64
store %struct.nxtd_nxt_usb* %0, %struct.nxtd_nxt_usb** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.nxtd_nxt_usb = type { i32 }
define i32 @nxtd_usb_recv(%struct.nxtd_nxt_usb* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void __write1(const char *str) { write(1, str, strlen(str)); }


x86 assembly (clang, -O0):
<__write1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__write1>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @__write1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @__write1(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
void ath10k_thermal_set_throttling(struct ath10k *ar) {}


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

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

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

LLVM IR (-O2):
%struct.ath10k = type opaque
define void @ath10k_thermal_set_throttling(%struct.ath10k* nocapture %0) {
ret void
}
/* Variables and functions */
char *cpystr(char *);
char *tcp_canonical(char *name) { return cpystr(name); }


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

x86 assembly (clang, -O2):
<tcp_canonical>:
jmp    1030 <cpystr@plt>

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

LLVM IR (-O2):
define i8* @tcp_canonical(i8* %0) {
%2 = tail call i8* @cpystr(i8* %0)
ret i8* %2
}
int is3xx(int status) { return ((status >= 300) && (status < 400)); }


x86 assembly (clang, -O0):
<is3xx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x12c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <is3xx+0x26>
cmpl   $0x190,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is3xx>:
add    $0xfffffed4,%edi
xor    %eax,%eax
cmp    $0x64,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is3xx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 300
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 400
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is3xx(i32 %0) {
%2 = add i32 %0, -300
%3 = icmp ult i32 %2, 100
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ ckalloc(int);
void alloc_taxon_entry(char *taxon) {
  taxon = (char *)ckalloc((100 + 2) * sizeof(char));
}


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

x86 assembly (clang, -O2):
<alloc_taxon_entry>:
mov    $0x66,%edi
jmp    1030 <ckalloc@plt>

LLVM IR (-O0):
define void @alloc_taxon_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @ckalloc(i32 102)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret void
}

LLVM IR (-O2):
define void @alloc_taxon_entry(i8* nocapture readnone %0) {
%2 = tail call i64 @ckalloc(i32 102)
ret void
}
void comm_handshake(int sock) { return; }


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

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

LLVM IR (-O0):
define void @comm_handshake(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @comm_handshake(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int f(int a);
  int a = 2, i;
  for (i = 0; i < 3; i++)
    printf("%d\n", f(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    116b <main+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
call   1030 <f@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <f@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <f@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @f(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @f(i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int _start();
int __start(void) { return _start(); }


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

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

LLVM IR (-O0):
define i32 @__start() {
%1 = call i32 (...) @_start()
ret i32 %1
}

LLVM IR (-O2):
define i32 @__start() {
%1 = tail call i32 (...) @_start()
ret i32 %1
}
void calc_area(double *a, double k, double t1, double t2, double x, double h) {
  *a = h * x / (k * (t2 - t1));
}


x86 assembly (clang, -O0):
<calc_area>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_area>:
mulsd  %xmm4,%xmm3
subsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm2,%xmm3
movsd  %xmm3,(%rdi)
ret

LLVM IR (-O0):
define void @calc_area(double* %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double* %0, double** %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %12
%14 = load double, double* %11
%15 = fmul double %13, %14
%16 = load double, double* %8
%17 = load double, double* %10
%18 = load double, double* %9
%19 = fsub double %17, %18
%20 = fmul double %16, %19
%21 = fdiv double %15, %20
%22 = load double*, double** %7
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @calc_area(double* nocapture writeonly %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %4, %5
%8 = fsub double %3, %2
%9 = fmul double %8, %1
%10 = fdiv double %7, %9
store double %10, double* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int watchccs_write(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int watchccs_puts(BIO *bio, const char *str) {
  return watchccs_write(bio, str, strlen(str));
}


x86 assembly (clang, -O0):
<watchccs_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <watchccs_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<watchccs_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <watchccs_write@plt>

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

LLVM IR (-O2):
define i32 @watchccs_puts(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @watchccs_write(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
void gtk_widget_hide_all() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_hide_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: psc [data_dir] [pdb_1] [chain_1] [pdb_2] [chain_2]\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"Usage: psc [data_dir] [pdb_1] [chain_1] [pdb_2] [chain_2]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [58 x i8] c"Usage: psc [data_dir] [pdb_1] [chain_1] [pdb_2] [chain_2]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_sleep(int);
void test_sleep_1(void) { __builtin_arc_sleep(0x10); }


x86 assembly (clang, -O0):
<test_sleep_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <__builtin_arc_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sleep_1>:
mov    $0x10,%edi
jmp    1030 <__builtin_arc_sleep@plt>

LLVM IR (-O0):
define void @test_sleep_1() {
%1 = call i32 @__builtin_arc_sleep(i32 16)
ret void
}

LLVM IR (-O2):
define void @test_sleep_1() {
%1 = tail call i32 @__builtin_arc_sleep(i32 16)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ is_little_endian();
int /*<<< orphan*/ swap32(int /*<<< orphan*/);
uint32_t pgp_ntoh32(uint32_t in) {
  return (is_little_endian()) ? swap32(in) : in;
}


x86 assembly (clang, -O0):
<pgp_ntoh32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <is_little_endian@plt>
cmp    $0x0,%rax
je     114c <pgp_ntoh32+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <swap32@plt>
mov    %eax,-0x8(%rbp)
jmp    1152 <pgp_ntoh32+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgp_ntoh32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <is_little_endian@plt>
test   %rax,%rax
je     1137 <pgp_ntoh32+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <swap32@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pgp_ntoh32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @is_little_endian()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @swap32(i32 %6)
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @pgp_ntoh32(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @swap32(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
short MPEG2SequenceHeaderSize(const unsigned char *pb) {
  if ((pb[11] & 0x03) == 0x00) {
    return 12 + 10;
  }
  if ((pb[11] & 0x03) == 0x01) {
    return 12 + 64 + 10;
  }
  if (pb[11 + 64] & 0x01) {
    return 12 + 64 + 64 + 10;
  } else {
    return 12 + 64 + 10;
  }
}


x86 assembly (clang, -O0):
<MPEG2SequenceHeaderSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0xb(%rax),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1127 <MPEG2SequenceHeaderSize+0x27>
movw   $0x16,-0x2(%rbp)
jmp    116b <MPEG2SequenceHeaderSize+0x6b>
mov    -0x10(%rbp),%rax
movzbl 0xb(%rax),%eax
and    $0x3,%eax
cmp    $0x1,%eax
jne    1146 <MPEG2SequenceHeaderSize+0x46>
movw   $0x56,-0x2(%rbp)
jmp    116b <MPEG2SequenceHeaderSize+0x6b>
mov    -0x10(%rbp),%rax
movzbl 0x4b(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1165 <MPEG2SequenceHeaderSize+0x65>
movw   $0x96,-0x2(%rbp)
jmp    116b <MPEG2SequenceHeaderSize+0x6b>
movw   $0x56,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPEG2SequenceHeaderSize>:
mov    0xb(%rdi),%al
and    $0x3,%al
je     1110 <MPEG2SequenceHeaderSize+0x10>
cmp    $0x1,%al
jne    1115 <MPEG2SequenceHeaderSize+0x15>
mov    $0x56,%ax
ret
mov    $0x16,%ax
ret
movzbl 0x4b(%rdi),%eax
and    $0x1,%eax
shl    $0x6,%eax
add    $0x56,%eax
ret

LLVM IR (-O0):
define signext i16 @MPEG2SequenceHeaderSize(i8* %0) {
%2 = alloca i16
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 11
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i16 22, i16* %2
br label %28
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 11
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %15, 3
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %19
18: ; preds = %11
store i16 86, i16* %2
br label %28
19: ; preds = %11
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 75
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = and i32 %23, 1
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %19
store i16 150, i16* %2
br label %28
27: ; preds = %19
store i16 86, i16* %2
br label %28
28: ; preds = %27, %26, %18, %10
%29 = load i16, i16* %2
ret i16 %29
}

LLVM IR (-O2):
define signext i16 @MPEG2SequenceHeaderSize(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 11
%3 = load i8, i8* %2
%4 = and i8 %3, 3
switch i8 %4, label %6 [
i8 0, label %12
i8 1, label %5
]
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 75
%8 = load i8, i8* %7
%9 = and i8 %8, 1
%10 = icmp eq i8 %9, 0
%11 = select i1 %10, i16 86, i16 150
br label %12
12: ; preds = %6, %1, %5
%13 = phi i16 [ 86, %5 ], [ 22, %1 ], [ %11, %6 ]
ret i16 %13
}
/* Variables and functions */
size_t ft_strclen(char const *str, char c) {
  size_t i;
  i = 0;
  while (str[i] != (const char)c && str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strclen>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     1148 <ft_strclen+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1158 <ft_strclen+0x58>
jmp    1169 <ft_strclen+0x69>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <ft_strclen+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1122 <ft_strclen+0x22>
test   %cl,%cl
jne    1110 <ft_strclen+0x10>
ret

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

LLVM IR (-O2):
define i64 @ft_strclen(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
%10 = add i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i64 %4
}
void RTZipDecompCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTZipDecompCreate() {
ret void
}
/* Variables and functions */
unsigned int const UINT_MAX;
unsigned int pow_uint(const unsigned int base, const unsigned int exp) {
  unsigned int result = base;
  const unsigned int limit = UINT_MAX / base;
  for (unsigned int i = 1; i < exp; ++i) {
    if (result <= limit)
      result *= base;
    else
      return 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<pow_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    116e <pow_uint+0x6e>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
ja     114f <pow_uint+0x4f>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115b <pow_uint+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1174 <pow_uint+0x74>
jmp    1160 <pow_uint+0x60>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <pow_uint+0x28>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_uint>:
xor    %eax,%eax
cmp    $0x2,%esi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
@UINT_MAX = constant i32 0
define i32 @pow_uint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* @UINT_MAX
%11 = load i32, i32* %4
%12 = udiv i32 %10, %11
store i32 %12, i32* %7
store i32 1, i32* %8
br label %13
13: ; preds = %27, %2
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = icmp ult i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = icmp ule i32 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i32, i32* %6
%24 = mul i32 %23, %22
store i32 %24, i32* %6
br label %26
25: ; preds = %17
store i32 0, i32* %3
br label %32
26: ; preds = %21
br label %27
27: ; preds = %26
%28 = load i32, i32* %8
%29 = add i32 %28, 1
store i32 %29, i32* %8
br label %13
30: ; preds = %13
%31 = load i32, i32* %6
store i32 %31, i32* %3
br label %32
32: ; preds = %30, %25
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@UINT_MAX = constant i32 0
define i32 @pow_uint(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 1
%4 = select i1 %3, i32 0, i32 %0
ret i32 %4
}
int doublecmpfunc(const void *a, const void *b) {
  return (*(double *)a - *(double *)b);
}


x86 assembly (clang, -O0):
<doublecmpfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doublecmpfunc>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @doublecmpfunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @doublecmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fptosi double %7 to i32
ret i32 %8
}
int fun159() { return 159; }


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

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

LLVM IR (-O0):
define i32 @fun159() {
ret i32 159
}

LLVM IR (-O2):
define i32 @fun159() {
ret i32 159
}
char *hash_plugin_detailed(void) {
  return ("rar - RAR3 passwords plugin\n"
          "------------------------------------------------\n"
          "Use this module to crack RAR archives passwords\n"
          "Input should be a passworded RAR file specified with -f\n"
          "Known software that uses this password hashing method:\n"
          "WinRAR\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [289 x i8] c"rar - RAR3 passwords plugin\0A------------------------------------------------\0AUse this module to crack RAR archives passwords\0AInput should be a passworded RAR file specified with -f\0AKnown software that uses this password hashing method:\0AWinRAR\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [289 x i8] c"rar - RAR3 passwords plugin\0A------------------------------------------------\0AUse this module to crack RAR archives passwords\0AInput should be a passworded RAR file specified with -f\0AKnown software that uses this password hashing method:\0AWinRAR\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned long ary_aref(unsigned long, int /*<<< orphan*/);
int /*<<< orphan*/ integer_new(int /*<<< orphan*/);
unsigned long int ary_first(unsigned long int recv) {
  return ary_aref(recv, integer_new(0));
}


x86 assembly (clang, -O0):
<ary_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
call   1030 <integer_new@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <ary_aref@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ary_first>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <integer_new@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ary_aref@plt>

LLVM IR (-O0):
define i64 @ary_first(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @integer_new(i32 0)
%5 = call i64 @ary_aref(i64 %3, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @ary_first(i64 %0) {
%2 = tail call i32 @integer_new(i32 0)
%3 = tail call i64 @ary_aref(i64 %0, i32 %2)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ init();
int x_open(char const *, int, int /*<<< orphan*/);
int v4l2_open(const char *name, int flags, mode_t mode) {
  init();
  return x_open(name, flags, mode);
}


x86 assembly (clang, -O0):
<v4l2_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <init@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <x_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l2_open>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <init@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <x_open@plt>

LLVM IR (-O0):
define i32 @v4l2_open(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
%7 = call i32 (...) @init()
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @x_open(i8* %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @v4l2_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @init()
%5 = tail call i32 @x_open(i8* %0, i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
double log10(int);
float mel(float f) { return (2595.0 * log10(1 + f / 700.0)); }


x86 assembly (clang, -O0):
<mel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mel>:
push   %rax
cvtss2sd %xmm0,%xmm0
divsd  0xee3(%rip),%xmm0
addsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log10@plt>
mulsd  0xeda(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mel(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 7.000000e+02
%6 = fadd double 1.000000e+00, %5
%7 = fptosi double %6 to i32
%8 = call double @log10(i32 %7)
%9 = fmul double 2.595000e+03, %8
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @mel(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 7.000000e+02
%4 = fadd double %3, 1.000000e+00
%5 = fptosi double %4 to i32
%6 = tail call double @log10(i32 %5)
%7 = fmul double %6, 2.595000e+03
%8 = fptrunc double %7 to float
ret float %8
}
unsigned long pit_get_reload(unsigned long msecs) {
  static const unsigned long FREQ = 1193182ul;
  return (msecs * FREQ) / 1000ul;
}


x86 assembly (clang, -O0):
<pit_get_reload>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x1234de,-0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_get_reload>:
imul   $0x1234de,%rdi,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
mov    %rdx,%rax
shr    $0x4,%rax
ret

LLVM IR (-O0):
@pit_get_reload.FREQ = internal constant i64 1193182
define i64 @pit_get_reload(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1193182
%5 = udiv i64 %4, 1000
ret i64 %5
}

LLVM IR (-O2):
define i64 @pit_get_reload(i64 %0) {
%2 = mul i64 %0, 1193182
%3 = udiv i64 %2, 1000
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ _ErrorS(long, char *, char const *);
void Error_MalformedEscapedString(long p_position, const char *p_string) {
  _ErrorS(p_position, "Illegal escape in string '%s'", p_string);
}


x86 assembly (clang, -O0):
<Error_MalformedEscapedString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <_ErrorS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Error_MalformedEscapedString>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <_ErrorS@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Illegal escape in string '%s'\00"
define void @Error_MalformedEscapedString(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i64, i64* %3
%6 = load i8*, i8** %4
%7 = call i32 @_ErrorS(i64 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Illegal escape in string '%s'\00"
define void @Error_MalformedEscapedString(i64 %0, i8* %1) {
%3 = tail call i32 @_ErrorS(i64 %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void ft_striter(char *s, void (*f)(char *)) {
  int i;
  if (s && f) {
    i = 0;
    while (s[i] != '\0') {
      f(&s[i]);
      i++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <ft_striter+0x66>
cmpq   $0x0,-0x10(%rbp)
je     1166 <ft_striter+0x66>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <ft_striter+0x61>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
add    %rcx,%rdi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <ft_striter+0x2d>
jmp    1166 <ft_striter+0x66>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i64 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
tail call void %1(i8* %11)
%12 = add nuw i64 %10, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int puts(char const *const);
__attribute__((__unused__)) int(cheat_unwrapped_puts)(
    char const *const message) {
  return puts(message);
}


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

x86 assembly (clang, -O2):
<cheat_unwrapped_puts>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define i32 @cheat_unwrapped_puts(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ textbackground(int /*<<< orphan*/);
int /*<<< orphan*/ textcolor(int);
void voca3(void) {
  textbackground(0);
  textcolor(14);
  gotoxy(19, 5);
  printf("C.E.C.y.T No. 3 \"Estanislao Ramirez Ruiz\"");
}


x86 assembly (clang, -O0):
<voca3>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1060 <textbackground@plt>
mov    $0xe,%edi
call   1040 <textcolor@plt>
mov    $0x13,%edi
mov    $0x5,%esi
call   1050 <gotoxy@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<voca3>:
push   %rax
xor    %edi,%edi
call   1060 <textbackground@plt>
mov    $0xe,%edi
call   1040 <textcolor@plt>
mov    $0x13,%edi
mov    $0x5,%esi
call   1050 <gotoxy@plt>
lea    0xe98(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"C.E.C.y.T No. 3 \22Estanislao Ramirez Ruiz\22\00"
define void @voca3() {
%1 = call i32 @textbackground(i32 0)
%2 = call i32 @textcolor(i32 14)
%3 = call i32 @gotoxy(i32 19, i32 5)
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"C.E.C.y.T No. 3 \22Estanislao Ramirez Ruiz\22\00"
define void @voca3() {
%1 = tail call i32 @textbackground(i32 0)
%2 = tail call i32 @textcolor(i32 14)
%3 = tail call i32 @gotoxy(i32 19, i32 5)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x96() {
  Assert_real((isalpha(150) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              755, ("isalpha should be 0 for 0x96"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x96>:
push   %rax
mov    $0x96,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2f3,%edx
pop    %rax
jmp    1040 <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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x96\00"
define void @t_isalpha_0x96() {
%1 = call i64 @isalpha(i32 150)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 755, i8* getelementptr inbounds ([29 x i8], [29 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x96\00"
define void @t_isalpha_0x96() {
%1 = tail call i64 @isalpha(i32 150)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 755, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int round2_b();
int round2_a() { return round2_b(); }


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

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

LLVM IR (-O0):
define i32 @round2_a() {
%1 = call i32 (...) @round2_b()
ret i32 %1
}

LLVM IR (-O2):
define i32 @round2_a() {
%1 = tail call i32 (...) @round2_b()
ret i32 %1
}
int rgb_order(char *mode, char color) {
  int i = 0;
  while (*mode != color && *(++mode)) {
    ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<rgb_order>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1149 <rgb_order+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1159 <rgb_order+0x59>
jmp    1167 <rgb_order+0x67>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <rgb_order+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_order>:
xor    %eax,%eax
cmp    %sil,(%rdi)
je     1122 <rgb_order+0x22>
xor    %eax,%eax
nopl   0x0(%rax)
movzbl 0x1(%rdi,%rax,1),%ecx
test   %cl,%cl
je     1122 <rgb_order+0x22>
add    $0x1,%rax
cmp    %sil,%cl
jne    1110 <rgb_order+0x10>
ret

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

LLVM IR (-O2):
define i32 @rgb_order(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %14, label %5
5: ; preds = %2, %11
%6 = phi i32 [ %12, %11 ], [ 0, %2 ]
%7 = phi i8* [ %8, %11 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i8 %9, %1
br i1 %13, label %14, label %5
14: ; preds = %5, %11, %2
%15 = phi i32 [ 0, %2 ], [ %12, %11 ], [ %6, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void f1(char *line) { printf("getted string:'%s';\n", line); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"getted string:'%s';\0A\00"
define void @f1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"getted string:'%s';\0A\00"
define void @f1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_RDONLY;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWGRP;
int S_IWUSR;
int open(char *, int, int);
int open_rdonly(char *filename) {
  return open(filename, O_RDONLY | O_CREAT,
              S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
}


x86 assembly (clang, -O0):
<open_rdonly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
or     (%rax),%esi
mov    0x2e77(%rip),%rax
mov    (%rax),%edx
mov    0x2e8e(%rip),%rax
or     (%rax),%edx
mov    0x2e75(%rip),%rax
or     (%rax),%edx
mov    0x2e84(%rip),%rax
or     (%rax),%edx
mov    0x2e5b(%rip),%rax
or     (%rax),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_rdonly>:
mov    0x2ec9(%rip),%rax
mov    0x2eda(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e87(%rip),%rax
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e85(%rip),%rax
or     (%rax),%edx
mov    0x2e94(%rip),%rax
or     (%rax),%edx
mov    0x2e6b(%rip),%rax
or     (%rax),%edx
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IROTH = global i32 0
define i32 @open_rdonly(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDONLY
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IRUSR
%8 = load i32, i32* @S_IWUSR
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IRGRP
%11 = or i32 %9, %10
%12 = load i32, i32* @S_IWGRP
%13 = or i32 %11, %12
%14 = load i32, i32* @S_IROTH
%15 = or i32 %13, %14
%16 = call i32 @open(i8* %3, i32 %6, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IROTH = global i32 0
define i32 @open_rdonly(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IRUSR
%6 = load i32, i32* @S_IWUSR
%7 = or i32 %6, %5
%8 = load i32, i32* @S_IRGRP
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IWGRP
%11 = or i32 %9, %10
%12 = load i32, i32* @S_IROTH
%13 = or i32 %11, %12
%14 = tail call i32 @open(i8* %0, i32 %4, i32 %13)
ret i32 %14
}