xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int fdd_interleave(int sector, int skew, int spt) {
  uint32_t add = (spt & 1);
  uint32_t adjust = (spt >> 1);
  uint32_t adjusted_r;
  uint32_t skewed_i;
  skewed_i = (sector + skew) % spt;
  adjusted_r = (skewed_i >> 1) + 1;
  if (skewed_i & 1) {
    adjusted_r += (adjust + add);
  }
  return (adjusted_r);
}


x86 assembly (clang, -O0):
<fdd_interleave>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sar    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1153 <fdd_interleave+0x53>
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdd_interleave>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
cltd
idiv   %ecx
mov    %edx,%eax
sar    %eax
and    $0x1,%edx
neg    %edx
mov    %ecx,%esi
sar    %esi
and    $0x1,%ecx
add    %esi,%ecx
and    %edx,%ecx
add    %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fdd_interleave(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = srem i32 %4, %2
%6 = ashr i32 %5, 1
%7 = add nsw i32 %6, 1
%8 = and i32 %5, 1
%9 = icmp eq i32 %8, 0
%10 = ashr i32 %2, 1
%11 = and i32 %2, 1
%12 = add nsw i32 %10, %11
%13 = select i1 %9, i32 0, i32 %12
%14 = add nsw i32 %7, %13
ret i32 %14
}
int boot(char c) { return 10; }


x86 assembly (clang, -O0):
<boot>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xa,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @boot(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret i32 10
}

