xunge/DecIR huggingface dataset:
void setZero(int m, int n, int *a) {
  int *p;
  for (p = a; p < a + m * n; p++) {
    *p = 0;
  }
  return;
}


x86 assembly (clang, -O0):
<setZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1153 <setZero+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <setZero+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setZero>:
imul   %esi,%edi
test   %edi,%edi
jle    114b <setZero+0x3b>
push   %rax
mov    %edi,%eax
lea    (%rdx,%rax,4),%rax
lea    0x4(%rdx),%rcx
cmp    %rcx,%rax
cmova  %rax,%rcx
mov    %rdx,%rax
not    %rax
add    %rcx,%rax
add    $0x4,%rax
and    $0xfffffffffffffffc,%rax
mov    %rdx,%rdi
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @setZero(i32 %0, i32 %1, i32* writeonly %2) {
%4 = ptrtoint i32* %2 to i64
%5 = mul nsw i32 %1, %0
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %3
%8 = zext i32 %5 to i64
%9 = bitcast i32* %2 to i8*
%10 = shl nuw nsw i64 %8, 2
%11 = add i64 %10, %4
%12 = add i64 %4, 4
%13 = call i64 @llvm.umax.i64(i64 %11, i64 %12)
%14 = xor i64 %4, -1
%15 = add i64 %13, %14
%16 = add i64 %15, 4
%17 = and i64 %16, -4
br label %18
18: ; preds = %7, %3
ret void
}
/* Variables and functions */
int japi_getfontheight(int);
int j_getfontheight(int arg0) { return (japi_getfontheight(arg0)); }


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

x86 assembly (clang, -O2):
<j_getfontheight>:
jmp    1030 <japi_getfontheight@plt>

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

