xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_mov_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "MOV   A, "
          "0x%02X"
          "                   ",
          direct);
}


x86 assembly (clang, -O0):
<fprint_mov_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"MOV A, 0x%02X \00"
define void @fprint_mov_direct(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 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"MOV A, 0x%02X \00"
define void @fprint_mov_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
unsigned xrop3_168_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_168_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_168_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %edi,%esi
not    %eax
and    %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_168_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_168_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nUsage: ./firmware <gb-fw-mgmt-X (default: gb-fw-mgmt-0)> "
         "<interface: 0, backend: 1 (default: 0)> <firmware-tag> (default: "
         "\"s3f\"/\"bf_01\") <timeout (default: 10000 ms)>\n");
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"\0AUsage: ./firmware <gb-fw-mgmt-X (default: gb-fw-mgmt-0)> <interface: 0, backend: 1 (default: 0)> <firmware-tag> (default: \22s3f\22/\22bf_01\22) <timeout (default: 10000 ms)>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [168 x i8] c"\0AUsage: ./firmware <gb-fw-mgmt-X (default: gb-fw-mgmt-0)> <interface: 0, backend: 1 (default: 0)> <firmware-tag> (default: \22s3f\22/\22bf_01\22) <timeout (default: 10000 ms)>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([168 x i8], [168 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { kill(getpid(), SIGSEGV); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGSEGV = global i32 0
define i32 @main() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGSEGV
%3 = call i32 @kill(i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGSEGV
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
void disableLCDBackLight(void) {
  (*(volatile unsigned int *)(0x7F0080A4)) &= ~(1 << 14);
  return;
}


x86 assembly (clang, -O0):
<disableLCDBackLight>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f0080a4,%eax
mov    (%rax),%ecx
and    $0xffffbfff,%ecx
mov    $0x7f0080a4,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disableLCDBackLight>:
andl   $0xffffbfff,0x7f0080a4
ff bf ff ff
ret

LLVM IR (-O0):
define void @disableLCDBackLight() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = and i32 %1, -16385
store volatile i32 %2, i32* inttoptr (i64 2130739364 to i32*)
ret void
}

LLVM IR (-O2):
define void @disableLCDBackLight() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = and i32 %1, -16385
store volatile i32 %2, i32* inttoptr (i64 2130739364 to i32*)
ret void
}
/* Variables and functions */
int MAP_ANONYMOUS;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
scalar_t__ errno;
int /*<<< orphan*/ mmap(int /*<<< orphan*/, int, int, int, int, int);
int main() {
  mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1,
       0x7fff0000LL * 0x1000);
  return errno != 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
mov    0x2e88(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9f(%rip),%rax
or     (%rax),%ecx
xor    %edi,%edi
mov    $0x1000,%esi
mov    $0xffffffff,%r8d
mov    $0xf0000000,%r9d
call   1030 <mmap@plt>
mov    0x2e6e(%rip),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ee0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e96(%rip),%rax
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %edi,%edi
mov    $0x1000,%esi
mov    $0xffffffff,%r8d
mov    $0xf0000000,%r9d
call   1030 <mmap@plt>
mov    0x2e7c(%rip),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
@errno = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %2, %3
%5 = load i32, i32* @MAP_PRIVATE
%6 = load i32, i32* @MAP_ANONYMOUS
%7 = or i32 %5, %6
%8 = call i32 @mmap(i32 0, i32 4096, i32 %4, i32 %7, i32 -1, i32 -268435456)
%9 = load i64, i64* @errno
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
@errno = global i64 0
define i32 @main() {
%1 = load i32, i32* @PROT_READ
%2 = load i32, i32* @PROT_WRITE
%3 = or i32 %2, %1
%4 = load i32, i32* @MAP_PRIVATE
%5 = load i32, i32* @MAP_ANONYMOUS
%6 = or i32 %5, %4
%7 = tail call i32 @mmap(i32 0, i32 4096, i32 %3, i32 %6, i32 -1, i32 -268435456)
%8 = load i64, i64* @errno
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ msg_print(char *);
scalar_t__ target_set(int);
void do_cmd_target(void) {
  if (target_set(0x01)) {
    msg_print("Target Selected.");
  } else {
    msg_print("Target Aborted.");
  }
}


x86 assembly (clang, -O0):
<do_cmd_target>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <target_set@plt>
cmp    $0x0,%rax
je     1149 <do_cmd_target+0x29>
lea    0xec1(%rip),%rdi
call   1040 <msg_print@plt>
jmp    1155 <do_cmd_target+0x35>
lea    0xec1(%rip),%rdi
call   1040 <msg_print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_target>:
push   %rax
mov    $0x1,%edi
call   1030 <target_set@plt>
test   %rax,%rax
lea    0xedc(%rip),%rax
lea    0xec4(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <msg_print@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Target Selected.\00"
@.str.1 = [16 x i8] c"Target Aborted.\00"
define void @do_cmd_target() {
%1 = call i64 @target_set(i32 1)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @msg_print(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @msg_print(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Target Selected.\00"
@.str.1 = [16 x i8] c"Target Aborted.\00"
define void @do_cmd_target() {
%1 = tail call i64 @target_set(i32 1)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @msg_print(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *, int);
int /*<<< orphan*/ stderr;
int one_out(int expr, int linenum, char *rev) {
  fprintf(stderr, "%d: %s ERROR(%d)!\n", linenum, rev, expr);
  return 1;
}


x86 assembly (clang, -O0):
<one_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%r8d
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_out>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%r8d
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"%d: %s ERROR(%d)!\0A\00"
define i32 @one_out(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i32, i32* %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9, i32 %10)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"%d: %s ERROR(%d)!\0A\00"
define i32 @one_out(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i32 %0)
ret i32 1
}
void rop3_154_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_154_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 -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %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_154_0_0>:
not    %sil
and    %dl,%sil
xor    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_154_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x6d() {
  Assert_real((isodigit(109) == 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_isodigit.c",
              550, ("isodigit should be 0 for m"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x6d>:
push   %rax
mov    $0x6d,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x226,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for m\00"
define void @t_isodigit_0x6d() {
%1 = call i64 @isodigit(i32 109)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for m\00"
define void @t_isodigit_0x6d() {
%1 = tail call i64 @isodigit(i32 109)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void gt_abort(char *msg) {
  if (msg)
    fprintf(stderr, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<gt_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <gt_abort+0x29>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<gt_abort>:
push   %rax
test   %rdi,%rdi
je     1137 <gt_abort+0x17>
mov    %rdi,%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @gt_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* %7)
br label %9
9: ; preds = %5, %1
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @gt_abort(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* %0)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 @exit(i32 1)
unreachable
}
void Agent_delete(void *_self) {}


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

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

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

LLVM IR (-O2):
define void @Agent_delete(i8* nocapture %0) {
ret void
}
float sub_float(float arg1, float arg2) { return arg1 - arg2; }


x86 assembly (clang, -O0):
<sub_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_float>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sub_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @sub_float(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ di();
void opcode_f3() { di(); }


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

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

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

LLVM IR (-O2):
define void @opcode_f3() {
%1 = tail call i32 (...) @di()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exxit(int);
int /*<<< orphan*/ puts(char *);
void EOF_error() {
  puts("\n\nERROR: Unexpected end-of-file.\n");
  exxit(-1);
}


x86 assembly (clang, -O0):
<EOF_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exxit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"\0A\0AERROR: Unexpected end-of-file.\0A\00"
define void @EOF_error() {
%1 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exxit(i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A\0AERROR: Unexpected end-of-file.\0A\00"
define void @EOF_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exxit(i32 -1)
ret void
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
int sem_wait(int semid, int sem_num, int val) {
  struct sembuf op;
  op.sem_num = sem_num;
  op.sem_op = -val;
  op.sem_flg = 0;
  semop(semid, &op, 1);
}


x86 assembly (clang, -O0):
<sem_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_wait>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
neg    %edx
mov    %edx,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define i32 @sem_wait(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sembuf
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %8, i32 0, i32 0
store i32 %9, i32* %10
%11 = load i32, i32* %7
%12 = sub nsw i32 0, %11
%13 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %8, i32 0, i32 1
store i32 %12, i32* %13
%14 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %8, i32 0, i32 2
store i64 0, i64* %14
%15 = load i32, i32* %5
%16 = call i32 @semop(i32 %15, %struct.sembuf* %8, i32 1)
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define i32 @sem_wait(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.sembuf
%5 = bitcast %struct.sembuf* %4 to i8*
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 0
store i32 %1, i32* %6
%7 = sub nsw i32 0, %2
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 2
store i64 0, i64* %9
%10 = call i32 @semop(i32 %0, %struct.sembuf* %4, i32 1)
ret i32 undef
}
/* Type definitions */
struct mesh_var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ line_border_cond(struct mesh_var *, int const, int, int);
scalar_t__ line_mesh(struct mesh_var *, int const);
void free_1D_mesh(struct mesh_var *mv) {
  const int n_a = 0;
  if (line_mesh(mv, n_a) == 0)
    exit(5);
  line_border_cond(mv, n_a, -3, -3);
}


x86 assembly (clang, -O0):
<free_1D_mesh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <line_mesh@plt>
cmp    $0x0,%rax
jne    1162 <free_1D_mesh+0x32>
mov    $0x5,%edi
call   1030 <exit@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xfffffffd,%ecx
mov    %ecx,%edx
call   1040 <line_border_cond@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_1D_mesh>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1050 <line_mesh@plt>
test   %rax,%rax
je     1155 <free_1D_mesh+0x25>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xfffffffd,%edx
mov    $0xfffffffd,%ecx
pop    %rbx
jmp    1040 <line_border_cond@plt>
mov    $0x5,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.mesh_var = type { i32 }
define void @free_1D_mesh(%struct.mesh_var* %0) {
%2 = alloca %struct.mesh_var*
%3 = alloca i32
store %struct.mesh_var* %0, %struct.mesh_var** %2
store i32 0, i32* %3
%4 = load %struct.mesh_var*, %struct.mesh_var** %2
%5 = call i64 @line_mesh(%struct.mesh_var* %4, i32 0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 5)
unreachable
9: ; preds = %1
%10 = load %struct.mesh_var*, %struct.mesh_var** %2
%11 = call i32 @line_border_cond(%struct.mesh_var* %10, i32 0, i32 -3, i32 -3)
ret void
}

LLVM IR (-O2):
%struct.mesh_var = type { i32 }
define void @free_1D_mesh(%struct.mesh_var* %0) {
%2 = tail call i64 @line_mesh(%struct.mesh_var* %0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 5)
unreachable
6: ; preds = %1
%7 = tail call i32 @line_border_cond(%struct.mesh_var* %0, i32 0, i32 -3, i32 -3)
ret void
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
int rolled_over(__u32 c0, __u32 c1) {
  return (c0 >> 25) == 127 && (c1 >> 25) == 0 &&
         (c0 >> 12 & 0x1fff) > 8000 - 3 && (c1 >> 12 & 0x1fff) < 0000 + 3;
}


x86 assembly (clang, -O0):
<rolled_over>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x19,%ecx
xor    %eax,%eax
cmp    $0x7f,%ecx
mov    %al,-0x9(%rbp)
jne    1163 <rolled_over+0x63>
mov    -0x8(%rbp),%ecx
sar    $0x19,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1163 <rolled_over+0x63>
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
and    $0x1fff,%ecx
xor    %eax,%eax
cmp    $0x1f3d,%ecx
mov    %al,-0x9(%rbp)
jle    1163 <rolled_over+0x63>
mov    -0x8(%rbp),%eax
sar    $0xc,%eax
and    $0x1fff,%eax
cmp    $0x3,%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rolled_over(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 = ashr i32 %5, 25
%7 = icmp eq i32 %6, 127
br i1 %7, label %8, label %22
8: ; preds = %2
%9 = load i32, i32* %4
%10 = ashr i32 %9, 25
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %3
%14 = ashr i32 %13, 12
%15 = and i32 %14, 8191
%16 = icmp sgt i32 %15, 7997
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = load i32, i32* %4
%19 = ashr i32 %18, 12
%20 = and i32 %19, 8191
%21 = icmp slt i32 %20, 3
br label %22
22: ; preds = %17, %12, %8, %2
%23 = phi i1 [ false, %12 ], [ false, %8 ], [ false, %2 ], [ %21, %17 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @rolled_over(i32 %0, i32 %1) {
ret i32 0
}
int ubj_is_bigendian() {
  int i = 1;
  char *low = (char *)&i;
  return *low ? 0 : 1;
}


x86 assembly (clang, -O0):
<ubj_is_bigendian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ubj_is_bigendian() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @ubj_is_bigendian() {
ret i32 0
}
int shift_funktion3(int var, int shift) {
  int erg;
  erg = (var << shift);
  return erg;
}


x86 assembly (clang, -O0):
<shift_funktion3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_funktion3>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @shift_funktion3(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct device_node {
  int dummy;
};

/* Variables and functions */
int of_count_phandle_with_args(struct device_node *, char const *, char *);
int of_gpio_named_count(struct device_node *np, const char *propname) {
  return of_count_phandle_with_args(np, propname, "#gpio-cells");
}


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

x86 assembly (clang, -O2):
<of_gpio_named_count>:
lea    0xee9(%rip),%rdx
jmp    1030 <of_count_phandle_with_args@plt>

LLVM IR (-O0):
%struct.device_node = type { i32 }
@.str = [12 x i8] c"#gpio-cells\00"
define i32 @of_gpio_named_count(%struct.device_node* %0, i8* %1) {
%3 = alloca %struct.device_node*
%4 = alloca i8*
store %struct.device_node* %0, %struct.device_node** %3
store i8* %1, i8** %4
%5 = load %struct.device_node*, %struct.device_node** %3
%6 = load i8*, i8** %4
%7 = call i32 @of_count_phandle_with_args(%struct.device_node* %5, i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.device_node = type { i32 }
@.str = [12 x i8] c"#gpio-cells\00"
define i32 @of_gpio_named_count(%struct.device_node* %0, i8* %1) {
%3 = tail call i32 @of_count_phandle_with_args(%struct.device_node* %0, i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
void expires_gettime(void) {}


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

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

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

LLVM IR (-O2):
define void @expires_gettime() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int gettag(int);
int /*<<< orphan*/ lua_pushusertag(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ setfile(int /*<<< orphan*/ *, char *, int);
void setreturn(FILE *f, char *name) {
  int tag = gettag(1);
  setfile(f, name, tag);
  lua_pushusertag(f, tag);
}


x86 assembly (clang, -O0):
<setreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1050 <gettag@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <setfile@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <lua_pushusertag@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setreturn>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%edi
call   1050 <gettag@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <setfile@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <lua_pushusertag@plt>

LLVM IR (-O0):
define void @setreturn(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = call i32 @gettag(i32 1)
store i32 %6, i32* %5
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @setfile(i32* %7, i8* %8, i32 %9)
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = call i32 @lua_pushusertag(i32* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @setreturn(i32* %0, i8* %1) {
%3 = tail call i32 @gettag(i32 1)
%4 = tail call i32 @setfile(i32* %0, i8* %1, i32 %3)
%5 = tail call i32 @lua_pushusertag(i32* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage:  %s <filename>\n\n", "prep");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xedd(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xee0(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <filename>\0A\0A\00"
@.str.1 = [5 x i8] c"prep\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <filename>\0A\0A\00"
@.str.1 = [5 x i8] c"prep\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_get_tid(void *b, pid_t *tid) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_get_tid>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_get_tid(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_get_tid(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ reverse_argv_elements(char **, int);
void permute(char *const argv[], int len1, int len2) {
  reverse_argv_elements((char **)argv, len1);
  reverse_argv_elements((char **)argv, len1 + len2);
  reverse_argv_elements((char **)argv, len2);
}


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

x86 assembly (clang, -O2):
<permute>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <reverse_argv_elements@plt>
add    %r14d,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <reverse_argv_elements@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <reverse_argv_elements@plt>

LLVM IR (-O0):
define void @permute(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 = load i8**, i8*** %4
%8 = load i32, i32* %5
%9 = call i32 @reverse_argv_elements(i8** %7, i32 %8)
%10 = load i8**, i8*** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = call i32 @reverse_argv_elements(i8** %10, i32 %13)
%15 = load i8**, i8*** %4
%16 = load i32, i32* %6
%17 = call i32 @reverse_argv_elements(i8** %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @permute(i8** %0, i32 %1, i32 %2) {
%4 = tail call i32 @reverse_argv_elements(i8** %0, i32 %1)
%5 = add nsw i32 %2, %1
%6 = tail call i32 @reverse_argv_elements(i8** %0, i32 %5)
%7 = tail call i32 @reverse_argv_elements(i8** %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_convert_dmatrix(double **b, long nrl, long nrh, long ncl, long nch) {
  free((char *)(b + nrl - 1));
}


x86 assembly (clang, -O0):
<free_convert_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_convert_dmatrix>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_convert_dmatrix(double** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca double**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store double** %0, double*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load double**, double*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds double*, double** %11, i64 %12
%14 = getelementptr inbounds double*, double** %13, i64 -1
%15 = bitcast double** %14 to i8*
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @free_convert_dmatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = getelementptr inbounds double*, double** %6, i64 -1
%8 = bitcast double** %7 to i8*
%9 = tail call i32 @free(i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int file_exists(const char *path) { return access(path, R_OK) == 0; }


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@R_OK = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @R_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@R_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @R_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned long addHashToHash(unsigned long hash, const char *key,
                            unsigned long val) {
  return 0;
}


x86 assembly (clang, -O0):
<addHashToHash>:
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):
<addHashToHash>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @addHashToHash(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i64 0
}

LLVM IR (-O2):
define i64 @addHashToHash(i64 %0, i8* nocapture readnone %1, i64 %2) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *s) {
  fprintf(stderr,
          "%s: <gen>\n"
          "     gen:     gen to generate for (6,7,8,9)\n",
          s);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"%s: <gen>\0A gen: gen to generate for (6,7,8,9)\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"%s: <gen>\0A gen: gen to generate for (6,7,8,9)\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int d29(int);
int d30(int a) { return d29(d29(a)); }


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

x86 assembly (clang, -O2):
<d30>:
push   %rax
call   1030 <d29@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d29@plt>

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

LLVM IR (-O2):
define i32 @d30(i32 %0) {
%2 = tail call i32 @d29(i32 %0)
%3 = tail call i32 @d29(i32 %2)
ret i32 %3
}
void scfetab_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @scfetab_dummy() {
ret void
}
/* Variables and functions */
char *__get_curdir();
int /*<<< orphan*/ strcpy(char *, char *);
char *getwd(char *buffer) {
  if (buffer == 0)
    return 0;
  char *p = __get_curdir();
  strcpy(buffer, p);
  return buffer;
}


x86 assembly (clang, -O0):
<getwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <getwd+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1164 <getwd+0x44>
mov    $0x0,%al
call   1040 <__get_curdir@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getwd>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     113b <getwd+0x1b>
xor    %eax,%eax
call   1040 <__get_curdir@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getwd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %14
8: ; preds = %1
%9 = call i8* (...) @__get_curdir()
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %8, %7
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @getwd(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* (...) @__get_curdir()
%5 = tail call i32 @strcpy(i8* %0, i8* %4)
br label %6
6: ; preds = %1, %3
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *concatenate_fname(char *, char const *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
FILE *generate_trace_file(const char *rng_name) {
  char *fname = concatenate_fname("./traces/", rng_name, "_trace.txt");
  FILE *f_out = fopen(fname, "w");
  free(fname);
  return f_out;
}


x86 assembly (clang, -O0):
<generate_trace_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
lea    0xebc(%rip),%rdx
call   1050 <concatenate_fname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_trace_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
lea    0xec5(%rip),%rdx
call   1050 <concatenate_fname@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rsi
mov    %rax,%rdi
call   1040 <fopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"./traces/\00"
@.str.1 = [11 x i8] c"_trace.txt\00"
@.str.2 = [2 x i8] c"w\00"
define i32* @generate_trace_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @concatenate_fname(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %8, i32** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i32*, i32** %4
ret i32* %11
}

LLVM IR (-O2):
@.str = [10 x i8] c"./traces/\00"
@.str.1 = [11 x i8] c"_trace.txt\00"
@.str.2 = [2 x i8] c"w\00"
define noalias i32* @generate_trace_file(i8* %0) {
%2 = tail call i8* @concatenate_fname(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
ret i32* %3
}
int PDC_set_rows(rows)
int rows;
{}


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

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

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

LLVM IR (-O2):
define i32 @PDC_set_rows(i32 %0) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ Unix_MatchValidSerialDevice(char const *);
int SerialMatch(const char *name, const char *arg) {
  (arg = arg);
  return Unix_MatchValidSerialDevice(name) == 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<SerialMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Unix_MatchValidSerialDevice@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialMatch>:
push   %rax
call   1030 <Unix_MatchValidSerialDevice@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SerialMatch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @Unix_MatchValidSerialDevice(i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @SerialMatch(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i64 @Unix_MatchValidSerialDevice(i8* %0)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
void patchb_(ubasisid, vbasisid) int *ubasisid, *vbasisid;
{ patchbasis((long)*ubasisid, (long)*vbasisid); }


x86 assembly (clang, -O0):
<patchb_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rsi
mov    $0x0,%al
call   1030 <patchbasis@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<patchb_>:
movslq (%rdi),%rdi
movslq (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <patchbasis@plt>

LLVM IR (-O0):
define void @patchb_(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 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = call i32 (i64, i64, ...) bitcast (i32 (...)* @patchbasis to i32 (i64, i64, ...)*)(i64 %7, i64 %10)
ret void
}

LLVM IR (-O2):
define void @patchb_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @patchbasis to i32 (i64, i64, ...)*)(i64 %4, i64 %6)
ret void
}