LLVM IR (-O2):
define i32 @boot(i8 signext %0) {
ret i32 10
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ memcpy(char *, char *, scalar_t__);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strlen(char *);
int main() {
  char *s1 = "hello world!";
  char *s2 = malloc(strlen(s1) + 1);
  memcpy(s2, s1, strlen(s1) + 1);
  printf("s2: %s\n", s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xd,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    $0xd,%edx
mov    %rax,%rdi
call   1040 <memcpy@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world!\00"
@.str.1 = [8 x i8] c"s2: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @memcpy(i8* %8, i8* %9, i64 %12)
%14 = load i8*, i8** %3
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
@.str.1 = [8 x i8] c"s2: %s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(13) i8* @malloc(i64 13)
%2 = tail call i32 @memcpy(i8* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 13)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
int test2() { return (1); }


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

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

LLVM IR (-O0):
define i32 @test2() {
ret i32 1
}

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void nocrash_rewind() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    rewind(f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <nocrash_rewind+0x3c>
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_rewind>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115d <nocrash_rewind+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <rewind@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_rewind() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @rewind(i32* %6)
%8 = load i32*, i32** %1
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_rewind() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @rewind(i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
int test_imm_ECuint16_mem(unsigned short *val) {
  return ((*val) & (-0xEC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ECuint16_mem>:
movzwl (%rdi),%eax
test   $0xff14,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ECuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -236
%7 = icmp ne i32 %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_ECuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -236
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int udfexample_ver() { return 9; }


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

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

LLVM IR (-O0):
define i32 @udfexample_ver() {
ret i32 9
}

LLVM IR (-O2):
define i32 @udfexample_ver() {
ret i32 9
}
int __attribute__((no)) fn3(void) {
  unsigned long a = 0, b = 0, c = 0;
  a = foo(&b, &c);
  unsigned long vara = a;
  unsigned long varb = b;
  unsigned long varc = c;
  asm volatile("" : : "g"(vara), "g"(varb), "g"(varc));
  return a;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <foo@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
sub    $0x28,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <foo@plt>
cltq
mov    0x8(%rsp),%rcx
mov    (%rsp),%rdx
mov    %rax,0x20(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rdx,0x10(%rsp)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @fn3() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
store i64 0, i64* %3
%7 = call i32 (i64*, i64*, ...) bitcast (i32 (...)* @foo to i32 (i64*, i64*, ...)*)(i64* %2, i64* %3)
%8 = sext i32 %7 to i64
store i64 %8, i64* %1
%9 = load i64, i64* %1
store i64 %9, i64* %4
%10 = load i64, i64* %2
store i64 %10, i64* %5
%11 = load i64, i64* %3
store i64 %11, i64* %6
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = load i64, i64* %1
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @fn3() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 (i64*, i64*, ...) bitcast (i32 (...)* @foo to i32 (i64*, i64*, ...)*)(i64* %1, i64* %2)
%6 = sext i32 %5 to i64
%7 = load i64, i64* %1
%8 = load i64, i64* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_log1pl();
scalar_t__ log1pl(long double);
void test_log1pl(long double ld) {
  if (log1pl(ld) != log1pl(ld))
    link_failure_log1pl();
}


x86 assembly (clang, -O0):
<test_log1pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log1pl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log1pl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_log1pl+0x43>
mov    $0x0,%al
call   1040 <link_failure_log1pl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_log1pl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <log1pl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <log1pl@plt>
cmp    %rax,%rbx
jne    1151 <test_log1pl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_log1pl@plt>

LLVM IR (-O0):
define void @test_log1pl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @log1pl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @log1pl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_log1pl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_log1pl(x86_fp80 %0) {
%2 = tail call i64 @log1pl(x86_fp80 %0)
%3 = tail call i64 @log1pl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_log1pl()
br label %7
7: ; preds = %5, %1
ret void
}
unsigned int Gcd(unsigned int M, unsigned int N) {
  unsigned int Rem;
  while (N > 0) {
    Rem = M % N;
    M = N;
    N = Rem;
  }
  return M;
}


x86 assembly (clang, -O0):
<Gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1130 <Gcd+0x30>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <Gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111e <Gcd+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <Gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = urem i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
br label %6
15: ; preds = %6
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @Gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = urem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Type definitions */
struct config_t {
  int dummy;
};

/* Variables and functions */
void *ALWAYS_ON_SNR_open(struct config_t *cfg) { return NULL; }


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

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

LLVM IR (-O0):
%struct.config_t = type { i32 }
define i8* @ALWAYS_ON_SNR_open(%struct.config_t* %0) {
%2 = alloca %struct.config_t*
store %struct.config_t* %0, %struct.config_t** %2
ret i8* null
}

LLVM IR (-O2):
%struct.config_t = type { i32 }
define noalias i8* @ALWAYS_ON_SNR_open(%struct.config_t* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_container_to_target_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(2, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_container_to_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_container_to_target_system>:
mov    $0x2,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_container_to_target_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 2, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_container_to_target_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 2, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void cutHair() {}


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

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

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

LLVM IR (-O2):
define void @cutHair() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beep();
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_beep(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(beep());
}


x86 assembly (clang, -O0):
<cmd_beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_beep+0x27>
jmp    117f <cmd_beep+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1040 <beep@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_beep>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_beep+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1040 <beep@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_beep(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @beep()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_beep(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @beep()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
int current_agent(int i) { return i % 2; }


x86 assembly (clang, -O0):
<current_agent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_agent>:
mov    %edi,%eax
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @current_agent(i32 %0) {
%2 = srem i32 %0, 2
ret i32 %2
}
unsigned int right(unsigned int maze) {
  return (maze >> 1) & 0b0111101111011110111101111;
}


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
and    $0xf7bdef,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
mov    %edi,%eax
shr    %eax
and    $0xf7bdef,%eax
ret

LLVM IR (-O0):
define i32 @right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 16236015
ret i32 %5
}

LLVM IR (-O2):
define i32 @right(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 16236015
ret i32 %3
}
void generic_pipe_buf_confirm(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<generic_pipe_buf_confirm>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_pipe_buf_confirm>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.generic_pipe_buf_confirm = [25 x i8] c"generic_pipe_buf_confirm\00"
define void @generic_pipe_buf_confirm() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.generic_pipe_buf_confirm, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.generic_pipe_buf_confirm = [25 x i8] c"generic_pipe_buf_confirm\00"
define void @generic_pipe_buf_confirm() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.generic_pipe_buf_confirm, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *quotes_around(char *, char *, char);
char *single_quotes_around(char *destination, char *s) {
  return quotes_around(destination, s, '\'');
}


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

x86 assembly (clang, -O2):
<single_quotes_around>:
mov    $0x27,%edx
jmp    1030 <quotes_around@plt>

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

LLVM IR (-O2):
define i8* @single_quotes_around(i8* %0, i8* %1) {
%3 = tail call i8* @quotes_around(i8* %0, i8* %1, i8 signext 39)
ret i8* %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello Wolrd! \n");
  return EXIT_SUCCESS;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello Wolrd! \0A\00"
@EXIT_SUCCESS = global i32 0
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 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"Hello Wolrd! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xaf() {
  Assert_real((isdigit(175) == 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",
              880, ("isdigit should be 0 for 0xaf"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xaf>:
push   %rax
mov    $0xaf,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x370,%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 0xaf\00"
define void @t_isdigit_0xaf() {
%1 = call i64 @isdigit(i32 175)
%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 880, 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 0xaf\00"
define void @t_isdigit_0xaf() {
%1 = tail call i64 @isdigit(i32 175)
%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 880, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct j_state {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ i_instr_rm(struct j_state *, int /*<<< orphan*/, int,
                              int /*<<< orphan*/, int, int, int /*<<< orphan*/,
                              size_t);
void i_cmp_m(struct j_state *s, int base, int64_t off, size_t size, int reg) {
  i_instr_rm(s, 0, 0x39, 0, reg, base, off, size);
}


x86 assembly (clang, -O0):
<i_cmp_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%r10d
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    $0x39,%edx
mov    %ecx,%esi
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <i_instr_rm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_cmp_m>:
push   %rax
mov    %rcx,%rax
mov    %edx,%r10d
mov    %esi,%r9d
xor    %esi,%esi
mov    $0x39,%edx
xor    %ecx,%ecx
push   %rax
push   %r10
call   1030 <i_instr_rm@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
%struct.j_state = type { i32 }
define void @i_cmp_m(%struct.j_state* %0, i32 %1, i32 %2, i64 %3, i32 %4) {
%6 = alloca %struct.j_state*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
store %struct.j_state* %0, %struct.j_state** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load %struct.j_state*, %struct.j_state** %6
%12 = load i32, i32* %10
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i64, i64* %9
%16 = call i32 @i_instr_rm(%struct.j_state* %11, i32 0, i32 57, i32 0, i32 %12, i32 %13, i32 %14, i64 %15)
ret void
}

LLVM IR (-O2):
%struct.j_state = type { i32 }
define void @i_cmp_m(%struct.j_state* %0, i32 %1, i32 %2, i64 %3, i32 %4) {
%6 = tail call i32 @i_instr_rm(%struct.j_state* %0, i32 0, i32 57, i32 0, i32 %4, i32 %1, i32 %2, i64 %3)
ret void
}
int test_imm_DBuint8_reg(unsigned char val) {
  return ((val) & (0xDB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DBuint8_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, 219
%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_DBuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -37
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long get_hash(char *word) {
  long hash = 0, time = 0;
  char c;
  while (c = *word++) {
    hash += (c + time++) ^ 61;
  }
  return hash;
}


x86 assembly (clang, -O0):
<get_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
cmp    $0x0,%al
je     115c <get_hash+0x5c>
movsbq -0x19(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
add    %rcx,%rax
xor    $0x3d,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <get_hash+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hash>:
mov    (%rdi),%dl
test   %dl,%dl
je     112c <get_hash+0x2c>
xor    %ecx,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsbq %dl,%rsi
add    %rcx,%rsi
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
xor    $0x3d,%rsi
add    %rsi,%rax
test   %dl,%dl
jne    1110 <get_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @get_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = phi i64 [ %14, %4 ], [ 0, %1 ]
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = sext i8 %5 to i64
%11 = add nuw nsw i64 %7, 1
%12 = add nsw i64 %7, %10
%13 = xor i64 %12, 61
%14 = add nsw i64 %13, %8
%15 = load i8, i8* %9
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i64 [ 0, %1 ], [ %14, %4 ]
ret i64 %18
}
int lencls(int *c) {
  int res = 0;
  while (*c++)
    res++;
  return res;
}


x86 assembly (clang, -O0):
<lencls>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
je     1135 <lencls+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lencls+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lencls>:
cmpl   $0x0,(%rdi)
je     111c <lencls+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x4(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <lencls+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @lencls(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %2
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @lencls(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void update_debugregs(int seq) {}


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

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

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

LLVM IR (-O2):
define void @update_debugregs(i32 %0) {
ret void
}
unsigned xrop3_150_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_150_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, 255
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
int base64_encodelen(int len) { return ((len + 2) / 3 * 4) + 1; }


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

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

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

LLVM IR (-O2):
define i32 @base64_encodelen(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
%5 = or i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int main(void) {
  loop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @loop()
ret i32 0
}
void io_errorno(void) {}


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

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

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

LLVM IR (-O2):
define void @io_errorno() {
ret void
}
void svg_fnt(int cf, int scale) {}


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

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

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

LLVM IR (-O2):
define void @svg_fnt(i32 %0, i32 %1) {
ret void
}
void ppo() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void create_file(char *fn, char *what) {
  FILE *f = fopen(fn, "w");
  if (f) {
    if (what)
      fprintf(f, "%s", what);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<create_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1187 <create_file+0x57>
cmpq   $0x0,-0x10(%rbp)
je     117e <create_file+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116a <create_file+0x3a>
mov    %rax,%rbx
test   %r14,%r14
je     115b <create_file+0x2b>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @create_file(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = icmp eq i8* %1, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @fputs(i8* %1, i32* %3)
br label %9
9: ; preds = %7, %5
%10 = tail call i32 @fclose(i32* %3)
br label %11
11: ; preds = %9, %2
ret void
}
/* Variables and functions */
scalar_t__ ceil(size_t);
size_t TI_EstimateBas64DecodedDataSize(size_t inDataSize) {
  size_t theDecodedDataSize = (int)ceil(inDataSize / 4.0) * 3;
  return (theDecodedDataSize);
}


x86 assembly (clang, -O0):
<TI_EstimateBas64DecodedDataSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movaps 0xedd(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedc(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
mov    %rdi,%rcx
sar    $0x3f,%rcx
movsd  0xec2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
and    %rcx,%rax
or     %rax,%rdi
call   1030 <ceil@plt>
imul   $0x3,%eax,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TI_EstimateBas64DecodedDataSize>:
push   %rax
movq   %rdi,%xmm0
punpckldq 0xee2(%rip),%xmm0
subpd  0xeea(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xee6(%rip),%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%rdi
and    %rcx,%rdi
or     %rax,%rdi
call   1030 <ceil@plt>
shl    $0x20,%rax
lea    (%rax,%rax,2),%rax
sar    $0x20,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @TI_EstimateBas64DecodedDataSize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
%6 = fdiv double %5, 4.000000e+00
%7 = fptoui double %6 to i64
%8 = call i64 @ceil(i64 %7)
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 3
%11 = sext i32 %10 to i64
store i64 %11, i64* %3
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @TI_EstimateBas64DecodedDataSize(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fmul double %2, 2.500000e-01
%4 = fptoui double %3 to i64
%5 = tail call i64 @ceil(i64 %4)
%6 = mul i64 %5, 12884901888
%7 = ashr exact i64 %6, 32
ret i64 %7
}
/* Variables and functions */
int hex2int(int ch) {
  if (ch >= 'a' && ch <= 'f')
    return ch + 10 - 'a';
  else if (ch >= 'A' && ch <= 'F')
    return ch + 10 - 'A';
  else
    return ch - '0';
}


x86 assembly (clang, -O0):
<hex2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <hex2int+0x2c>
cmpl   $0x66,-0x8(%rbp)
jg     112c <hex2int+0x2c>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <hex2int+0x5a>
cmpl   $0x41,-0x8(%rbp)
jl     1151 <hex2int+0x51>
cmpl   $0x46,-0x8(%rbp)
jg     1151 <hex2int+0x51>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <hex2int+0x5a>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2int>:
lea    -0x61(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x6,%ecx
mov    $0xffffffc9,%ecx
mov    $0xffffffd0,%edx
cmovb  %ecx,%edx
cmp    $0x6,%eax
mov    $0xffffffa9,%eax
cmovae %edx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @hex2int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 102
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 10
%12 = sub nsw i32 %11, 97
store i32 %12, i32* %2
br label %26
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 70
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 10
%22 = sub nsw i32 %21, 65
store i32 %22, i32* %2
br label %26
23: ; preds = %16, %13
%24 = load i32, i32* %3
%25 = sub nsw i32 %24, 48
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %19, %9
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @hex2int(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 6
%4 = add i32 %0, -65
%5 = icmp ult i32 %4, 6
%6 = select i1 %5, i32 -55, i32 -48
%7 = select i1 %3, i32 -87, i32 %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *smt_get_buffer(size_t);
void *_get_buffer(size_t size) {
  void *buf = smt_get_buffer(size);
  memset(buf, 0, size);
  return buf;
}


x86 assembly (clang, -O0):
<_get_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <smt_get_buffer@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <smt_get_buffer@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_get_buffer(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @smt_get_buffer(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @_get_buffer(i64 %0) {
%2 = tail call i8* @smt_get_buffer(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _system_depended_path(char const *);
int system(int /*<<< orphan*/);
int wide_system_system(const char *command) {
  return system(_system_depended_path(command));
}


x86 assembly (clang, -O0):
<wide_system_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_system_depended_path@plt>
mov    %eax,%edi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wide_system_system>:
push   %rax
call   1040 <_system_depended_path@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @wide_system_system(i8* %0) {
%2 = tail call i32 @_system_depended_path(i8* %0)
%3 = tail call i32 @system(i32 %2)
ret i32 %3
}
float nanoHowManySeconds(unsigned long long val) {
  return (float)((double)val / 1000000.);
}


x86 assembly (clang, -O0):
<nanoHowManySeconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movaps 0xf01(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xf00(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanoHowManySeconds>:
movq   %rdi,%xmm0
punpckldq 0xef3(%rip),%xmm0
subpd  0xefb(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
divsd  0xef7(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @nanoHowManySeconds(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to double
%5 = fdiv double %4, 1.000000e+06
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @nanoHowManySeconds(i64 %0) {
%2 = uitofp i64 %0 to double
%3 = fdiv double %2, 1.000000e+06
%4 = fptrunc double %3 to float
ret float %4
}