xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  int a[][2] = {
      {
          1,
          2,
      },
      {3, 4},
  };
  if (a[0][0] != 1 || a[0][1] != 2 || a[1][0] != 3 || a[1][1] != 4) {
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    115d <main+0x4d>
cmpl   $0x2,-0x1c(%rbp)
jne    115d <main+0x4d>
cmpl   $0x3,-0x18(%rbp)
jne    115d <main+0x4d>
cmpl   $0x4,-0x14(%rbp)
je     1164 <main+0x54>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 3, i32 4]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [2 x i32]]
store i32 0, i32* %1
%3 = bitcast [2 x [2 x i32]]* %2 to i8*
%4 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 1
br i1 %7, label %23, label %8
8: ; preds = %0
%9 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 0
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 2
br i1 %12, label %23, label %13
13: ; preds = %8
%14 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 3
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %2, i64 0, i64 1
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0, i64 1
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, 4
br i1 %22, label %23, label %25
23: ; preds = %18, %13, %8, %0
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x9c() {
  Assert_real((isalpha(156) == 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",
              785, ("isalpha should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x311,%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 0x9c\00"
define void @t_isalpha_0x9c() {
%1 = call i64 @isalpha(i32 156)
%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 785, 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 0x9c\00"
define void @t_isalpha_0x9c() {
%1 = tail call i64 @isalpha(i32 156)
%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 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ mod(double, int);
int dfloor(double n) { return (int)(n - mod(n, 1)); }


x86 assembly (clang, -O0):
<dfloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <mod@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfloor>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1030 <mod@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dfloor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call i64 @mod(double %4, i32 1)
%6 = sitofp i64 %5 to double
%7 = fsub double %3, %6
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dfloor(double %0) {
%2 = tail call i64 @mod(double %0, i32 1)
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fptosi double %4 to i32
ret i32 %5
}
int cg_calculate_offset_stmtlist(struct NStmtList *stmtlist) {
  static float sf4;
  static int s4;
  static unsigned int u4;
  static short int s2;
  static unsigned short int u2;
  static unsigned char u1;
}


x86 assembly (clang, -O0):
<cg_calculate_offset_stmtlist>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.NStmtList = type opaque
@cg_calculate_offset_stmtlist.sf4 = internal global float 0.000000e+00
@cg_calculate_offset_stmtlist.s4 = internal global i32 0
@cg_calculate_offset_stmtlist.u4 = internal global i32 0
@cg_calculate_offset_stmtlist.s2 = internal global i16 0
@cg_calculate_offset_stmtlist.u2 = internal global i16 0
@cg_calculate_offset_stmtlist.u1 = internal global i8 0
define i32 @cg_calculate_offset_stmtlist(%struct.NStmtList* %0) {
%2 = alloca i32
%3 = alloca %struct.NStmtList*
store %struct.NStmtList* %0, %struct.NStmtList** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.NStmtList = type opaque
define i32 @cg_calculate_offset_stmtlist(%struct.NStmtList* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int8_t add_all_int8(int8_t a, int8_t b, int8_t c, int8_t d, int8_t e, int8_t f,
                    int8_t g, int8_t h, int8_t i, int8_t j) {
  return a + b + c + d + e + f + g + h + i + j;
}


x86 assembly (clang, -O0):
<add_all_int8>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
add    -0x30(%rbp),%rax
add    0x10(%rbp),%rax
add    0x18(%rbp),%rax
add    0x20(%rbp),%rax
add    0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_all_int8>:
lea    (%rdi,%rsi,1),%rax
add    %rdx,%rax
add    %rcx,%rax
add    %r8,%rax
add    %r9,%rax
add    0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    0x18(%rsp),%rax
add    0x20(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @add_all_int8(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
store i64 %0, i64* %11
store i64 %1, i64* %12
store i64 %2, i64* %13
store i64 %3, i64* %14
store i64 %4, i64* %15
store i64 %5, i64* %16
store i64 %6, i64* %17
store i64 %7, i64* %18
store i64 %8, i64* %19
store i64 %9, i64* %20
%21 = load i64, i64* %11
%22 = load i64, i64* %12
%23 = add nsw i64 %21, %22
%24 = load i64, i64* %13
%25 = add nsw i64 %23, %24
%26 = load i64, i64* %14
%27 = add nsw i64 %25, %26
%28 = load i64, i64* %15
%29 = add nsw i64 %27, %28
%30 = load i64, i64* %16
%31 = add nsw i64 %29, %30
%32 = load i64, i64* %17
%33 = add nsw i64 %31, %32
%34 = load i64, i64* %18
%35 = add nsw i64 %33, %34
%36 = load i64, i64* %19
%37 = add nsw i64 %35, %36
%38 = load i64, i64* %20
%39 = add nsw i64 %37, %38
ret i64 %39
}

LLVM IR (-O2):
define i64 @add_all_int8(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = add nsw i64 %1, %0
%12 = add nsw i64 %11, %2
%13 = add nsw i64 %12, %3
%14 = add nsw i64 %13, %4
%15 = add nsw i64 %14, %5
%16 = add nsw i64 %15, %6
%17 = add nsw i64 %16, %7
%18 = add nsw i64 %17, %8
%19 = add nsw i64 %18, %9
ret i64 %19
}
/* Variables and functions */
char *gets(char *);
int strlen(char *);
int getline(register char *s, int lim) {
  char *p;
  p = gets(s);
  p[lim] = '\0';
  return strlen(p);
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <gets@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
push   %rbx
mov    %esi,%ebx
call   1040 <gets@plt>
movslq %ebx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @getline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i8* @gets(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @getline(i8* %0, i32 %1) {
%3 = tail call i8* @gets(i8* %0)
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %3, i64 %4
store i8 0, i8* %5
%6 = tail call i32 @strlen(i8* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int foo(void) {
  printf("foo()\n");
  return 2;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"foo()\00"
define i32 @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ signal_pidfile(int, char *);
int /*<<< orphan*/ uwsgi_exit(int /*<<< orphan*/);
void uwsgi_opt_pidfile_signal(char *opt, char *pidfile, void *sig) {
  long *signum_fake_ptr = (long *)sig;
  int signum = (long)signum_fake_ptr;
  uwsgi_exit(signal_pidfile(signum, pidfile));
}


x86 assembly (clang, -O0):
<uwsgi_opt_pidfile_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <signal_pidfile@plt>
mov    %eax,%edi
call   1040 <uwsgi_exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_opt_pidfile_signal>:
push   %rax
mov    %rdx,%rdi
call   1030 <signal_pidfile@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <uwsgi_exit@plt>

LLVM IR (-O0):
define void @uwsgi_opt_pidfile_signal(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %7
%11 = load i64*, i64** %7
%12 = ptrtoint i64* %11 to i64
%13 = trunc i64 %12 to i32
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = load i8*, i8** %5
%16 = call i32 @signal_pidfile(i32 %14, i8* %15)
%17 = call i32 @uwsgi_exit(i32 %16)
ret void
}

LLVM IR (-O2):
define void @uwsgi_opt_pidfile_signal(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @signal_pidfile(i32 %5, i8* %1)
%7 = tail call i32 @uwsgi_exit(i32 %6)
ret void
}
int ChkAesIvLen(unsigned long len) { return len != 0 && len != 16 ? (0) : (1); }


x86 assembly (clang, -O0):
<ChkAesIvLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <ChkAesIvLen+0x23>
cmpq   $0x10,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkAesIvLen>:
xor    %eax,%eax
test   $0xffffffffffffffef,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @ChkAesIvLen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 16
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @ChkAesIvLen(i64 %0) {
%2 = and i64 %0, -17
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(void const *, void const *);
int compare_fn_str(const void *obj, const void *obj1) {
  return strcmp(obj, obj1);
}


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

x86 assembly (clang, -O2):
<compare_fn_str>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_fn_str(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 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @compare_fn_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int TIOCM_CTS;
int modem_ioctl(int /*<<< orphan*/, int /*<<< orphan*/);
int tty_cts(void) { return !!(modem_ioctl(TIOCMGET, 0) & TIOCM_CTS); }


x86 assembly (clang, -O0):
<tty_cts>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <modem_ioctl@plt>
mov    0x2ead(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_cts>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <modem_ioctl@plt>
mov    0x2eb0(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@TIOCM_CTS = global i32 0
define i32 @tty_cts() {
%1 = load i32, i32* @TIOCMGET
%2 = call i32 @modem_ioctl(i32 %1, i32 0)
%3 = load i32, i32* @TIOCM_CTS
%4 = and i32 %2, %3
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@TIOCM_CTS = global i32 0
define i32 @tty_cts() {
%1 = load i32, i32* @TIOCMGET
%2 = tail call i32 @modem_ioctl(i32 %1, i32 0)
%3 = load i32, i32* @TIOCM_CTS
%4 = and i32 %3, %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_to_montgomery(uintptr_t, uintptr_t);
void fiat_p384_to_montgomery(uint32_t out1[12], const uint32_t arg1[12]) {
  internal_fiat_p384_to_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_to_montgomery>:
jmp    1030 <internal_fiat_p384_to_montgomery@plt>

LLVM IR (-O0):
define void @fiat_p384_to_montgomery(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p384_to_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_to_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p384_to_montgomery(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main(int argc, char *argv[]) {
  test1();
  test2();
  printf("end of the program...\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1050 <test2@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"end of the program...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test1()
%7 = call i32 (...) @test2()
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"end of the program...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test1()
%4 = tail call i32 (...) @test2()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct struct_automata {
  int dummy;
};

/* Variables and functions */
int *__func_in_stat(struct struct_automata *, char *, char *);
int *_func_in_stat(struct struct_automata *);
int *func_in_stat(struct struct_automata *p, char *s) {
  static char stat_buf[128];
  return !s ? _func_in_stat(p) : __func_in_stat(p, s, stat_buf);
}


x86 assembly (clang, -O0):
<func_in_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <func_in_stat+0x2d>
mov    -0x8(%rbp),%rdi
call   1040 <_func_in_stat@plt>
mov    %rax,-0x18(%rbp)
jmp    1165 <func_in_stat+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2ee4(%rip),%rdx
call   1030 <__func_in_stat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_in_stat>:
test   %rsi,%rsi
je     1131 <func_in_stat+0x11>
lea    0x2f14(%rip),%rdx
jmp    1030 <__func_in_stat@plt>
jmp    1040 <_func_in_stat@plt>

LLVM IR (-O0):
%struct.struct_automata = type { i32 }
@func_in_stat.stat_buf = internal global [128 x i8] zeroinitializer
define i32* @func_in_stat(%struct.struct_automata* %0, i8* %1) {
%3 = alloca %struct.struct_automata*
%4 = alloca i8*
store %struct.struct_automata* %0, %struct.struct_automata** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load %struct.struct_automata*, %struct.struct_automata** %3
%9 = call i32* @_func_in_stat(%struct.struct_automata* %8)
br label %14
10: ; preds = %2
%11 = load %struct.struct_automata*, %struct.struct_automata** %3
%12 = load i8*, i8** %4
%13 = call i32* @__func_in_stat(%struct.struct_automata* %11, i8* %12, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @func_in_stat.stat_buf, i64 0, i64 0))
br label %14
14: ; preds = %10, %7
%15 = phi i32* [ %9, %7 ], [ %13, %10 ]
ret i32* %15
}

LLVM IR (-O2):
%struct.struct_automata = type { i32 }
@func_in_stat.stat_buf = internal global [128 x i8] zeroinitializer
define i32* @func_in_stat(%struct.struct_automata* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32* @_func_in_stat(%struct.struct_automata* %0)
br label %8
6: ; preds = %2
%7 = tail call i32* @__func_in_stat(%struct.struct_automata* %0, i8* %1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @func_in_stat.stat_buf, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32* [ %5, %4 ], [ %7, %6 ]
ret i32* %9
}
/* Variables and functions */
bool nrf51_errata_47(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_47() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int const);
void set_42(const int on) { gpio_set(42, on); }


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

x86 assembly (clang, -O2):
<set_42>:
mov    %edi,%esi
mov    $0x2a,%edi
jmp    1030 <gpio_set@plt>

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

LLVM IR (-O2):
define void @set_42(i32 %0) {
%2 = tail call i32 @gpio_set(i32 42, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x1b() {
  Assert_real((ispunct(27) == 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_ispunct.c",
              140, ("ispunct should be 0 for 0x1b"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x1b>:
push   %rax
mov    $0x1b,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x8c,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x1b\00"
define void @t_ispunct_0x1b() {
%1 = call i64 @ispunct(i32 27)
%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 140, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x1b\00"
define void @t_ispunct_0x1b() {
%1 = tail call i64 @ispunct(i32 27)
%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 140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void __attribute__((
    warning("curl_easy_getinfo expects a pointer to long for this info")))
__attribute__((unused)) __attribute__((no)) _curl_easy_getinfo_err_long(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_getinfo_err_long() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ abort();
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int getttime(struct timespec *ttp, int abort_on_fail) {
  if (clock_gettime(CLOCK_MONOTONIC, ttp) == -1) {
    if (abort_on_fail)
      abort();
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<getttime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1040 <clock_gettime@plt>
cmp    $0xffffffff,%eax
jne    1167 <getttime+0x47>
cmpl   $0x0,-0x14(%rbp)
je     115b <getttime+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <getttime+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getttime>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1040 <clock_gettime@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
jne    1146 <getttime+0x26>
mov    $0xffffffff,%eax
test   %ebx,%ebx
jne    1148 <getttime+0x28>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @getttime(%struct.timespec* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
%5 = alloca i32
store %struct.timespec* %0, %struct.timespec** %4
store i32 %1, i32* %5
%6 = load i32, i32* @CLOCK_MONOTONIC
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @clock_gettime(i32 %6, %struct.timespec* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
store i32 -1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @getttime(%struct.timespec* %0, i32 %1) {
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = tail call i32 @clock_gettime(i32 %3, %struct.timespec* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %2, %6
%11 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %11
}
unsigned int hash_string(const void *data, unsigned int size) {
  const char *s = data;
  unsigned int n = 0;
  unsigned int j = 0;
  unsigned int i = 0;
  while (*s) {
    j++;
    n ^= 271 * (unsigned)*s++;
  }
  i = n ^ (j * 271);
  return i % size;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <hash_string+0x61>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
imul   $0x10f,%eax,%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1128 <hash_string+0x28>
mov    -0x1c(%rbp),%eax
imul   $0x10f,-0x20(%rbp),%ecx
xor    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <hash_string+0x2f>
add    $0x1,%rdi
xor    %eax,%eax
xor    %edx,%edx
xchg   %ax,%ax
movsbl %cl,%ecx
imul   $0x10f,%ecx,%ecx
xor    %ecx,%edx
movzbl (%rdi),%ecx
add    $0x10f,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
xor    %edx,%eax
jmp    1131 <hash_string+0x31>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %15, %5 ], [ %3, %2 ]
%7 = phi i32 [ %10, %5 ], [ 0, %2 ]
%8 = phi i32 [ %14, %5 ], [ 0, %2 ]
%9 = phi i8* [ %11, %5 ], [ %0, %2 ]
%10 = add i32 %7, 1
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = sext i8 %6 to i32
%13 = mul nsw i32 %12, 271
%14 = xor i32 %13, %8
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5
%18 = mul i32 %10, 271
%19 = xor i32 %18, %14
br label %20
20: ; preds = %17, %2
%21 = phi i32 [ %19, %17 ], [ 0, %2 ]
%22 = urem i32 %21, %1
ret i32 %22
}
void lower(char string[], int position) {
  if (string[position] < 'Z' && string[position] > 'A') {
    string[position] -= 'A';
    string[position] += 'a';
  }
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jge    1159 <lower+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jle    1159 <lower+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
sub    $0x41,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0x61,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%cl
lea    -0x42(%rcx),%edx
cmp    $0x17,%dl
ja     1114 <lower+0x14>
add    $0x20,%cl
mov    %cl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @lower(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %10, 90
br i1 %11, label %12, label %37
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%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 sgt i32 %18, 65
br i1 %19, label %20, label %37
20: ; preds = %12
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = trunc i32 %27 to i8
store i8 %28, i8* %24
%29 = load i8*, i8** %3
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = add nsw i32 %34, 97
%36 = trunc i32 %35 to i8
store i8 %36, i8* %32
br label %37
37: ; preds = %20, %12, %2
ret void
}

LLVM IR (-O2):
define void @lower(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = add i8 %5, -66
%7 = icmp ult i8 %6, 24
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = add nuw nsw i8 %5, 32
store i8 %9, i8* %4
br label %10
10: ; preds = %8, %2
ret void
}
/* Variables and functions */
int rand();
char ranchr() {
  char ch;
  do {
    ch = rand() % 0x7A;
  } while (ch < 0x20);
  return ch;
}


x86 assembly (clang, -O0):
<ranchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7a,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     1118 <ranchr+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranchr>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x4325c53f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x7a,%ecx,%ecx
sub    %ecx,%eax
cmp    $0x20,%eax
jl     1120 <ranchr+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @ranchr() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 122
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
br label %6
6: ; preds = %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %8, 32
br i1 %9, label %2, label %10
10: ; preds = %6
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @ranchr() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 122
%4 = icmp slt i32 %3, 32
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = trunc i32 %3 to i8
ret i8 %6
}
long daysepoch_to_unixtime(int epoch) { return epoch * 86400; }


x86 assembly (clang, -O0):
<daysepoch_to_unixtime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x15180,-0x4(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<daysepoch_to_unixtime>:
imul   $0x15180,%edi,%eax
cltq
ret

LLVM IR (-O0):
define i64 @daysepoch_to_unixtime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 86400
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @daysepoch_to_unixtime(i32 %0) {
%2 = mul nsw i32 %0, 86400
%3 = sext i32 %2 to i64
ret i64 %3
}
void mdump(int start, int end) {}


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

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

LLVM IR (-O0):
define void @mdump(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @mdump(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ length(int *);
int isEmpty(int arr[]) {
  if (length(arr) == 0)
    return 1;
  return 0;
}


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

x86 assembly (clang, -O2):
<isEmpty>:
push   %rax
call   1030 <length@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isEmpty(i32* %0) {
%2 = tail call i64 @length(i32* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void unset_pawn(char *p) { *p &= ~(1 << 0); }


x86 assembly (clang, -O0):
<unset_pawn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unset_pawn>:
andb   $0xfe,(%rdi)
ret

LLVM IR (-O0):
define void @unset_pawn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -2
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @unset_pawn(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -2
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ printf(char *);
int main(void) {
  func();
  printf("main\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (...) @func()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double pow(double, int);
double calc_with_pow(double x) { return pow(x, 5); }


x86 assembly (clang, -O0):
<calc_with_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_with_pow>:
mov    $0x5,%edi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @calc_with_pow(double %0) {
%2 = tail call double @pow(double %0, i32 5)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ extra();
int main(void) {
  extra();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @extra()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @extra()
ret i32 0
}
unsigned char _rotr(const unsigned char value, int shift) {
  if ((shift &= sizeof(value) * 8 - 1) == 0)
    return value;
  return (value >> shift) | (value << (sizeof(value) * 8 - shift));
}


x86 assembly (clang, -O0):
<_rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
and    $0x7,%rax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    112c <_rotr+0x2c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    114e <_rotr+0x4e>
movzbl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0x2(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x8,%ecx
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rotr>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
test   $0x7,%cl
movzbl %al,%eax
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @_rotr(i8 zeroext %0, i32 %1) {
%3 = and i32 %1, 7
%4 = icmp eq i32 %3, 0
%5 = trunc i32 %1 to i8
%6 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %5)
%7 = select i1 %4, i8 %0, i8 %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ hello();
void main() { hello(); }


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @hello()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @hello()
ret void
}
int do_136() { return 136; }


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

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

LLVM IR (-O0):
define i32 @do_136() {
ret i32 136
}

LLVM IR (-O2):
define i32 @do_136() {
ret i32 136
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t get_uint24_be(unsigned char *buf) {
  return ((buf[0] << 16) | (buf[1] << 8) | buf[2]);
}


x86 assembly (clang, -O0):
<get_uint24_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint24_be>:
mov    0x2(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_uint24_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 16
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %13, %17
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @get_uint24_be(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
ret i8 %3
}
int test_imm_BBuint32_mem(unsigned int *val) {
  return ((*val) & (0xBB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BBuint32_mem>:
testb  $0xbb,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BBuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 187
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rop3_2_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_2_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_2_0_0>:
or     %edx,%esi
not    %sil
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_2_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = and i8 %6, %5
store i8 %7, i8* %0
ret void
}
OP(ed, bd) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int sethostid(long int id) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<sethostid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sethostid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sethostid(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sethostid(i64 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}