LLVM IR (-O2):
define i32 @j_getfontheight(i32 %0) {
%2 = tail call i32 @japi_getfontheight(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int searchInsert(int *, int, int /*<<< orphan*/);
int main(void) {
  int x[] = {1, 3, 5, 6};
  printf("%d\n", searchInsert(x, sizeof(x) / sizeof(int), 0));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <searchInsert@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1040 <searchInsert@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.x = [4 x i32] [i32 1, i32 3, i32 5, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @searchInsert(i32* %3, i32 4, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int pow2(int a) { return a * a; }


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

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

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

LLVM IR (-O2):
define i32 @pow2(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ E_prime();
int /*<<< orphan*/ T();
void E() {
  T();
  E_prime();
}


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

x86 assembly (clang, -O2):
<E>:
push   %rax
xor    %eax,%eax
call   1030 <T@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <E_prime@plt>

LLVM IR (-O0):
define void @E() {
%1 = call i32 (...) @T()
%2 = call i32 (...) @E_prime()
ret void
}

LLVM IR (-O2):
define void @E() {
%1 = tail call i32 (...) @T()
%2 = tail call i32 (...) @E_prime()
ret void
}
int PGCD(int a, int b) {
  int r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}


x86 assembly (clang, -O0):
<PGCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <PGCD+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <PGCD+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PGCD>:
mov    %edi,%eax
test   %esi,%esi
je     111d <PGCD+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <PGCD+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @PGCD(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 ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem 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 @PGCD(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 = srem 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
}
/* Variables and functions */
unsigned char *hmac_sha384(unsigned char *, unsigned char const *, size_t,
                           unsigned char const *, size_t);
unsigned char *mac_hmac_sha384(unsigned char *out, const unsigned char *key,
                               size_t key_len, const unsigned char *msg,
                               size_t msg_len) {
  return hmac_sha384(out, key, key_len, msg, msg_len);
}


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

x86 assembly (clang, -O2):
<mac_hmac_sha384>:
jmp    1030 <hmac_sha384@plt>

LLVM IR (-O0):
define i8* @mac_hmac_sha384(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_sha384(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_sha384(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_sha384(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fsetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninit_fsetpos(void) {
  FILE *fp;
  fpos_t pos;
  fpos_t *ppos;
  fsetpos(fp, &pos);
  fp = fopen("filename", "rt");
  fsetpos(fp, ppos);
  fclose(fp);
}


x86 assembly (clang, -O0):
<uninit_fsetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <fsetpos@plt>
lea    0xeb4(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <fsetpos@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninit_fsetpos>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
call   1050 <fsetpos@plt>
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fsetpos@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninit_fsetpos() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32*
%4 = load i32*, i32** %1
%5 = call i32 @fsetpos(i32* %4, i32* %2)
%6 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = load i32*, i32** %3
%9 = call i32 @fsetpos(i32* %7, i32* %8)
%10 = load i32*, i32** %1
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninit_fsetpos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @fsetpos(i32* undef, i32* %1)
%4 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @fsetpos(i32* %4, i32* undef)
%6 = call i32 @fclose(i32* %4)
ret void
}
int loop() {
  int sum = 0;
  while (sum < 100) {
    sum += sum;
  }
  return sum;
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1123 <loop+0x23>
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110b <loop+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @loop() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = add nsw i32 %7, %6
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
/* Variables and functions */
double bits_to_double(unsigned long);
unsigned int fgetc(unsigned int);
double fget_double(unsigned handle) {
  unsigned low, high;
  unsigned long l;
  double d;
  low = fgetc(handle);
  high = fgetc(handle);
  l = ((long)high) << 32;
  l |= low;
  d = bits_to_double(l);
  return d;
}


x86 assembly (clang, -O0):
<fget_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fgetc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <bits_to_double@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_double>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <fgetc@plt>
shl    $0x20,%rax
mov    %ebp,%edi
or     %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <bits_to_double@plt>

LLVM IR (-O0):
define double @fget_double(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca double
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @fgetc(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = call i32 @fgetc(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = shl i64 %12, 32
store i64 %13, i64* %5
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = or i64 %16, %15
store i64 %17, i64* %5
%18 = load i64, i64* %5
%19 = call double @bits_to_double(i64 %18)
store double %19, double* %6
%20 = load double, double* %6
ret double %20
}

LLVM IR (-O2):
define double @fget_double(i32 %0) {
%2 = tail call i32 @fgetc(i32 %0)
%3 = tail call i32 @fgetc(i32 %0)
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = zext i32 %2 to i64
%7 = or i64 %5, %6
%8 = tail call double @bits_to_double(i64 %7)
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint32_t;

/* Variables and functions */
uint32_t integerify(const uint32_t *B, size_t r) {
  const uint32_t *X = &B[(2 * r - 1) * 16];
  return X[0];
}


x86 assembly (clang, -O0):
<integerify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
sub    $0x1,%rcx
shl    $0x4,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<integerify>:
shl    $0x7,%rsi
mov    -0x40(%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @integerify(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i64, i64* %4
%8 = mul i64 2, %7
%9 = sub i64 %8, 1
%10 = mul i64 %9, 16
%11 = getelementptr inbounds i32, i32* %6, i64 %10
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @integerify(i32* nocapture %0, i64 %1) {
%3 = shl i64 %1, 5
%4 = add i64 %3, -16
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x24() {
  Assert_real((isodigit(36) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              185, ("isodigit should be 0 for $"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for $\00"
define void @t_isodigit_0x24() {
%1 = call i64 @isodigit(i32 36)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for $\00"
define void @t_isodigit_0x24() {
%1 = tail call i64 @isodigit(i32 36)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double fifdmin1(double a, double b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<fifdmin1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fifdmin1+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <fifdmin1+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifdmin1>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fifdmin1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fifdmin1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ print_array_values(int const *, int const *);
void print_array_values_(const int *values, const int *nvalues) {
  print_array_values(values, nvalues);
}


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

x86 assembly (clang, -O2):
<print_array_values_>:
jmp    1030 <print_array_values@plt>

LLVM IR (-O0):
define void @print_array_values_(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 @print_array_values(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @print_array_values_(i32* %0, i32* %1) {
%3 = tail call i32 @print_array_values(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t count) {
  const char *sc;
  for (sc = s; count-- && *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1168 <strnlen+0x68>
jmp    1157 <strnlen+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %19, %2
%8 = load i64, i64* %4
%9 = add i64 %8, -1
store i64 %9, i64* %4
%10 = icmp ne i64 %8, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8*, i8** %5
%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 %22
18: ; preds = %16
br label %19
19: ; preds = %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
br label %7
22: ; preds = %16
%23 = load i8*, i8** %5
%24 = load i8*, i8** %3
%25 = ptrtoint i8* %23 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glLoadIdentity(int /*<<< orphan*/ *);
void gles_glLoadIdentity() {
  { mock_push(pack_glLoadIdentity(NULL)); };
}


x86 assembly (clang, -O0):
<gles_glLoadIdentity>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pack_glLoadIdentity@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gles_glLoadIdentity>:
push   %rax
xor    %edi,%edi
call   1040 <pack_glLoadIdentity@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <mock_push@plt>

LLVM IR (-O0):
define void @gles_glLoadIdentity() {
%1 = call i32 @pack_glLoadIdentity(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @gles_glLoadIdentity() {
%1 = tail call i32 @pack_glLoadIdentity(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
unsigned int instr_util_usat(int val, unsigned int bitc) {
  int retval;
  int max = (1 << bitc) - 1;
  if (val > max)
    retval = max;
  else if (val < 0)
    retval = 0;
  else
    retval = val;
  return (int)retval;
}


x86 assembly (clang, -O0):
<instr_util_usat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1131 <instr_util_usat+0x31>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <instr_util_usat+0x52>
cmpl   $0x0,-0x4(%rbp)
jge    1147 <instr_util_usat+0x47>
movl   $0x0,-0xc(%rbp)
jmp    114d <instr_util_usat+0x4d>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <instr_util_usat+0x52>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_util_usat>:
mov    %esi,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
not    %edx
cmp    %edi,%edx
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @instr_util_usat(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = icmp slt i32 %4, %0
%6 = icmp sgt i32 %0, 0
%7 = select i1 %6, i32 %0, i32 0
%8 = select i1 %5, i32 %4, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: mkmpioboot <firmware file> <boot file> <output file>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"usage: mkmpioboot <firmware file> <boot file> <output file>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"usage: mkmpioboot <firmware file> <boot file> <output file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
float am_finvsqrt2(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f375a86 - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<am_finvsqrt2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f375a86,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe5e(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_finvsqrt2>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f375a86,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
movaps %xmm0,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm1,%xmm2
movss  0xed8(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm3,%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @am_finvsqrt2(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463174, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
%23 = load float, float* %3
%24 = load float, float* %2
%25 = fmul float %23, %24
%26 = load float, float* %2
%27 = fneg float %25
%28 = call float @llvm.fmuladd.f32(float %27, float %26, float 1.500000e+00)
%29 = fmul float %22, %28
store float %29, float* %2
%30 = load float, float* %2
ret float %30
}

LLVM IR (-O2):
define float @am_finvsqrt2(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463174, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
%10 = fmul float %6, %9
%11 = tail call float @llvm.fmuladd.f32(float %10, float %9, float 1.500000e+00)
%12 = fmul float %9, %11
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *get_sysinfo();
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fprintf(stdout, "%s\n", get_sysinfo());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <get_sysinfo@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1040 <get_sysinfo@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i8* (...) @get_sysinfo()
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void rmcallback(void *value) { printf("+-%s\n", (char *)value); }


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

x86 assembly (clang, -O2):
<rmcallback>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"+-%s\0A\00"
define void @rmcallback(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void nseel_asm_div_op_fast_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_div_op_fast_end() {
ret void
}
int plus(int *a, int *b) { return *a + *b; }


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
mov    (%rsi),%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @plus(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
void set_eflags(unsigned long eflags) {
  asm volatile("push"
               "q"
               " %0\n\tpopf"
               "q"
               :
               : "rm"(eflags)
               : "flags");
}


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

x86 assembly (clang, -O2):
<set_eflags>:
mov    %rdi,-0x8(%rsp)
push   -0x8(%rsp)
popf
ret

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

LLVM IR (-O2):
define void @set_eflags(i64 %0) {
tail call void asm sideeffect "pushq $0\0A\09popfq", "rm,~{flags},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 2) {
    fprintf(stderr, "ERROR: Usage: %s code.hex\n", argv[0]);
    return 1;
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    1153 <main+0x43>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x1,%edi
jg     1139 <main+0x29>
push   %rax
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR: Usage: %s code.hex\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %14
14: ; preds = %8, %2
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR: Usage: %s code.hex\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, unsigned int);
void my_memcpy(void *dst, void const *src, unsigned n) { memcpy(dst, src, n); }


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

x86 assembly (clang, -O2):
<my_memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @my_memcpy(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @my_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
test(label, bracket) int label;
int bracket;
{
  if (bracket)
    needbrack("(");
  expression();
  if (bracket)
    needbrack(")");
  testjump(label);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1156 <test+0x26>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <needbrack@plt>
mov    $0x0,%al
call   1040 <expression@plt>
cmpl   $0x0,-0xc(%rbp)
je     1175 <test+0x45>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <needbrack@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <testjump@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
je     115c <test+0x2c>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1050 <needbrack@plt>
xor    %eax,%eax
call   1040 <expression@plt>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <needbrack@plt>
jmp    1163 <test+0x33>
xor    %eax,%eax
call   1040 <expression@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <testjump@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c")\00"
define i32 @test(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @needbrack to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @expression()
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @needbrack to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @expression()
br label %10
10: ; preds = %8, %4
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @testjump to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Variables and functions */
double pow(double, double);
float powf(float, float);
long double powl(long double, long double);
void test_pow(float a0, double a1, long double a2) {
  float l0 = powf(a0, a0);
  double l1 = pow(a1, a1);
  long double l2 = powl(a2, a2);
}


x86 assembly (clang, -O0):
<test_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm1
movaps %xmm1,%xmm0
call   1040 <powf@plt>
movss  %xmm0,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm1
movaps %xmm1,%xmm0
call   1050 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fld    %st(0)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <powl@plt>
fstpt  -0x40(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pow>:
sub    $0x38,%rsp
movsd  %xmm1,0x20(%rsp)
fldt   0x40(%rsp)
fstpt  0x2c(%rsp)
movaps %xmm0,%xmm1
call   1040 <powf@plt>
movsd  0x20(%rsp),%xmm0
movaps %xmm0,%xmm1
call   1050 <pow@plt>
fldt   0x2c(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <powl@plt>
fstp   %st(0)
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @test_pow(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
%7 = alloca float
%8 = alloca double
%9 = alloca x86_fp80
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
%10 = load float, float* %4
%11 = load float, float* %4
%12 = call float @powf(float %10, float %11)
store float %12, float* %7
%13 = load double, double* %5
%14 = load double, double* %5
%15 = call double @pow(double %13, double %14)
store double %15, double* %8
%16 = load x86_fp80, x86_fp80* %6
%17 = load x86_fp80, x86_fp80* %6
%18 = call x86_fp80 @powl(x86_fp80 %16, x86_fp80 %17)
store x86_fp80 %18, x86_fp80* %9
ret void
}

LLVM IR (-O2):
define void @test_pow(float %0, double %1, x86_fp80 %2) {
%4 = tail call float @powf(float %0, float %0)
%5 = tail call double @pow(double %1, double %1)
%6 = tail call x86_fp80 @powl(x86_fp80 %2, x86_fp80 %2)
ret void
}
/* Variables and functions */
int ft_isalpha(int);
int ft_isdigit(int);
int ft_isalnum(int c) {
  if (ft_isalpha(c) == 1 || ft_isdigit(c) == 1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ft_isalpha@plt>
cmp    $0x1,%eax
je     114d <ft_isalnum+0x2d>
mov    -0x8(%rbp),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x1,%eax
jne    1159 <ft_isalnum+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1160 <ft_isalnum+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <ft_isalpha@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1145 <ft_isalnum+0x25>
mov    %ebx,%edi
call   1030 <ft_isdigit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = tail call i32 @ft_isalpha(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @ft_isdigit(i32 %0)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ allocate();
int main(int argc, char *argv[]) {
  allocate();
  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 <allocate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <allocate@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 (...) @allocate()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @allocate()
ret i32 0
}
/* Variables and functions */
int mem_get_le32_as_int(unsigned char const *);
signed int mem_get_sle32_as_int(const void *vmem) {
  const unsigned char *mem = (const unsigned char *)vmem;
  signed int val = mem_get_le32_as_int(mem);
  return (val << ((sizeof(int) << 3) - 32)) >> ((sizeof(int) << 3) - 32);
}


x86 assembly (clang, -O0):
<mem_get_sle32_as_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <mem_get_le32_as_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x0,%eax
sar    $0x0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_get_sle32_as_int>:
jmp    1030 <mem_get_le32_as_int@plt>

LLVM IR (-O0):
define i32 @mem_get_sle32_as_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mem_get_le32_as_int(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 0
%10 = ashr i32 %9, 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @mem_get_sle32_as_int(i8* %0) {
%2 = tail call i32 @mem_get_le32_as_int(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char const);
void print_char_verb_latex(const unsigned char c) {
  switch (c) {
  case '|':
    printf("\\verb+%c+", c);
    break;
  default:
    printf("\\verb|%c|", c);
    break;
  }
}


x86 assembly (clang, -O0):
<print_char_verb_latex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
sub    $0x7c,%al
jne    1143 <print_char_verb_latex+0x33>
jmp    112e <print_char_verb_latex+0x1e>
lea    0xecb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
jmp    1153 <print_char_verb_latex+0x43>
lea    0xec0(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char_verb_latex>:
cmp    $0x7c,%dil
jne    1127 <print_char_verb_latex+0x17>
lea    0xee3(%rip),%rdi
mov    $0x7c,%esi
jmp    1030 <printf@plt>
movzbl %dil,%esi
lea    0xed8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\\verb+%c+\00"
@.str.1 = [10 x i8] c"\\verb|%c|\00"
define void @print_char_verb_latex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %8 [
i32 124, label %5
]
5: ; preds = %1
%6 = load i8, i8* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
br label %11
8: ; preds = %1
%9 = load i8, i8* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\\verb+%c+\00"
@.str.1 = [10 x i8] c"\\verb|%c|\00"
define void @print_char_verb_latex(i8 zeroext %0) {
%2 = icmp eq i8 %0, 124
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 zeroext 124)
br label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int strtol(char const *, char **, int /*<<< orphan*/);
signed xx_strtol(const char *nptr, char **endptr) {
  return strtol(nptr, endptr, 0);
}


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

x86 assembly (clang, -O2):
<xx_strtol>:
xor    %edx,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @xx_strtol(i8* %0, i8** nocapture %1) {
%3 = tail call i32 @strtol(i8* %0, i8** %1, i32 0)
ret i32 %3
}
void gtk_tool_button_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_button_get_type() {
ret void
}