xunge/DecIR huggingface dataset:
long update_timestamp(long ts, int id) {
  long timestamp = (long)(ts / 1000);
  timestamp++;
  timestamp *= 1000;
  timestamp += id;
  return timestamp;
}


x86 assembly (clang, -O0):
<update_timestamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
imul   $0x3e8,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_timestamp>:
mov    %rdi,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
imul   $0x3e8,%rdx,%rax
movslq %esi,%rcx
add    %rcx,%rax
add    $0x3e8,%rax
ret

LLVM IR (-O0):
define i64 @update_timestamp(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = sdiv i64 %6, 1000
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = add nsw i64 %8, 1
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = mul nsw i64 %10, 1000
store i64 %11, i64* %5
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = load i64, i64* %5
%15 = add nsw i64 %14, %13
store i64 %15, i64* %5
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
define i64 @update_timestamp(i64 %0, i32 %1) {
%3 = srem i64 %0, 1000
%4 = sext i32 %1 to i64
%5 = add i64 %0, 1000
%6 = sub i64 %5, %3
%7 = add i64 %6, %4
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t ip_get_tos(const uint8_t *p_ip) { return p_ip[1]; }


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

x86 assembly (clang, -O2):
<ip_get_tos>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ip_get_tos(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @ip_get_tos(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
double get_musclev(double v_up, double v_dw) { return 0; }


x86 assembly (clang, -O0):
<get_musclev>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_musclev>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @get_musclev(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @get_musclev(double %0, double %1) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(void) { fprintf(stdout, "hello world!\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void iwl_legacy_dbgfs_unregister(struct iwl_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define void @iwl_legacy_dbgfs_unregister(%struct.iwl_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int klog(char);
int /*<<< orphan*/ strcat(char, char *);
int logdebug(char *debug_msg) {
  char *debug_tag = "Debug : ";
  strcat(*debug_tag, debug_msg);
  int ret = klog(*debug_tag);
  return (ret);
}


x86 assembly (clang, -O0):
<logdebug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <klog@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logdebug>:
push   %rax
mov    %rdi,%rsi
mov    $0x44,%edi
call   1040 <strcat@plt>
mov    $0x44,%edi
pop    %rax
jmp    1030 <klog@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Debug : \00"
define i32 @logdebug(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = call i32 @strcat(i8 signext %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i32 @klog(i8 signext %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @logdebug(i8* %0) {
%2 = tail call i32 @strcat(i8 signext 68, i8* %0)
%3 = tail call i32 @klog(i8 signext 68)
ret i32 %3
}
void mls_type_data_ushort_to_bytearray(unsigned char *outb,
                                       unsigned short inb) {
  outb[0] = (unsigned char)((inb >> 8) & (unsigned char)0xff);
  outb[1] = (unsigned char)((inb) & (unsigned char)0xff);
}


x86 assembly (clang, -O0):
<mls_type_data_ushort_to_bytearray>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mls_type_data_ushort_to_bytearray>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @mls_type_data_ushort_to_bytearray(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @mls_type_data_ushort_to_bytearray(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %0
%5 = trunc i16 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
int abs(int __x) { return (__x < 0) ? -__x : __x; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void FPURoundingModeSet(uint32_t ui32Mode) {
  (*((volatile unsigned long *)(0xE000EF3C))) =
      ((*((volatile unsigned long *)(0xE000EF3C))) & ~(0x00C00000)) | ui32Mode;
}


x86 assembly (clang, -O0):
<FPURoundingModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xe000ef3c,%eax
mov    (%rax),%rcx
and    $0xffffffffff3fffff,%rcx
mov    -0x8(%rbp),%rax
or     %rax,%rcx
mov    $0xe000ef3c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPURoundingModeSet>:
mov    %rdi,-0x8(%rsp)
mov    $0xe000ef3c,%eax
mov    $0xffffffffff3fffff,%rcx
and    (%rax),%rcx
or     -0x8(%rsp),%rcx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @FPURoundingModeSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%4 = and i64 %3, -12582913
%5 = load volatile i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3758157628 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPURoundingModeSet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%4 = and i64 %3, -12582913
%5 = load volatile i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3758157628 to i64*)
ret void
}
int calledFunction(void) { return (0x5A); }


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

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

LLVM IR (-O0):
define i32 @calledFunction() {
ret i32 90
}

LLVM IR (-O2):
define i32 @calledFunction() {
ret i32 90
}
/* Type definitions */
struct stat {
  long long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
long long get_mem_size_stat(void) {
  long long mem_size = 0;
  struct stat buff;
  stat("/proc/kcore", &buff);
  mem_size = buff.st_size;
  mem_size /= (1024 * 1024);
  return mem_size;
}


x86 assembly (clang, -O0):
<get_mem_size_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xed9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x100000,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem_size_stat>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%rcx
lea    0xfffff(%rcx),%rax
test   %rcx,%rcx
cmovns %rcx,%rax
sar    $0x14,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [12 x i8] c"/proc/kcore\00"
define i64 @get_mem_size_stat() {
%1 = alloca i64
%2 = alloca %struct.stat
store i64 0, i64* %1
%3 = call i32 @stat(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%5 = load i64, i64* %4
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = sdiv i64 %6, 1048576
store i64 %7, i64* %1
%8 = load i64, i64* %1
ret i64 %8
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [12 x i8] c"/proc/kcore\00"
define i64 @get_mem_size_stat() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = sdiv i64 %5, 1048576
ret i64 %6
}
/* Variables and functions */
int GmfGotoKwd(int, int);
int gmfgotokwdf77_(int *MshIdx, int *KwdIdx) {
  return (GmfGotoKwd(*MshIdx, *KwdIdx));
}


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

x86 assembly (clang, -O2):
<gmfgotokwdf77_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <GmfGotoKwd@plt>

LLVM IR (-O0):
define i32 @gmfgotokwdf77_(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 = call i32 @GmfGotoKwd(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @gmfgotokwdf77_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @GmfGotoKwd(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int main(int argc, char *argv[]) {
  loop();
  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 <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(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 (...) @loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @loop()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t lseek(int fd, off_t offset, int origin) { return 0; }


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
short table_index(key)
unsigned char *key;
{
  long i, sum = 0;
  for (i = 0; key[i]; i++)
    sum += key[i];
  return (sum % 503);
}


x86 assembly (clang, -O0):
<table_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114f <table_index+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <table_index+0x18>
mov    -0x18(%rbp),%rax
mov    $0x1f7,%ecx
cqto
idiv   %rcx
mov    %dx,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<table_index>:
mov    (%rdi),%al
test   %al,%al
je     113f <table_index+0x3f>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl %al,%eax
add    %rax,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <table_index+0x10>
movabs $0x824a4e60b3262bc5,%rdx
4e 4a 82
mov    %rcx,%rax
mul    %rdx
shr    $0x8,%edx
imul   $0x1f7,%edx,%eax
sub    %eax,%ecx
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @table_index(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %4
store i64 0, i64* %3
br label %5
5: ; preds = %19, %1
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %5
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = load i64, i64* %4
%18 = add nsw i64 %17, %16
store i64 %18, i64* %4
br label %19
19: ; preds = %11
%20 = load i64, i64* %3
%21 = add nsw i64 %20, 1
store i64 %21, i64* %3
br label %5
22: ; preds = %5
%23 = load i64, i64* %4
%24 = srem i64 %23, 503
%25 = trunc i64 %24 to i16
ret i16 %25
}

LLVM IR (-O2):
define signext i16 @table_index(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 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %9, %4 ], [ 0, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = zext i8 %5 to i64
%9 = add nuw nsw i64 %6, %8
%10 = add nuw nsw i64 %7, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %9, 503
%16 = trunc i64 %15 to i16
br label %17
17: ; preds = %14, %1
%18 = phi i16 [ 0, %1 ], [ %16, %14 ]
ret i16 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_hello_world(void) {
  printf("Hello library world!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello library world!\0A\00"
define i32 @print_hello_world() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Hello library world!\00"
define i32 @print_hello_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void *memq_peek(void *tail, void *head, void **mem) {
  void *link;
  if (head == tail) {
    return 0;
  }
  link = head;
  if (mem) {
    *mem = *((void **)link + 1);
  }
  return link;
}


x86 assembly (clang, -O0):
<memq_peek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    112b <memq_peek+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1155 <memq_peek+0x55>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <memq_peek+0x4d>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memq_peek>:
cmp    %rdi,%rsi
je     1115 <memq_peek+0x15>
mov    %rsi,%rax
test   %rdx,%rdx
je     1114 <memq_peek+0x14>
mov    0x8(%rax),%rcx
mov    %rcx,(%rdx)
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @memq_peek(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = icmp eq i8* %9, %10
br i1 %11, label %12, label %13
12: ; preds = %3
store i8* null, i8** %4
br label %25
13: ; preds = %3
%14 = load i8*, i8** %6
store i8* %14, i8** %8
%15 = load i8**, i8*** %7
%16 = icmp ne i8** %15, null
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i8*, i8** %8
%19 = bitcast i8* %18 to i8**
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %7
store i8* %21, i8** %22
br label %23
23: ; preds = %17, %13
%24 = load i8*, i8** %8
store i8* %24, i8** %4
br label %25
25: ; preds = %23, %12
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @memq_peek(i8* readnone %0, i8* %1, i8** writeonly %2) {
%4 = icmp eq i8* %1, %0
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i8** %2, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = getelementptr inbounds i8, i8* %1, i64 8
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
store i8* %10, i8** %2
br label %11
11: ; preds = %5, %7, %3
%12 = phi i8* [ null, %3 ], [ %1, %7 ], [ %1, %5 ]
ret i8* %12
}
/* Variables and functions */
void CL_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @CL_Shutdown() {
ret void
}
int test_imm_36int64_lowword_reg(long long val) {
  return ((val) & (0x36 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_36int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 54
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Com_Printf(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ FS_ReferencedPakNames();
int /*<<< orphan*/ Sys_Gettext(char *);
void CL_ReferencedPK3List_f(void) {
  Com_Printf(Sys_Gettext("Referenced PK3 Names: %s\n"),
             FS_ReferencedPakNames());
}


x86 assembly (clang, -O0):
<CL_ReferencedPK3List_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <Sys_Gettext@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <FS_ReferencedPakNames@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <Com_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_ReferencedPK3List_f>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <Sys_Gettext@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <FS_ReferencedPakNames@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Referenced PK3 Names: %s\0A\00"
define void @CL_ReferencedPK3List_f() {
%1 = call i32 @Sys_Gettext(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @FS_ReferencedPakNames()
%3 = call i32 @Com_Printf(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Referenced PK3 Names: %s\0A\00"
define void @CL_ReferencedPK3List_f() {
%1 = tail call i32 @Sys_Gettext(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @FS_ReferencedPakNames()
%3 = tail call i32 @Com_Printf(i32 %1, i32 %2)
ret void
}
void XkbAllocGeomKeys() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocGeomKeys() {
ret void
}
float foo() {
  float x = 0.0;
  x = 1.0 / x;
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @foo() {
%1 = alloca float
store float 0.000000e+00, float* %1
%2 = load float, float* %1
%3 = fpext float %2 to double
%4 = fdiv double 1.000000e+00, %3
%5 = fptrunc double %4 to float
store float %5, float* %1
%6 = load float, float* %1
ret float %6
}

LLVM IR (-O2):
define float @foo() {
ret float 0x7FF0000000000000
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xd4() {
  Assert_real((isxdigit(212) == 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_isxdigit.c",
              1065, ("isxdigit should be 0 for 0xd4"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xd4>:
push   %rax
mov    $0xd4,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x429,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd4\00"
define void @t_isxdigit_0xd4() {
%1 = call i64 @isxdigit(i32 212)
%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 1065, i8* getelementptr inbounds ([30 x i8], [30 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xd4\00"
define void @t_isxdigit_0xd4() {
%1 = tail call i64 @isxdigit(i32 212)
%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 1065, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  while ("Please don't actually run this code!!") {
    malloc(0);
    printf("%s", "Allocated Nothing\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <malloc@plt>
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0xed1(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edi,%edi
call   1040 <malloc@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [38 x i8] c"Please don't actually run this code!!\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"Allocated Nothing\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @malloc(i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"Allocated Nothing\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @malloc(i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x8b() {
  Assert_real((iscntrl(139) == 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_iscntrl.c",
              700, ("iscntrl should be 0 for 0x8b"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x8b>:
push   %rax
mov    $0x8b,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2bc,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x8b\00"
define void @t_iscntrl_0x8b() {
%1 = call i64 @iscntrl(i32 139)
%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 700, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x8b\00"
define void @t_iscntrl_0x8b() {
%1 = tail call i64 @iscntrl(i32 139)
%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 700, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __isign(int, int);
int intr_wrap_461(int p1, int p2) { return __isign(p1, p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_461>:
jmp    1030 <__isign@plt>

LLVM IR (-O0):
define i32 @intr_wrap_461(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 @__isign(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @intr_wrap_461(i32 %0, i32 %1) {
%3 = tail call i32 @__isign(i32 %0, i32 %1)
ret i32 %3
}
void PECIDomainDisable(unsigned long ulBase, unsigned long ulDomain) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~(1 << ulDomain);
}


x86 assembly (clang, -O0):
<PECIDomainDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainDisable>:
mov    %rsi,%rcx
mov    $0xfffffffe,%eax
rol    %cl,%eax
cltq
and    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @PECIDomainDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = sext i32 %8 to i64
%10 = load i64, i64* %3
%11 = add i64 %10, 0
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @PECIDomainDisable(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %0 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %6
store volatile i64 %9, i64* %7
ret void
}
int main() {
  int i;
  char *addr;
  i = 0;
  while (i < 1024) {
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x400,-0x8(%rbp)
jge    112d <main+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void main() {
  { int thread_id; }
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @XkbFreeGeomPoints() {
ret void
}
float remainingAngle(float angleOne, float angleTwo) {
  return 180.0 - angleOne - angleTwo;
}


x86 assembly (clang, -O0):
<remainingAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
subsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainingAngle>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm2
subsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
subsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @remainingAngle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fsub double 1.800000e+02, %6
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fsub double %7, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @remainingAngle(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fsub double 1.800000e+02, %3
%5 = fpext float %1 to double
%6 = fsub double %4, %5
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_PLAY;
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int audioPlay(int fd) {
  int ans;
  if ((ans = ioctl(fd, AUDIO_PLAY)) < 0) {
    perror("AUDIO PLAY: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<audioPlay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1160 <audioPlay+0x40>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <audioPlay+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audioPlay>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
js     1139 <audioPlay+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AUDIO_PLAY = global i32 0
@.str = [13 x i8] c"AUDIO PLAY: \00"
define i32 @audioPlay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @AUDIO_PLAY
%7 = call i32 @ioctl(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@AUDIO_PLAY = global i32 0
@.str = [13 x i8] c"AUDIO PLAY: \00"
define i32 @audioPlay(i32 %0) {
%2 = load i32, i32* @AUDIO_PLAY
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ -1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _hostname_error(char const *message, int ret) {
  fputs("hostname"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_hostname_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hostname_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hostname: \00"
@stderr = global i32 0
define i32 @_hostname_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"hostname: \00"
@stderr = global i32 0
define i32 @_hostname_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
void gtk_tree_view_get_reorderable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_get_reorderable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x18() {
  Assert_real((isspace(24) == 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_isspace.c",
              125, ("isspace should be 0 for 0x18"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x18>:
push   %rax
mov    $0x18,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x7d,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x18\00"
define void @t_isspace_0x18() {
%1 = call i64 @isspace(i32 24)
%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 125, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x18\00"
define void @t_isspace_0x18() {
%1 = tail call i64 @isspace(i32 24)
%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 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
int token_num(char *token) {
  int i;
  for (i = 0; i < strlen(token); i++) {
    if (token[i] == ',') {
      return 2;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<token_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1173 <token_num+0x63>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1160 <token_num+0x50>
movl   $0x2,-0x4(%rbp)
jmp    117a <token_num+0x6a>
jmp    1165 <token_num+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <token_num+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<token_num>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x1,%r14d
test   %eax,%eax
jle    1151 <token_num+0x41>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
cmpb   $0x2c,(%rbx,%rbp,1)
je     114b <token_num+0x3b>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1130 <token_num+0x20>
jmp    1151 <token_num+0x41>
mov    $0x2,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @token_num(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %8, label %14
4: ; preds = %8
%5 = tail call i32 @strlen(i8* %0)
%6 = sext i32 %5 to i64
%7 = icmp slt i64 %13, %6
br i1 %7, label %8, label %14
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 44
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 2, %8 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ co1();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n");
  co1();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @co1()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @co1()
ret i32 0
}
/* Variables and functions */
double area(double);
double distance(double, double, double, double);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double radius = distance(1.0, 2.0, 4.0, 6.0);
  double result = area(radius);
  printf(" area is %f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  0xeb9(%rip),%xmm1
movsd  0xeb9(%rip),%xmm2
movsd  0xeb9(%rip),%xmm3
call   1050 <distance@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <area@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
movsd  0xec7(%rip),%xmm1
movsd  0xec7(%rip),%xmm2
movsd  0xec7(%rip),%xmm3
call   1050 <distance@plt>
call   1040 <area@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c" area is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double @distance(double 1.000000e+00, double 2.000000e+00, double 4.000000e+00, double 6.000000e+00)
store double %4, double* %2
%5 = load double, double* %2
%6 = call double @area(double %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c" area is %f\0A\00"
define i32 @main() {
%1 = tail call double @distance(double 1.000000e+00, double 2.000000e+00, double 4.000000e+00, double 6.000000e+00)
%2 = tail call double @area(double %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
/* Type definitions */
struct test_result_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ visit(char *, struct test_result_s *);
void visit_v(void *data, void *userdata) {
  visit((char *)data, (struct test_result_s *)userdata);
}


x86 assembly (clang, -O0):
<visit_v>:
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 <visit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visit_v>:
jmp    1030 <visit@plt>

LLVM IR (-O0):
%struct.test_result_s = type { i32 }
define void @visit_v(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 = bitcast i8* %6 to %struct.test_result_s*
%8 = call i32 @visit(i8* %5, %struct.test_result_s* %7)
ret void
}

LLVM IR (-O2):
%struct.test_result_s = type { i32 }
define void @visit_v(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.test_result_s*
%4 = tail call i32 @visit(i8* %0, %struct.test_result_s* %3)
ret void
}
int profile_wrapper_empty(void *args) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @profile_wrapper_empty(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun3() { printf("This Fun3 \n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"This Fun3 \0A\00"
define void @fun3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"This Fun3 \00"
define void @fun3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}