xunge/DecIR huggingface dataset:
int foobar(void) {
  int x;
  return (*(int (*)(void)) & x)();
}


x86 assembly (clang, -O0):
<foobar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foobar>:
push   %rax
lea    0x4(%rsp),%rax
call   *%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foobar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i32 ()*
%3 = call i32 %2()
ret i32 %3
}

LLVM IR (-O2):
define i32 @foobar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = bitcast i32* %1 to i32 ()*
%4 = call i32 %3()
ret i32 %4
}
/* Variables and functions */
bool gpsisdigit(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<gpsisdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <gpsisdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpsisdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @gpsisdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @gpsisdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
char *hcharxor(char *x) {
  *x ^= 24;
  if (!*x)
    foo(x);
  return x;
}


x86 assembly (clang, -O0):
<hcharxor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    $0x18,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113e <hcharxor+0x2e>
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hcharxor>:
push   %rbx
mov    %rdi,%rbx
xorb   $0x18,(%rdi)
jne    1121 <hcharxor+0x11>
mov    %rbx,%rdi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hcharxor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = xor i32 %5, 24
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @foo(i8* %12)
br label %14
14: ; preds = %11, %1
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @hcharxor(i8* returned %0) {
%2 = load i8, i8* %0
%3 = xor i8 %2, 24
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @foo(i8* %0)
br label %7
7: ; preds = %5, %1
ret i8* %0
}
extern unsigned char PassUChar(unsigned char *chr) { return *chr; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @PassUChar(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
void fa54(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    p01B:
      goto p01B;
      goto a;
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
a:
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa54>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa54+0x4>

x86 assembly (clang, -O2):
<fa54>:
jmp    1100 <fa54>

LLVM IR (-O0):
define void @fa54() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
br label %15
15: ; preds = %15, %14
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; No predecessors!
br label %21
21: ; preds = %21, %20
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
br label %24
24: ; preds = %24, %23
br label %24
25: ; preds = %25
br label %25
26: ; No predecessors!
br label %27
27: ; preds = %27, %26
br label %27
}

LLVM IR (-O2):
define void @fa54() {
br label %1
1: ; preds = %1, %0
br label %1
}
void testfunc13(void) {
  int x;
  int *const cpi = &x;
  int *const *pcpi;
  const int **ppci;
  int **ppi;
  const int *pci;
  volatile int *pvi;
  int *pi;
  pi = cpi;
  pi = (int *)pci;
  pi = (int *)pvi;
  ppi = (int **)pcpi;
  ppi = (int **)ppci;
}


x86 assembly (clang, -O0):
<testfunc13>:
push   %rbp
mov    %rsp,%rbp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testfunc13() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca i32**
%5 = alloca i32**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %1, i32** %2
%9 = load i32*, i32** %2
store i32* %9, i32** %8
%10 = load i32*, i32** %6
store i32* %10, i32** %8
%11 = load i32*, i32** %7
store i32* %11, i32** %8
%12 = load i32**, i32*** %3
store i32** %12, i32*** %5
%13 = load i32**, i32*** %4
store i32** %13, i32*** %5
ret void
}

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

/* Variables and functions */
int32_t snr_cmp_to_sam(uint32_t num) {
  int sign = (int)(num >> 31);
  if (sign == 0)
    return (int32_t)num;
  else {
    return -(~((int32_t)(num - 1)));
  }
}


x86 assembly (clang, -O0):
<snr_cmp_to_sam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1125 <snr_cmp_to_sam+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <snr_cmp_to_sam+0x35>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @snr_cmp_to_sam(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 31
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = xor i32 %13, -1
%15 = sub nsw i32 0, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @snr_cmp_to_sam(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ add10(int *, int *);
int /*<<< orphan*/ printf(char *, int);
void muladd(int *a, int *b) {
  add10(a, b);
  printf("x = %d\n", *a);
  printf("y = %d\n", *b);
  *a *= 2;
  *b *= 2;
}


x86 assembly (clang, -O0):
<muladd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <add10@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<muladd>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <add10@plt>
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    (%r14),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
shll   (%rbx)
shll   (%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"x = %d\0A\00"
@.str.1 = [8 x i8] c"y = %d\0A\00"
define void @muladd(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 @add10(i32* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, 2
store i32 %16, i32* %14
%17 = load i32*, i32** %4
%18 = load i32, i32* %17
%19 = mul nsw i32 %18, 2
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
@.str.1 = [8 x i8] c"y = %d\0A\00"
define void @muladd(i32* %0, i32* %1) {
%3 = tail call i32 @add10(i32* %0, i32* %1)
%4 = load i32, i32* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %0
%9 = shl nsw i32 %8, 1
store i32 %9, i32* %0
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 1
store i32 %11, i32* %1
ret void
}
void count_memory() { int lc = 0, ch = 0, co = 0; }


x86 assembly (clang, -O0):
<count_memory>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, int, char *);
char *strerror(int /*<<< orphan*/);
void failed_ensure(const char *desc, int line) {
  char str[2000];
  snprintf(str, sizeof(str), "Failure. %s. Line %d, %s", desc, line,
           strerror(errno));
  fail(str);
}


x86 assembly (clang, -O0):
<failed_ensure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x7e0(%rbp),%rax
mov    %rax,-0x7f8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x7f0(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x7e4(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x7f8(%rbp),%rdi
mov    -0x7f0(%rbp),%rcx
mov    -0x7e4(%rbp),%r8d
mov    %rax,%r9
mov    $0x7d0,%esi
lea    0xe6a(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x7e0(%rbp),%rdi
call   1030 <fail@plt>
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<failed_ensure>:
push   %rbp
push   %r14
push   %rbx
sub    $0x7d0,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x7d0,%esi
mov    %rbx,%rcx
mov    %ebp,%r8d
mov    %rax,%r9
call   1040 <snprintf@plt>
mov    %r14,%rdi
call   1030 <fail@plt>
add    $0x7d0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Failure. %s. Line %d, %s\00"
@errno = global i32 0
define void @failed_ensure(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [2000 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2000 x i8], [2000 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @snprintf(i8* %6, i32 2000, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %10)
%12 = getelementptr inbounds [2000 x i8], [2000 x i8]* %5, i64 0, i64 0
%13 = call i32 @fail(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Failure. %s. Line %d, %s\00"
@errno = global i32 0
define void @failed_ensure(i8* %0, i32 %1) {
%3 = alloca [2000 x i8]
%4 = getelementptr inbounds [2000 x i8], [2000 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = call i32 @snprintf(i8* %4, i32 2000, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %6)
%8 = call i32 @fail(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ get(int, int);
int test_outside() {
  return 0 == get(-1, 0) && 0 == get(0, -1) && 0 == get(1, 3);
}


x86 assembly (clang, -O0):
<test_outside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <get@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1173 <test_outside+0x63>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <get@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    1173 <test_outside+0x63>
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <get@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_outside>:
push   %rbx
xor    %ebx,%ebx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <get@plt>
test   %rax,%rax
jne    114e <test_outside+0x3e>
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <get@plt>
test   %rax,%rax
jne    114e <test_outside+0x3e>
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <get@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_outside() {
%1 = call i64 @get(i32 -1, i32 0)
%2 = icmp eq i64 0, %1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i64 @get(i32 0, i32 -1)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i64 @get(i32 1, i32 3)
%8 = icmp eq i64 0, %7
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_outside() {
%1 = tail call i64 @get(i32 -1, i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 @get(i32 0, i32 -1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @get(i32 1, i32 3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int b1();
int b2();
int c();
int main(void) { return 0 + c() + b1() + b2(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <c@plt>
add    $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <b1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <b2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <c@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <b1@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <b2@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @c()
%3 = add nsw i32 0, %2
%4 = call i32 (...) @b1()
%5 = add nsw i32 %3, %4
%6 = call i32 (...) @b2()
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @c()
%2 = tail call i32 (...) @b1()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @b2()
%5 = add nsw i32 %3, %4
ret i32 %5
}
unsigned long getExceptionHandler(int tt) {
  unsigned long *tb = (unsigned long *)0x40;
  return ((tb[tt] + tt + (0x40 >> 2)) | 0xff000000) << 2;
}


x86 assembly (clang, -O0):
<getExceptionHandler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rax
movabs $0xff000000,%rcx
or     %rcx,%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getExceptionHandler>:
movslq %edi,%rax
add    0x40(,%rax,8),%rax
lea    0x40(,%rax,4),%rcx
movabs $0x3fc000000,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @getExceptionHandler(i32 %0) {
%2 = alloca i32
%3 = alloca i64*
store i32 %0, i32* %2
store i64* inttoptr (i64 64 to i64*), i64** %3
%4 = load i64*, i64** %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %4, i64 %6
%8 = load i64, i64* %7
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add i64 %8, %10
%12 = add i64 %11, 16
%13 = or i64 %12, 4278190080
%14 = shl i64 %13, 2
ret i64 %14
}

LLVM IR (-O2):
define i64 @getExceptionHandler(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds i64, i64* inttoptr (i64 64 to i64*), i64 %2
%4 = load i64, i64* %3
%5 = add i64 %4, %2
%6 = shl i64 %5, 2
%7 = add i64 %6, 64
%8 = or i64 %7, 17112760320
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ abs(int /*<<< orphan*/);
void abs_zero() {
  Assert_real((abs(0) == 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/stdlib/abs.c",
              22, ("Should be == 0"));
}


x86 assembly (clang, -O0):
<abs_zero>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <abs@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x16,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_zero>:
push   %rax
xor    %edi,%edi
call   1030 <abs@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf61(%rip),%rcx
mov    $0x16,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/abs.c\00"
@.str.1 = [15 x i8] c"Should be == 0\00"
define void @abs_zero() {
%1 = call i64 @abs(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/abs.c\00"
@.str.1 = [15 x i8] c"Should be == 0\00"
define void @abs_zero() {
%1 = tail call i64 @abs(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printUsage() {
  fprintf(stderr, "Usage: fastasplit [-s/--size] [-f/--file_prefix <prefix>] "
                  "<fastaFile> <nchunk> <outdir>\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [89 x i8] c"Usage: fastasplit [-s/--size] [-f/--file_prefix <prefix>] <fastaFile> <nchunk> <outdir>\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [89 x i8] c"Usage: fastasplit [-s/--size] [-f/--file_prefix <prefix>] <fastaFile> <nchunk> <outdir>\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int xres();
int yres();
extern void image2screen_getscreensize(int *width, int *height) {
  *width = xres();
  *height = yres();
}


x86 assembly (clang, -O0):
<image2screen_getscreensize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <xres@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <yres@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<image2screen_getscreensize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <xres@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <yres@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @image2screen_getscreensize(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 (...) @xres()
store i32 %3, i32* %0
%4 = tail call i32 (...) @yres()
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outer();
int main(int argc, const char *argv[]) {
  outer();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @outer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @outer()
ret i32 0
}
char *movstrn(a, b, n)
register char *a, *b;
register int n;
{
  while ((n-- > 0) && *a)
    *b++ = *a++;
  return (b);
}


x86 assembly (clang, -O0):
<movstrn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jle    1138 <movstrn+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1148 <movstrn+0x48>
jmp    116f <movstrn+0x6f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110f <movstrn+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movstrn>:
mov    %rsi,%rax
test   %edx,%edx
jle    1129 <movstrn+0x29>
add    $0x1,%edx
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1129 <movstrn+0x29>
add    $0x1,%rdi
mov    %cl,(%rax)
add    $0x1,%rax
add    $0xffffffff,%edx
cmp    $0x1,%edx
jg     1110 <movstrn+0x10>
ret

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

LLVM IR (-O2):
define i8* @movstrn(i8* nocapture %0, i8* writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %11
%6 = phi i32 [ %12, %11 ], [ %2, %3 ]
%7 = phi i8* [ %14, %11 ], [ %1, %3 ]
%8 = phi i8* [ %13, %11 ], [ %0, %3 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %5
%12 = add nsw i32 %6, -1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
%15 = icmp sgt i32 %6, 1
br i1 %15, label %5, label %16
16: ; preds = %5, %11, %3
%17 = phi i8* [ %1, %3 ], [ %14, %11 ], [ %7, %5 ]
ret i8* %17
}
/* Variables and functions */
void gen_blank_str(char **blank_str, size_t whitespace_num) {
  int i;
  static char temp_str[200];
  *blank_str = temp_str;
  for (i = 0; i < whitespace_num; i++)
    temp_str[i] = ' ';
  temp_str[i] = '\0';
}


x86 assembly (clang, -O0):
<gen_blank_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
lea    0x2f19(%rip),%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    114c <gen_blank_str+0x4c>
movslq -0x14(%rbp),%rcx
lea    0x2ef6(%rip),%rax
movb   $0x20,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1121 <gen_blank_str+0x21>
movslq -0x14(%rbp),%rcx
lea    0x2ed9(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_blank_str>:
push   %r14
push   %rbx
push   %rax
lea    0x2f25(%rip),%r14
mov    %r14,(%rdi)
test   %rsi,%rsi
je     113e <gen_blank_str+0x2e>
mov    %rsi,%rbx
lea    0x2f13(%rip),%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %ebx,%eax
jmp    1140 <gen_blank_str+0x30>
xor    %eax,%eax
movb   $0x0,(%rax,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@gen_blank_str.temp_str = internal global [200 x i8] zeroinitializer
define void @gen_blank_str(i8** %0, i64 %1) {
%3 = alloca i8**
%4 = alloca i64
%5 = alloca i32
store i8** %0, i8*** %3
store i64 %1, i64* %4
%6 = load i8**, i8*** %3
store i8* getelementptr inbounds ([200 x i8], [200 x i8]* @gen_blank_str.temp_str, i64 0, i64 0), i8** %6
store i32 0, i32* %5
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [200 x i8], [200 x i8]* @gen_blank_str.temp_str, i64 0, i64 %14
store i8 32, i8* %15
br label %16
16: ; preds = %12
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [200 x i8], [200 x i8]* @gen_blank_str.temp_str, i64 0, i64 %21
store i8 0, i8* %22
ret void
}

LLVM IR (-O2):
@gen_blank_str.temp_str = internal global [200 x i8] zeroinitializer
define void @gen_blank_str(i8** nocapture writeonly %0, i64 %1) {
store i8* getelementptr inbounds ([200 x i8], [200 x i8]* @gen_blank_str.temp_str, i64 0, i64 0), i8** %0
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = and i64 %1, 4294967295
br label %6
6: ; preds = %4, %2
%7 = phi i64 [ 0, %2 ], [ %5, %4 ]
%8 = getelementptr inbounds [200 x i8], [200 x i8]* @gen_blank_str.temp_str, i64 0, i64 %7
store i8 0, i8* %8
ret void
}
int HelpItem137(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem137() {
ret i32 0
}
void fn1(void) { __builtin_abort(); }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<fn1>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fn1() {
unreachable
}

LLVM IR (-O2):
define void @fn1() {
tail call void @abort()
unreachable
}
/* Type definitions */
struct Player {
  int dummy;
};
struct Hand {
  int dummy;
};
struct Game {
  int dummy;
};

/* Variables and functions */
int findAllowedCard(struct Player *, struct Game *, struct Hand *, int, int);
int game_findNextAllowedCard(struct Player *player, struct Game *game,
                             struct Hand *hand, int currentCard) {
  return findAllowedCard(player, game, hand, currentCard, 1);
}


x86 assembly (clang, -O0):
<game_findNextAllowedCard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <findAllowedCard@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_findNextAllowedCard>:
mov    $0x1,%r8d
jmp    1030 <findAllowedCard@plt>

LLVM IR (-O0):
%struct.Player = type { i32 }
%struct.Game = type { i32 }
%struct.Hand = type { i32 }
define i32 @game_findNextAllowedCard(%struct.Player* %0, %struct.Game* %1, %struct.Hand* %2, i32 %3) {
%5 = alloca %struct.Player*
%6 = alloca %struct.Game*
%7 = alloca %struct.Hand*
%8 = alloca i32
store %struct.Player* %0, %struct.Player** %5
store %struct.Game* %1, %struct.Game** %6
store %struct.Hand* %2, %struct.Hand** %7
store i32 %3, i32* %8
%9 = load %struct.Player*, %struct.Player** %5
%10 = load %struct.Game*, %struct.Game** %6
%11 = load %struct.Hand*, %struct.Hand** %7
%12 = load i32, i32* %8
%13 = call i32 @findAllowedCard(%struct.Player* %9, %struct.Game* %10, %struct.Hand* %11, i32 %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
%struct.Player = type { i32 }
%struct.Game = type { i32 }
%struct.Hand = type { i32 }
define i32 @game_findNextAllowedCard(%struct.Player* %0, %struct.Game* %1, %struct.Hand* %2, i32 %3) {
%5 = tail call i32 @findAllowedCard(%struct.Player* %0, %struct.Game* %1, %struct.Hand* %2, i32 %3, i32 1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void my_handler(int sig) {
  printf("sig %d\n", sig);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<my_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<my_handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"sig %d\0A\00"
@EXIT_SUCCESS = global i32 0
define void @my_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"sig %d\0A\00"
@EXIT_SUCCESS = global i32 0
define void @my_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lcdsend(int, int, char);
int lcdputchar(int fd, char value) {
  lcdsend(fd, 1, value);
  return 0;
}


x86 assembly (clang, -O0):
<lcdputchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
movsbl -0x5(%rbp),%edx
call   1030 <lcdsend@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdputchar>:
push   %rax
mov    %esi,%edx
mov    $0x1,%esi
call   1030 <lcdsend@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lcdputchar(i32 %0, i8 signext %1) {
%3 = tail call i32 @lcdsend(i32 %0, i32 1, i8 signext %1)
ret i32 0
}
void VIDDummyVdp2SetPriorityNBG3(__attribute((unused)) int priority) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp2SetPriorityNBG3(i32 %0) {
ret void
}
/* Variables and functions */
int close(int);
int close_socket(int a_socket) { return close(a_socket); }


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

x86 assembly (clang, -O2):
<close_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @close_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
long long PAPI_get_real_cyc();
void papif_get_real_cyc_(long long *real_cyc) {
  *real_cyc = PAPI_get_real_cyc();
}


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

x86 assembly (clang, -O2):
<papif_get_real_cyc_>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_get_real_cyc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_get_real_cyc_(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_get_real_cyc()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @papif_get_real_cyc_(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_real_cyc()
store i64 %2, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void app_error(const char *err_msg) { fprintf(stdout, "%s\n", err_msg); }


x86 assembly (clang, -O0):
<app_error>:
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):
<app_error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @app_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @app_error(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float Fabs(float a) {
  if (a < 0.)
    return -a;
  else
    return a;
}


x86 assembly (clang, -O0):
<Fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <Fabs+0x3b>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1145 <Fabs+0x45>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = fneg float %8
store float %9, float* %2
br label %12
10: ; preds = %1
%11 = load float, float* %3
store float %11, float* %2
br label %12
12: ; preds = %10, %7
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @Fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
const char *getConfigDeviceName(void) { return "config"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"config\00"
define i8* @getConfigDeviceName() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"config\00"
define i8* @getConfigDeviceName() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void foo397(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo397(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t PWMIntStatus(uint32_t ui32Base, bool bMasked) {
  ;
  if (bMasked == true) {
    return ((*((volatile uint32_t *)(ui32Base + 0x0000001C))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000018))));
  }
}


x86 assembly (clang, -O0):
<PWMIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1126 <PWMIntStatus+0x26>
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <PWMIntStatus+0x32>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMIntStatus>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
cmp    $0x1,%esi
sete   %al
mov    -0x8(%rsp),%rcx
mov    0x18(%rcx,%rax,4),%rax
ret

LLVM IR (-O0):
define i64 @PWMIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store volatile i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load volatile i64, i64* %4
%10 = add nsw i64 %9, 28
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %3
br label %18
13: ; preds = %2
%14 = load volatile i64, i64* %4
%15 = add nsw i64 %14, 24
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
store i64 %17, i64* %3
br label %18
18: ; preds = %13, %8
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @PWMIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 1
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 28, i64 24
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
int led_util_scale_value(int in, int max) {
  int out = (in * max + 128) / 255;
  return (out < 0) ? 0 : (out < max) ? out : max;
}


x86 assembly (clang, -O0):
<led_util_scale_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    $0x80,%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1135 <led_util_scale_value+0x35>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <led_util_scale_value+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114c <led_util_scale_value+0x4c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <led_util_scale_value+0x52>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_util_scale_value>:
imul   %esi,%edi
lea    0x80(%rdi),%eax
cltq
imul   $0xffffffff80808081,%rax,%rax
shr    $0x20,%rax
lea    (%rax,%rdi,1),%ecx
add    $0x80,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cmp    %esi,%ecx
cmovge %esi,%ecx
xor    %eax,%eax
cmp    $0xfffffe82,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @led_util_scale_value(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 = mul nsw i32 %6, %7
%9 = add nsw i32 %8, 128
%10 = sdiv i32 %9, 255
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
br label %24
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %5
br label %22
20: ; preds = %14
%21 = load i32, i32* %4
br label %22
22: ; preds = %20, %18
%23 = phi i32 [ %19, %18 ], [ %21, %20 ]
br label %24
24: ; preds = %22, %13
%25 = phi i32 [ 0, %13 ], [ %23, %22 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @led_util_scale_value(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, 128
%5 = sdiv i32 %4, 255
%6 = icmp slt i32 %3, -382
%7 = icmp slt i32 %5, %1
%8 = select i1 %7, i32 %5, i32 %1
%9 = select i1 %6, i32 0, i32 %8
ret i32 %9
}
int rtl931x_dma_if_rx_ring_cntr(int i) { return (0x20AC) + ((i / 3) << 2); }


x86 assembly (clang, -O0):
<rtl931x_dma_if_rx_ring_cntr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x20ac,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl931x_dma_if_rx_ring_cntr>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    0x20ac(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @rtl931x_dma_if_rx_ring_cntr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 3
%5 = shl i32 %4, 2
%6 = add nsw i32 8364, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rtl931x_dma_if_rx_ring_cntr(i32 %0) {
%2 = sdiv i32 %0, 3
%3 = shl i32 %2, 2
%4 = add nsw i32 %3, 8364
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, unsigned short);
void BgaWriteRegister(unsigned short IndexValue, unsigned short DataValue) {
  outw(0x01CE, IndexValue);
  outw(0x01CF, DataValue);
}


x86 assembly (clang, -O0):
<BgaWriteRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0x1ce,%edi
movzwl -0x2(%rbp),%esi
call   1030 <outw@plt>
mov    $0x1cf,%edi
movzwl -0x4(%rbp),%esi
call   1030 <outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BgaWriteRegister>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x1ce,%edi
call   1030 <outw@plt>
mov    $0x1cf,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outw@plt>

LLVM IR (-O0):
define void @BgaWriteRegister(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = call i32 @outw(i32 462, i16 zeroext %5)
%7 = load i16, i16* %4
%8 = call i32 @outw(i32 463, i16 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @BgaWriteRegister(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @outw(i32 462, i16 zeroext %0)
%4 = tail call i32 @outw(i32 463, i16 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void UNINSTALL(void) {
  char uninstall[] = "rm -f ~/.mozilla/plugins/libfreshwrapper-flashplayer.so";
  system(uninstall);
}


x86 assembly (clang, -O0):
<UNINSTALL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UNINSTALL>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x6f732e72657961,%rax
mov    %rax,0x30(%rsp)
mov    %rsp,%rdi
call   1030 <system@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.UNINSTALL.uninstall = [56 x i8] c"rm -f ~/.mozilla/plugins/libfreshwrapper-flashplayer.so\00"
define void @UNINSTALL() {
%1 = alloca [56 x i8]
%2 = bitcast [56 x i8]* %1 to i8*
%3 = getelementptr inbounds [56 x i8], [56 x i8]* %1, i64 0, i64 0
%4 = call i32 @system(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.UNINSTALL.uninstall = [56 x i8] c"rm -f ~/.mozilla/plugins/libfreshwrapper-flashplayer.so\00"
define void @UNINSTALL() {
%1 = alloca [56 x i8]
%2 = getelementptr inbounds [56 x i8], [56 x i8]* %1, i64 0, i64 0
%3 = call i32 @system(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ worker(long long *, long long);
void increase(long long int index, long long int change, long long int A[]) {
  A[index] += change;
  worker(A, index);
}


x86 assembly (clang, -O0):
<increase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <worker@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increase>:
mov    %rdi,%rax
add    %rsi,(%rdx,%rdi,8)
mov    %rdx,%rdi
mov    %rax,%rsi
jmp    1030 <worker@plt>

LLVM IR (-O0):
define void @increase(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %5
%8 = load i64*, i64** %6
%9 = load i64, i64* %4
%10 = getelementptr inbounds i64, i64* %8, i64 %9
%11 = load i64, i64* %10
%12 = add nsw i64 %11, %7
store i64 %12, i64* %10
%13 = load i64*, i64** %6
%14 = load i64, i64* %4
%15 = call i32 @worker(i64* %13, i64 %14)
ret void
}

LLVM IR (-O2):
define void @increase(i64 %0, i64 %1, i64* %2) {
%4 = getelementptr inbounds i64, i64* %2, i64 %0
%5 = load i64, i64* %4
%6 = add nsw i64 %5, %1
store i64 %6, i64* %4
%7 = tail call i32 @worker(i64* %2, i64 %0)
ret void
}