xunge/DecIR huggingface dataset:
int SSD(int b, int n) {
  int total = 0;
  while (n > 0) {
    int next = (n % b);
    total += next * next;
    n /= b;
  }
  return total;
}


x86 assembly (clang, -O0):
<SSD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1143 <SSD+0x43>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1111 <SSD+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSD>:
test   %esi,%esi
jle    111f <SSD+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cltd
idiv   %edi
imul   %edx,%edx
add    %edx,%ecx
test   %eax,%eax
jg     1110 <SSD+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @SSD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %5
%18 = add nsw i32 %17, %16
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = sdiv i32 %20, %19
store i32 %21, i32* %4
br label %7
22: ; preds = %7
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @SSD(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ 0, %2 ]
%7 = srem i32 %5, %0
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
%10 = sdiv i32 %5, %0
%11 = icmp sgt i32 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int length = 0xffffffff;
  printf("%x %d %u\n", (length + 1), (length + 1), (length + 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"%x %d %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%x %d %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int strtol(char const *, char **, int);
bool __sql_integer_parse(const char **sql, int *integer) {
  char *p = NULL;
  *integer = strtol(*sql, &p, 10);
  if (*sql == p)
    return (0);
  *sql = p;
  return (1);
}


x86 assembly (clang, -O0):
<__sql_integer_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jne    1162 <__sql_integer_parse+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1174 <__sql_integer_parse+0x64>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sql_integer_parse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    (%rdi),%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%r14)
mov    (%rsp),%rax
cmp    %rax,(%rbx)
je     1148 <__sql_integer_parse+0x38>
mov    %rax,(%rbx)
mov    $0x1,%eax
jmp    114a <__sql_integer_parse+0x3a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__sql_integer_parse(i8** nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = load i8*, i8** %0
%6 = call i32 @strtol(i8* %5, i8** %3, i32 10)
store i32 %6, i32* %1
%7 = load i8*, i8** %0
%8 = load i8*, i8** %3
%9 = icmp eq i8* %7, %8
br i1 %9, label %11, label %10
10: ; preds = %2
store i8* %8, i8** %0
br label %11
11: ; preds = %2, %10
%12 = phi i32 [ 1, %10 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void terminate(int signum) {
  fprintf(stderr, "vlock: Terminated!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"vlock: Terminated!\0A\00"
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"vlock: Terminated!\0A\00"
define void @terminate(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ e_rti();
void e_rti_accu() { e_rti(); }


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

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

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

LLVM IR (-O2):
define void @e_rti_accu() {
%1 = tail call i32 (...) @e_rti()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_active_img(void) {
  mbus_remote_register_write(0x8, 0x16,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (5 << 9) | (6 << 5) | (16)));
  delay(200);
  mbus_remote_register_write(0x8, 0x1A,
                             ((0 << 13) | (6 << 9) | (6 << 5) | (16)));
  delay(200);
}


x86 assembly (clang, -O0):
<set_pmu_active_img>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x16,%esi
mov    $0xcad0,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x1a,%esi
mov    $0xcd0,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_active_img>:
push   %rax
mov    $0x8,%edi
mov    $0x16,%esi
mov    $0xcad0,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x8,%edi
mov    $0x1a,%esi
mov    $0xcd0,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_active_img() {
%1 = call i32 @mbus_remote_register_write(i32 8, i32 22, i32 51920)
%2 = call i32 @delay(i32 200)
%3 = call i32 @mbus_remote_register_write(i32 8, i32 26, i32 3280)
%4 = call i32 @delay(i32 200)
ret void
}

LLVM IR (-O2):
define void @set_pmu_active_img() {
%1 = tail call i32 @mbus_remote_register_write(i32 8, i32 22, i32 51920)
%2 = tail call i32 @delay(i32 200)
%3 = tail call i32 @mbus_remote_register_write(i32 8, i32 26, i32 3280)
%4 = tail call i32 @delay(i32 200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ square_ok(int);
int rank_mirror(int sq) {
  assert(square_ok(sq));
  return sq ^ 070;
}


x86 assembly (clang, -O0):
<rank_mirror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <square_ok@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
xor    $0x38,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rank_mirror>:
push   %rbx
mov    %edi,%ebx
call   1040 <square_ok@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    $0x38,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rank_mirror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @square_ok(i32 %3)
%5 = call i32 @assert(i32 %4)
%6 = load i32, i32* %2
%7 = xor i32 %6, 56
ret i32 %7
}

LLVM IR (-O2):
define i32 @rank_mirror(i32 %0) {
%2 = tail call i32 @square_ok(i32 %0)
%3 = tail call i32 @assert(i32 %2)
%4 = xor i32 %0, 56
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xdf() {
  Assert_real((isdigit(223) == 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_isdigit.c",
              1120, ("isdigit should be 0 for 0xdf"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xdf>:
push   %rax
mov    $0xdf,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x460,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xdf\00"
define void @t_isdigit_0xdf() {
%1 = call i64 @isdigit(i32 223)
%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 1120, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xdf\00"
define void @t_isdigit_0xdf() {
%1 = tail call i64 @isdigit(i32 223)
%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 1120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int PAPI_set_debug(int);
void papif_set_debug_(int *debug, int *check) {
  *check = PAPI_set_debug(*debug);
}


x86 assembly (clang, -O0):
<papif_set_debug_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_set_debug@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_set_debug_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_set_debug@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_set_debug_(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 = call i32 @PAPI_set_debug(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @papif_set_debug_(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_set_debug(i32 %3)
store i32 %4, i32* %1
ret void
}
int test_imm_59uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x59 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_59uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x59,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_59uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5832704
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void sca3000_register_ring_funcs(struct iio_dev *indio_dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @sca3000_register_ring_funcs(%struct.iio_dev* nocapture %0) {
ret void
}
char chabs(char n) {
  if (n < 0) {
    n *= -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<chabs>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jge    1121 <chabs+0x21>
movsbl -0x1(%rbp),%eax
imul   $0xffffffff,%eax,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chabs>:
mov    %edi,%ecx
sar    $0x7,%cl
lea    (%rdi,%rcx,1),%eax
xor    %cl,%al
ret

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

LLVM IR (-O2):
define signext i8 @chabs(i8 signext %0) {
%2 = tail call i8 @llvm.abs.i8(i8 %0, i1 false)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pathb;

/* Variables and functions */
char *getwd(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *getcwd(char path[], int size) {
  char pathb[1024];
  const char *rcode;
  if (size <= sizeof(pathb))
    return getwd(path);
  else {
    rcode = getwd(pathb);
    strncpy(path, pathb, sizeof(pathb));
    return (char *)rcode;
  }
}


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x400,%rax
ja     1154 <getcwd+0x34>
mov    -0x10(%rbp),%rdi
call   1040 <getwd@plt>
mov    %rax,-0x8(%rbp)
jmp    1187 <getcwd+0x67>
lea    -0x420(%rbp),%rdi
call   1040 <getwd@plt>
mov    %rax,-0x428(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
mov    -0x428(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rbx
cmp    $0x400,%esi
ja     114b <getcwd+0x2b>
mov    %rbx,%rdi
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <getwd@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <getwd@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
mov    %r15,%rax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @getcwd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [1024 x i8]
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = icmp ule i64 %9, 1024
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i8* @getwd(i8* %12)
store i8* %13, i8** %3
br label %21
14: ; preds = %2
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%16 = call i8* @getwd(i8* %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %4
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%19 = call i32 @strncpy(i8* %17, i8* %18, i32 1024)
%20 = load i8*, i8** %7
store i8* %20, i8** %3
br label %21
21: ; preds = %14, %11
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @getcwd(i8* %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp ult i32 %1, 1025
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i8* @getwd(i8* %0)
br label %11
8: ; preds = %2
%9 = call i8* @getwd(i8* %4)
%10 = call i32 @strncpy(i8* %0, i8* %4, i32 1024)
br label %11
11: ; preds = %8, %6
%12 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %12
}
void SobelYRow_SSE2() {}


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

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

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

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

/* Variables and functions */
int fnv_64a_buf(int *, int, int);
uint64_t hash_64(uint64_t val, unsigned int bits) {
  uint64_t hash =
      fnv_64a_buf(&val, sizeof(uint64_t), ((uint64_t)0xcbf29ce484222325ULL));
  return hash & ((1 << bits) - 1);
}


x86 assembly (clang, -O0):
<hash_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x84222325,%edx
call   1030 <fnv_64a_buf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_64>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x84222325,%edx
call   1030 <fnv_64a_buf@plt>
mov    $0xffffffff,%edx
mov    %ebx,%ecx
shl    %cl,%edx
not    %edx
and    %edx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash_64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @fnv_64a_buf(i32* %3, i32 4, i32 -2078137563)
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
%11 = and i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @hash_64(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fnv_64a_buf(i32* %3, i32 4, i32 -2078137563)
%5 = shl nsw i32 -1, %1
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
ret i32 %7
}
int test_imm_0Fuint8_reg(unsigned char val) {
  return ((val) & (-0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xfffffff1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Fuint8_reg>:
test   $0xf1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Fuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -15
%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_0Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -15
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_put_error(char *str) {
  int i;
  i = -1;
  while (str && str[++i])
    ;
  write(2, str, i);
}


x86 assembly (clang, -O0):
<ft_put_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1150 <ft_put_error+0x40>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1160 <ft_put_error+0x50>
jmp    1165 <ft_put_error+0x55>
jmp    1123 <ft_put_error+0x13>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_put_error>:
mov    %rdi,%rsi
mov    $0xffffffff,%edx
test   %rdi,%rdi
je     112c <ft_put_error+0x1c>
mov    %rsi,%rax
add    $0x1,%edx
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1120 <ft_put_error+0x10>
mov    $0x2,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_put_error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ -1, %1 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
%13 = tail call i32 @write(i32 2, i8* %0, i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ port_lock();
void port_lock_from_isr(void) { port_lock(); }


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

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

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

LLVM IR (-O2):
define void @port_lock_from_isr() {
%1 = tail call i32 (...) @port_lock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(long, long);
void pcstore(long port, long value) { outb(value, port); }


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

x86 assembly (clang, -O2):
<pcstore>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @pcstore(i64 %0, i64 %1) {
%3 = tail call i32 @outb(i64 %1, i64 %0)
ret void
}
void INT_Excep_TPU0_TCI0V(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU0_TCI0V() {
ret void
}
void Cyc_Tcpat_not_exhaust_err2(unsigned loc, void *d) { ; }


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

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

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

LLVM IR (-O2):
define void @Cyc_Tcpat_not_exhaust_err2(i32 %0, i8* nocapture %1) {
ret void
}
int hash_name(name)
char *name;
{
  int i = 0;
  while (*name)
    i = (i << 1) ^ *name++;
  if (i < 0)
    i = -i;
  return i;
}


x86 assembly (clang, -O0):
<hash_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <hash_name+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_name+0xf>
cmpl   $0x0,-0xc(%rbp)
jge    1150 <hash_name+0x50>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_name>:
mov    (%rdi),%al
test   %al,%al
je     1124 <hash_name+0x24>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
add    %ecx,%ecx
movsbl %al,%eax
xor    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_name+0x10>
jmp    1126 <hash_name+0x26>
xor    %ecx,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
%16 = tail call i32 @llvm.abs.i32(i32 %15, i1 true)
ret i32 %16
}
char schr(int n) { return (char)(n % 128); }


x86 assembly (clang, -O0):
<schr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<schr>:
mov    %edi,%eax
lea    0x7f(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @schr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 128
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @schr(i32 %0) {
%2 = srem i32 %0, 128
%3 = trunc i32 %2 to i8
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_fatal(char *, char *, int);
int rank_from_char(int c) {
  {
    if (!(c >= '1' && c <= '8'))
      my_fatal("file \"%s\", line %d, assertion \""
               "c>='1'&&c<='8'"
               "\" failed\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/"
               "master/square.c",
               173);
  };
  return c - '1';
}


x86 assembly (clang, -O0):
<rank_from_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x31,-0x4(%rbp)
jl     112f <rank_from_char+0x1f>
cmpl   $0x38,-0x4(%rbp)
jle    1147 <rank_from_char+0x37>
lea    0xeca(%rip),%rdi
lea    0xefa(%rip),%rsi
mov    $0xad,%edx
call   1030 <my_fatal@plt>
mov    -0x4(%rbp),%eax
sub    $0x31,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rank_from_char>:
push   %rbx
mov    %edi,%ebx
add    $0xffffffcf,%ebx
cmp    $0x8,%ebx
jb     1133 <rank_from_char+0x23>
lea    0xede(%rip),%rdi
lea    0xf0e(%rip),%rsi
mov    $0xad,%edx
call   1030 <my_fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"file \22%s\22, line %d, assertion \22c>='1'&&c<='8'\22 failed\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/square.c\00"
define i32 @rank_from_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 49
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 56
br i1 %7, label %10, label %8
8: ; preds = %5, %1
%9 = call i32 @my_fatal(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 173)
br label %10
10: ; preds = %8, %5
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 49
ret i32 %12
}

LLVM IR (-O2):
@.str = [55 x i8] c"file \22%s\22, line %d, assertion \22c>='1'&&c<='8'\22 failed\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ddugovic/polyglot/refs/heads/master/square.c\00"
define i32 @rank_from_char(i32 %0) {
%2 = add i32 %0, -49
%3 = icmp ult i32 %2, 8
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @my_fatal(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 173)
br label %6
6: ; preds = %1, %4
ret i32 %2
}
/* Variables and functions */
int chdir(char const *);
int chdir_utf8(const char *dirname) { return chdir(dirname); }


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

x86 assembly (clang, -O2):
<chdir_utf8>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @chdir_utf8(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EP94M0_Reg_Read(int, unsigned char *, int);
void MHL_RCP_RAP_Read(unsigned char *pData) { EP94M0_Reg_Read(0x54, pData, 2); }


x86 assembly (clang, -O0):
<MHL_RCP_RAP_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x54,%edi
mov    $0x2,%edx
call   1030 <EP94M0_Reg_Read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MHL_RCP_RAP_Read>:
mov    %rdi,%rsi
mov    $0x54,%edi
mov    $0x2,%edx
jmp    1030 <EP94M0_Reg_Read@plt>

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

LLVM IR (-O2):
define void @MHL_RCP_RAP_Read(i8* %0) {
%2 = tail call i32 @EP94M0_Reg_Read(i32 84, i8* %0, i32 2)
ret void
}
int do_361() { return 361; }


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

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

LLVM IR (-O0):
define i32 @do_361() {
ret i32 361
}

LLVM IR (-O2):
define i32 @do_361() {
ret i32 361
}
/* Variables and functions */
char *ConvertPTEFlags(unsigned long, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void PrintPTEFlags(unsigned long flags) {
  char tmp_buffer[256];
  printf("%s", ConvertPTEFlags(flags, tmp_buffer, 256));
}


x86 assembly (clang, -O0):
<PrintPTEFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <ConvertPTEFlags@plt>
mov    %rax,%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintPTEFlags>:
sub    $0x108,%rsp
mov    %rsp,%rsi
mov    $0x100,%edx
call   1040 <ConvertPTEFlags@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @PrintPTEFlags(i64 %0) {
%2 = alloca i64
%3 = alloca [256 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i8* @ConvertPTEFlags(i64 %4, i8* %5, i32 256)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @PrintPTEFlags(i64 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i8* @ConvertPTEFlags(i64 %0, i8* %3, i32 256)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
struct sigaction {
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void sig_ignore(int n) {
  struct sigaction sig;
  sig.sa_handler = SIG_IGN;
  sigemptyset(&sig.sa_mask);
  sig.sa_flags = 0;
  sigaction(n, &sig, NULL);
}


x86 assembly (clang, -O0):
<sig_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x18(%rbp),%rdi
add    $0x8,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_ignore>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
define void @sig_ignore(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sigaction
store i32 %0, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 2
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 1
%7 = call i32 @sigemptyset(i32* %6)
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i32 0, i32 0
store i64 0, i64* %8
%9 = load i32, i32* %2
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i64, i32, i32 }
@SIG_IGN = global i32 0
define void @sig_ignore(i32 %0) {
%2 = alloca %struct.sigaction
%3 = bitcast %struct.sigaction* %2 to i8*
%4 = load i32, i32* @SIG_IGN
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i64 0, i32 2
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i64 0, i32 1
%7 = call i32 @sigemptyset(i32* %6)
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i64 0, i32 0
store i64 0, i64* %8
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int do_cd(int argc, char **argv) {
  if (argv[1]) {
    chdir(argv[1]);
  } else {
    chdir("/");
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1140 <do_cd+0x30>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <chdir@plt>
jmp    114c <do_cd+0x3c>
lea    0xeb9(%rip),%rdi
call   1030 <chdir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cd>:
push   %rax
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
jne    1121 <do_cd+0x11>
lea    0xedf(%rip),%rdi
call   1030 <chdir@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @do_cd(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @chdir(i8* %4)
br label %10
8: ; preds = %2
%9 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ postmessage(char *);
void posthelp() {
  postmessage("    7 Wonders Help:\nKeys:\n Arrow keys move cursor\n Return - "
              "buys card\n h - prints this message");
}


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

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

LLVM IR (-O0):
@.str = [95 x i8] c" 7 Wonders Help:\0AKeys:\0A Arrow keys move cursor\0A Return - buys card\0A h - prints this message\00"
define void @posthelp() {
%1 = call i32 @postmessage(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [95 x i8] c" 7 Wonders Help:\0AKeys:\0A Arrow keys move cursor\0A Return - buys card\0A h - prints this message\00"
define void @posthelp() {
%1 = tail call i32 @postmessage(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t binToGray(uint16_t num) { return (num >> 1) ^ num; }


x86 assembly (clang, -O0):
<binToGray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
xor    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binToGray>:
mov    %edi,%eax
sar    %eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @binToGray(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = xor i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @binToGray(i32 %0) {
%2 = ashr i32 %0, 1
%3 = xor i32 %2, %0
ret i32 %3
}
int bad_compare(int x) { return -x; }


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

x86 assembly (clang, -O2):
<bad_compare>:
mov    %edi,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @bad_compare(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char str[80], str1[80];
  int i;
  gets(str);
  i = 0;
  while (str1[i] = str[i++])
    ;
  puts(str1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xb4(%rbp)
cltq
mov    -0x60(%rbp,%rax,1),%al
movslq -0xb4(%rbp),%rcx
mov    %al,-0xb0(%rbp,%rcx,1)
cmp    $0x0,%al
je     1177 <main+0x57>
jmp    1145 <main+0x25>
lea    -0xb0(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xa8,%rsp
lea    0x50(%rsp),%rdi
call   1040 <gets@plt>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x50(%rsp,%rax,1),%ecx
mov    %cl,0x1(%rsp,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1140 <main+0x20>
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xa8,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %3)
br label %6
6: ; preds = %6, %0
%7 = phi i64 [ %8, %6 ], [ 0, %0 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %7
%10 = load i8, i8* %9
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %8
store i8 %10, i8* %11
%12 = icmp eq i8 %10, 0
br i1 %12, label %13, label %6
13: ; preds = %6
%14 = call i32 @puts(i8* %4)
ret i32 0
}
void RTLockValidatorRecExclCheckOrderAndBlocking(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecExclCheckOrderAndBlocking() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, char const *);
void *Mem_Malloc(size_t size, const char *funcname) {
  void *p;
  p = malloc(size);
  if (p == NULL) {
    printf("Out of memory in %s()", funcname);
    exit(0);
  }
  return p;
}


x86 assembly (clang, -O0):
<Mem_Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <Mem_Malloc+0x3f>
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_Malloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <Mem_Malloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Out of memory in %s()\00"
define i8* @Mem_Malloc(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"Out of memory in %s()\00"
define noalias i8* @Mem_Malloc(i64 %0, i8* %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ctest_assert_pass(char *);
int test_ctest_01() {
  ctest_assert_pass("Simple Pass Test..");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Simple Pass Test..\00"
define i32 @test_ctest_01() {
%1 = call i32 @ctest_assert_pass(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Simple Pass Test..\00"
define i32 @test_ctest_01() {
%1 = tail call i32 @ctest_assert_pass(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}