xunge/DecIR huggingface dataset:
int moddec(int x, int m) {
  int xdec = x - 1;
  if (x == 0)
    xdec = m - 1;
  return xdec;
}


x86 assembly (clang, -O0):
<moddec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1126 <moddec+0x26>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<moddec>:
test   %edi,%edi
cmovne %edi,%esi
lea    -0x1(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @moddec(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 %0
%5 = add nsw i32 %4, -1
ret i32 %5
}
/* Type definitions */
struct s_map {
  int dummy;
};

/* Variables and functions */
scalar_t__ mapSetReturnID(struct s_map *, void const *, void const *);
int mapSet(struct s_map *map, const void *key, const void *value) {
  if (mapSetReturnID(map, key, value) < 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<mapSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <mapSetReturnID@plt>
cmp    $0x0,%rax
jge    114b <mapSet+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1152 <mapSet+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapSet>:
push   %rax
call   1030 <mapSetReturnID@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.s_map = type { i32 }
define i32 @mapSet(%struct.s_map* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.s_map*
%6 = alloca i8*
%7 = alloca i8*
store %struct.s_map* %0, %struct.s_map** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load %struct.s_map*, %struct.s_map** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = call i64 @mapSetReturnID(%struct.s_map* %8, i8* %9, i8* %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 0, i32* %4
br label %15
14: ; preds = %3
store i32 1, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
%struct.s_map = type { i32 }
define i32 @mapSet(%struct.s_map* %0, i8* %1, i8* %2) {
%4 = tail call i64 @mapSetReturnID(%struct.s_map* %0, i8* %1, i8* %2)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void irq_init() {
  outb(0x20, 0x11);
  outb(0xA0, 0x11);
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  outb(0x21, 0x00);
  outb(0xA1, 0x00);
  outb(0x21, 0x01);
  outb(0xA1, 0x01);
  outb(0x21, 0xFD);
}


x86 assembly (clang, -O0):
<irq_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xfd,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_init>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0xfd,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @irq_init() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 0)
%6 = call i32 @outb(i32 161, i32 0)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
%9 = call i32 @outb(i32 33, i32 253)
ret void
}

LLVM IR (-O2):
define void @irq_init() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 0)
%6 = tail call i32 @outb(i32 161, i32 0)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 33, i32 253)
ret void
}
int onSameCol(int cellOne, int cellTwo) {
  if (cellOne % 8 == cellTwo % 8)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<onSameCol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x10(%rbp),%edx
cmp    %eax,%edx
jne    113c <onSameCol+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <onSameCol+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onSameCol>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff8,%eax
sub    %eax,%edi
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xfffffff8,%eax
sub    %eax,%esi
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @onSameCol(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* %4
%7 = srem i32 %6, 8
%8 = load i32, i32* %5
%9 = srem i32 %8, 8
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @onSameCol(i32 %0, i32 %1) {
%3 = srem i32 %0, 8
%4 = srem i32 %1, 8
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int f427(int *);
int f428(int *p) { return f427(p); }


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

x86 assembly (clang, -O2):
<f428>:
jmp    1030 <f427@plt>

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

LLVM IR (-O2):
define i32 @f428(i32* %0) {
%2 = tail call i32 @f427(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getmtime(void) {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  return (uint64_t)1000000 * tp.tv_sec + tp.tv_usec;
}


x86 assembly (clang, -O0):
<getmtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmtime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @getmtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 1000000, %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @getmtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ interrupt(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void printString(char *message) {
  char *current = message;
  while (*current != '\0') {
    interrupt(0x10, 0xe * 256 + (*current), 0, 0, 0);
    current++;
  }
  return;
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <printString+0x55>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
add    $0xe00,%esi
mov    $0x10,%edi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <interrupt@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <printString+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1145 <printString+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%esi
add    $0xe00,%esi
mov    $0x10,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <interrupt@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <printString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = add nsw i32 %7, 3584
%9 = tail call i32 @interrupt(i32 16, i32 %8, i32 0, i32 0, i32 0)
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hi\cYaar"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"HicYaar\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"HicYaar\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int main(void) {
  printk("Hello!!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Hello!!\0A\00"
define i32 @main() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_CFint64_highword_reg(long long val) {
  return ((val >> 32) & (0xCF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CFint64_highword_reg>:
movabs $0xcf00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CFint64_highword_reg(i64 %0) {
%2 = and i64 %0, 889058230272
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
long strspn(char const *, char const *);
int portable(const char *path) {
  static const char charset[] = "abcdefghijklmnopqrstuvwxyz"
                                "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                "0123456789._-";
  long s;
  s = strspn(path, charset);
  if (path[s] != '\0')
    return (path[s]);
  return (-1);
}


x86 assembly (clang, -O0):
<portable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strspn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1159 <portable+0x49>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <portable+0x50>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
mov    (%rbx,%rax,1),%al
cmp    $0x1,%al
sbb    %ecx,%ecx
or     %al,%cl
movsbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
@portable.charset = internal constant [66 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-\00"
define i32 @portable(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strspn(i8* %5, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @portable.charset, i64 0, i64 0))
store i64 %6, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
store i32 %18, i32* %2
br label %20
19: ; preds = %1
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %13
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@portable.charset = internal constant [66 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._-\00"
define i32 @portable(i8* nocapture %0) {
%2 = tail call i64 @strspn(i8* %0, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @portable.charset, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i8 -1, i8 %4
%7 = sext i8 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ fcntl(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ open_rdonly(char *);
int /*<<< orphan*/ open_rdwr(char *);
int execute_fcntl() {
  fcntl(open_rdonly("syscalls.txt"), F_GETFL);
  fcntl(open_rdwr("syscalls2.txt"), F_GETFL);
  return 0;
}


x86 assembly (clang, -O0):
<execute_fcntl>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <open_rdonly@plt>
mov    %eax,%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
lea    0xeb6(%rip),%rdi
call   1050 <open_rdwr@plt>
mov    %eax,%edi
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_fcntl>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <open_rdonly@plt>
mov    0x2e9c(%rip),%rbx
mov    (%rbx),%esi
mov    %eax,%edi
call   1030 <fcntl@plt>
lea    0xeb9(%rip),%rdi
call   1050 <open_rdwr@plt>
mov    (%rbx),%esi
mov    %eax,%edi
call   1030 <fcntl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"syscalls.txt\00"
@F_GETFL = global i32 0
@.str.1 = [14 x i8] c"syscalls2.txt\00"
define i32 @execute_fcntl() {
%1 = call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @F_GETFL
%3 = call i32 @fcntl(i32 %1, i32 %2)
%4 = call i32 @open_rdwr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"syscalls.txt\00"
@F_GETFL = global i32 0
@.str.1 = [14 x i8] c"syscalls2.txt\00"
define i32 @execute_fcntl() {
%1 = tail call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %1, i32 %2)
%4 = tail call i32 @open_rdwr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @F_GETFL
%6 = tail call i32 @fcntl(i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gluInit(int *, char **);
int main(int argc, char **argv) {
  gluInit(&argc, argv);
  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    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1030 <gluInit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <gluInit@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 = load i8**, i8*** %5
%7 = call i32 @gluInit(i32* %4, i8** %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @gluInit(i32* %3, i8** %1)
ret i32 0
}
/* Type definitions */
struct gbm_surface {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct gbm_surface *);
__attribute__((visibility("default"))) void
gbm_surface_destroy(struct gbm_surface *surface) {
  free(surface);
}


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

x86 assembly (clang, -O2):
<gbm_surface_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.gbm_surface = type { i32 }
define void @gbm_surface_destroy(%struct.gbm_surface* %0) {
%2 = alloca %struct.gbm_surface*
store %struct.gbm_surface* %0, %struct.gbm_surface** %2
%3 = load %struct.gbm_surface*, %struct.gbm_surface** %2
%4 = call i32 @free(%struct.gbm_surface* %3)
ret void
}

LLVM IR (-O2):
%struct.gbm_surface = type { i32 }
define void @gbm_surface_destroy(%struct.gbm_surface* nocapture %0) {
%2 = tail call i32 @free(%struct.gbm_surface* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int fcntl(int, int /*<<< orphan*/);
int /*<<< orphan*/ throw(char *);
int get_socket_flags(int socket_fd) {
  int flags;
  if ((flags = fcntl(socket_fd, F_GETFL)) == -1) {
    throw("Error retrieving flags");
  }
  return flags;
}


x86 assembly (clang, -O0):
<get_socket_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1154 <get_socket_flags+0x34>
lea    0xeb1(%rip),%rdi
call   1040 <throw@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socket_flags>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1142 <get_socket_flags+0x22>
lea    0xec3(%rip),%rdi
call   1040 <throw@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@.str = [23 x i8] c"Error retrieving flags\00"
define i32 @get_socket_flags(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @throw(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@.str = [23 x i8] c"Error retrieving flags\00"
define i32 @get_socket_flags(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @throw(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 %3
}
int adis16240_probe_trigger(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @adis16240_probe_trigger(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DUART_PUTC(char);
void putchar(char c) { DUART_PUTC(c); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <DUART_PUTC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
jmp    1030 <DUART_PUTC@plt>

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

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = tail call i32 @DUART_PUTC(i8 signext %0)
ret void
}
int test_imm_DCint8_reg(signed char val) {
  return ((val) & (-0xDC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DCint8_reg>:
test   $0xffffff24,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DCint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -220
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void genc_un_s() {}


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

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

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

LLVM IR (-O2):
define void @genc_un_s() {
ret void
}
float Sleef_acoshf_u10(float x) { return __builtin_acoshf(x); }


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

x86 assembly (clang, -O2):
<Sleef_acoshf_u10>:
jmp    1030 <acoshf@plt>

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

LLVM IR (-O2):
define float @Sleef_acoshf_u10(float %0) {
%2 = tail call float @acoshf(float %0)
ret float %2
}
/* Variables and functions */
float vlength(float const *);
int /*<<< orphan*/ vscale(float *, float);
void vnormal(float *v) {
  float tmp;
  {
    tmp = vlength((float const *)v);
    vscale(v, (float)(1.0 / (double)tmp));
    return;
  }
}


x86 assembly (clang, -O0):
<vnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vlength@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <vscale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnormal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vlength@plt>
movss  0xecf(%rip),%xmm1
divss  %xmm0,%xmm1
mov    %rbx,%rdi
movaps %xmm1,%xmm0
pop    %rbx
jmp    1040 <vscale@plt>

LLVM IR (-O0):
define void @vnormal(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = call float @vlength(float* %4)
store float %5, float* %3
%6 = load float*, float** %2
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fdiv double 1.000000e+00, %8
%10 = fptrunc double %9 to float
%11 = call i32 @vscale(float* %6, float %10)
ret void
}

LLVM IR (-O2):
define void @vnormal(float* %0) {
%2 = tail call float @vlength(float* %0)
%3 = fdiv float 1.000000e+00, %2
%4 = tail call i32 @vscale(float* %0, float %3)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t read_bit_reg8(volatile uint8_t *reg, uint8_t bit) {
  return ((*(volatile unsigned int *)((
      (((uint32_t)reg & 0xF0000000) + 0x02000000 +
       (((uint32_t)reg & 0xFFFFF) << 5) + (bit << 2))))));
}


x86 assembly (clang, -O0):
<read_bit_reg8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf0000000,%eax
add    $0x2000000,%eax
mov    -0x8(%rbp),%rcx
and    $0xfffff,%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bit_reg8>:
mov    %edi,%eax
and    $0xf0000000,%eax
shl    $0x5,%edi
and    $0x1ffffe0,%edi
or     %eax,%edi
lea    (%rdi,%rsi,4),%eax
add    $0x2000000,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @read_bit_reg8(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 = ptrtoint i32* %5 to i32
%7 = and i32 %6, -268435456
%8 = add i32 %7, 33554432
%9 = load i32*, i32** %3
%10 = ptrtoint i32* %9 to i32
%11 = and i32 %10, 1048575
%12 = shl i32 %11, 5
%13 = add i32 %8, %12
%14 = load i32, i32* %4
%15 = shl i32 %14, 2
%16 = add i32 %13, %15
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @read_bit_reg8(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = and i32 %4, -268435456
%6 = shl i32 %4, 5
%7 = and i32 %6, 33554400
%8 = or i32 %5, %7
%9 = shl i32 %1, 2
%10 = add i32 %9, 33554432
%11 = add i32 %10, %8
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free_string(char *);
char *ipv6_bin(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void ipv6_bin_c(char *userInput, char *buf) {
  char *result = ipv6_bin(userInput);
  strcpy(buf, result);
  free_string(result);
}


x86 assembly (clang, -O0):
<ipv6_bin_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ipv6_bin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1050 <free_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_bin_c>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <ipv6_bin@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <free_string@plt>

LLVM IR (-O0):
define void @ipv6_bin_c(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @ipv6_bin(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free_string(i8* %11)
ret void
}

LLVM IR (-O2):
define void @ipv6_bin_c(i8* %0, i8* %1) {
%3 = tail call i8* @ipv6_bin(i8* %0)
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
%5 = tail call i32 @free_string(i8* %3)
ret void
}
void computeComputedConstants(double *variables) {
  variables[1] = variables[0] + variables[0];
  variables[2] = 0.001 * variables[0] + 0.001 * variables[0];
}


x86 assembly (clang, -O0):
<computeComputedConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xecb(%rip),%xmm1
mulsd  (%rax),%xmm1
movsd  0xebf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeComputedConstants>:
movsd  (%rdi),%xmm0
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdi)
mulsd  0xee7(%rip),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @computeComputedConstants(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fadd double %5, %8
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 1
store double %9, double* %11
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fmul double 1.000000e-03, %17
%19 = call double @llvm.fmuladd.f64(double 1.000000e-03, double %14, double %18)
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
store double %19, double* %21
ret void
}

LLVM IR (-O2):
define void @computeComputedConstants(double* nocapture %0) {
%2 = load double, double* %0
%3 = fadd double %2, %2
%4 = getelementptr inbounds double, double* %0, i64 1
store double %3, double* %4
%5 = fmul double %2, 1.000000e-03
%6 = tail call double @llvm.fmuladd.f64(double %2, double 1.000000e-03, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
store double %6, double* %7
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll22(struct __test_metadata *);
void wrapper_epoll22(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll22(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll22>:
jmp    1030 <epoll22@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll22(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll22(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll22(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll22(%struct.__test_metadata* %0)
ret void
}
void GC_default_pre_mark_function(void) {}


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

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

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

LLVM IR (-O2):
define void @GC_default_pre_mark_function() {
ret void
}
/* Variables and functions */
size_t eiki_strlen_zu(size_t x) {
  size_t digits = 0;
  if (!x) {
    return 1;
  }
  while (x) {
    digits++;
    x /= 10;
  }
  return digits;
}


x86 assembly (clang, -O0):
<eiki_strlen_zu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <eiki_strlen_zu+0x28>
movq   $0x1,-0x8(%rbp)
jmp    1163 <eiki_strlen_zu+0x63>
jmp    112d <eiki_strlen_zu+0x2d>
cmpq   $0x0,-0x10(%rbp)
je     115b <eiki_strlen_zu+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
jmp    112d <eiki_strlen_zu+0x2d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eiki_strlen_zu>:
test   %rdi,%rdi
je     113b <eiki_strlen_zu+0x3b>
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <eiki_strlen_zu+0x20>
mov    %rcx,%rax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @eiki_strlen_zu(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 0, i64* %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i64 1, i64* %2
br label %19
8: ; preds = %1
br label %9
9: ; preds = %12, %8
%10 = load i64, i64* %3
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i64, i64* %4
%14 = add i64 %13, 1
store i64 %14, i64* %4
%15 = load i64, i64* %3
%16 = udiv i64 %15, 10
store i64 %16, i64* %3
br label %9
17: ; preds = %9
%18 = load i64, i64* %4
store i64 %18, i64* %2
br label %19
19: ; preds = %17, %7
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @eiki_strlen_zu(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add i64 %4, 1
%7 = udiv i64 %5, 10
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %6, %3 ]
ret i64 %10
}
unsigned int la_version(unsigned int v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @la_version(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct grid {
  int dummy;
};
struct circle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ draw_arc(struct grid *, struct circle *, char,
                            int /*<<< orphan*/, int);
void draw_circle(struct grid *g, struct circle *c, char marker) {
  draw_arc(g, c, marker, 0, 2 * ((long double)3.14159265358979323));
}


x86 assembly (clang, -O0):
<draw_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    $0x6,%r8d
movsbl -0x11(%rbp),%edx
call   1030 <draw_arc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_circle>:
xor    %ecx,%ecx
mov    $0x6,%r8d
jmp    1030 <draw_arc@plt>

LLVM IR (-O0):
%struct.grid = type { i32 }
%struct.circle = type { i32 }
define void @draw_circle(%struct.grid* %0, %struct.circle* %1, i8 signext %2) {
%4 = alloca %struct.grid*
%5 = alloca %struct.circle*
%6 = alloca i8
store %struct.grid* %0, %struct.grid** %4
store %struct.circle* %1, %struct.circle** %5
store i8 %2, i8* %6
%7 = load %struct.grid*, %struct.grid** %4
%8 = load %struct.circle*, %struct.circle** %5
%9 = load i8, i8* %6
%10 = call i32 @draw_arc(%struct.grid* %7, %struct.circle* %8, i8 signext %9, i32 0, i32 6)
ret void
}

LLVM IR (-O2):
%struct.grid = type { i32 }
%struct.circle = type { i32 }
define void @draw_circle(%struct.grid* %0, %struct.circle* %1, i8 signext %2) {
%4 = tail call i32 @draw_arc(%struct.grid* %0, %struct.circle* %1, i8 signext %2, i32 0, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jump_table_a();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("CFG Test #2\n");
  jump_table_a();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <jump_table_a@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [12 x i8] c"CFG Test\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 (...) @jump_table_a()
ret i32 0
}
int modulo(int a, int b) { return ((a %= b) < 0 ? a + b : a); }


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmp    $0x0,%edx
jge    112d <modulo+0x2d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <modulo+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ nice(int);
void thread_set_low_priority() { nice(39); }


x86 assembly (clang, -O0):
<thread_set_low_priority>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%edi
call   1030 <nice@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_set_low_priority>:
mov    $0x27,%edi
jmp    1030 <nice@plt>

LLVM IR (-O0):
define void @thread_set_low_priority() {
%1 = call i32 @nice(i32 39)
ret void
}

LLVM IR (-O2):
define void @thread_set_low_priority() {
%1 = tail call i32 @nice(i32 39)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_WIND(int /*<<< orphan*/);
int gen_WIND() { handle_WIND(0); }


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

x86 assembly (clang, -O2):
<gen_WIND>:
xor    %edi,%edi
jmp    1030 <handle_WIND@plt>

LLVM IR (-O0):
define i32 @gen_WIND() {
%1 = alloca i32
%2 = call i32 @handle_WIND(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_WIND() {
%1 = tail call i32 @handle_WIND(i32 0)
ret i32 undef
}
int ft_isascii(int c) { return ((c >= 0 && c < 128) ? 1 : 0); }


x86 assembly (clang, -O0):
<ft_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <ft_isascii+0x23>
cmpl   $0x80,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 128
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
float __infer_nondet_float();
float logbf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<logbf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @logbf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @logbf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
char *clerror(void) { return (0); }


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

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

LLVM IR (-O0):
define i8* @clerror() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @clerror() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xc3() {
  Assert_real((isbdigit(195) == 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_isbdigit.c",
              980, ("isbdigit should be 0 for 0xc3"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xc3>:
push   %rax
mov    $0xc3,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3d4,%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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xc3\00"
define void @t_isbdigit_0xc3() {
%1 = call i64 @isbdigit(i32 195)
%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 980, 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xc3\00"
define void @t_isbdigit_0xc3() {
%1 = tail call i64 @isbdigit(i32 195)
%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 980, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void init_external_clocks() {
  *(volatile unsigned long *)((void *)0xfffffc00 + 0x48) =
      0x01 | (((2) & 7) << 2);
}


x86 assembly (clang, -O0):
<init_external_clocks>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffc00,%eax
movq   $0x9,0x48(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_external_clocks>:
mov    $0xfffffc48,%eax
movq   $0x9,(%rax)
ret

LLVM IR (-O0):
define void @init_external_clocks() {
store volatile i64 9, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966272 to i8*), i64 72) to i64*)
ret void
}

LLVM IR (-O2):
define void @init_external_clocks() {
store volatile i64 9, i64* inttoptr (i64 4294966344 to i64*)
ret void
}
/* Variables and functions */
float log10(float);
float LOG10(float x) { return log10(x); }


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

x86 assembly (clang, -O2):
<LOG10>:
jmp    1030 <log10@plt>

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

LLVM IR (-O2):
define float @LOG10(float %0) {
%2 = tail call float @log10(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ svc(int, void *);
void qemu_semihost_exit(int retcode) {
  if (retcode == 0)
    svc(0x18, (void *)0x20026);
  else
    svc(0x18, (void *)retcode);
}


x86 assembly (clang, -O0):
<qemu_semihost_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1139 <qemu_semihost_exit+0x29>
mov    $0x18,%edi
mov    $0x20026,%esi
call   1030 <svc@plt>
jmp    1147 <qemu_semihost_exit+0x37>
movslq -0x4(%rbp),%rsi
mov    $0x18,%edi
call   1030 <svc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qemu_semihost_exit>:
test   %edi,%edi
movslq %edi,%rax
mov    $0x20026,%esi
cmovne %rax,%rsi
mov    $0x18,%edi
jmp    1030 <svc@plt>

LLVM IR (-O0):
define void @qemu_semihost_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @svc(i32 24, i8* inttoptr (i64 131110 to i8*))
br label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @svc(i32 24, i8* %10)
br label %12
12: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @qemu_semihost_exit(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = select i1 %2, i8* inttoptr (i64 131110 to i8*), i8* %4
%6 = tail call i32 @svc(i32 24, i8* %5)
ret void
}