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

/* Variables and functions */
int codetokey(int /*<<< orphan*/);
int /*<<< orphan*/ getch();
int32_t deemacs_next_key() {
  int32_t key = codetokey(getch());
  while (key == 02000) {
    key = codetokey(getch()) | 02000;
  }
  return key;
}


x86 assembly (clang, -O0):
<deemacs_next_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,%edi
call   1030 <codetokey@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x400,-0x4(%rbp)
jne    1161 <deemacs_next_key+0x41>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,%edi
call   1030 <codetokey@plt>
or     $0x400,%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <deemacs_next_key+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deemacs_next_key>:
push   %rax
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%edi
call   1030 <codetokey@plt>
cmp    $0x400,%eax
jne    115a <deemacs_next_key+0x3a>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%edi
call   1030 <codetokey@plt>
or     $0x400,%eax
cmp    $0x400,%eax
je     1140 <deemacs_next_key+0x20>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @deemacs_next_key() {
%1 = alloca i32
%2 = call i32 (...) @getch()
%3 = call i32 @codetokey(i32 %2)
store i32 %3, i32* %1
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 1024
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 (...) @getch()
%9 = call i32 @codetokey(i32 %8)
%10 = or i32 %9, 1024
store i32 %10, i32* %1
br label %4
11: ; preds = %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @deemacs_next_key() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @codetokey(i32 %1)
%3 = icmp eq i32 %2, 1024
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @getch()
%6 = tail call i32 @codetokey(i32 %5)
%7 = or i32 %6, 1024
%8 = icmp eq i32 %7, 1024
br i1 %8, label %4, label %9
9: ; preds = %4, %0
%10 = phi i32 [ %2, %0 ], [ %7, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int int32_t;

/* Variables and functions */
void int16_to_char(int32_t int16, uint8_t *c) {
  c[0] = int16 & 0xff;
  c[1] = (int16 & 0xff00) >> 8;
}


x86 assembly (clang, -O0):
<int16_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int16_to_char>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define void @int16_to_char(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @int16_to_char(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
ret void
}
unsigned long _ulSetXMemSize(unsigned long ulSize) { return (2); }


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

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

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

LLVM IR (-O2):
define i64 @_ulSetXMemSize(i64 %0) {
ret i64 2
}
/* Type definitions */
struct genome_struct {
  int dummy;
};

/* Variables and functions */
int calculate_offset(struct genome_struct *, struct genome_struct *, int);
int invdist_noncircular_nomem(struct genome_struct *, struct genome_struct *,
                              int, int);
int invdist_circular_nomem(struct genome_struct *g1, struct genome_struct *g2,
                           int num_genes) {
  int offset;
  offset = calculate_offset(g1, g2, num_genes);
  return (invdist_noncircular_nomem(g1, g2, offset, num_genes));
}


x86 assembly (clang, -O0):
<invdist_circular_nomem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <calculate_offset@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <invdist_noncircular_nomem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invdist_circular_nomem>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <calculate_offset@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <invdist_noncircular_nomem@plt>

LLVM IR (-O0):
%struct.genome_struct = type { i32 }
define i32 @invdist_circular_nomem(%struct.genome_struct* %0, %struct.genome_struct* %1, i32 %2) {
%4 = alloca %struct.genome_struct*
%5 = alloca %struct.genome_struct*
%6 = alloca i32
%7 = alloca i32
store %struct.genome_struct* %0, %struct.genome_struct** %4
store %struct.genome_struct* %1, %struct.genome_struct** %5
store i32 %2, i32* %6
%8 = load %struct.genome_struct*, %struct.genome_struct** %4
%9 = load %struct.genome_struct*, %struct.genome_struct** %5
%10 = load i32, i32* %6
%11 = call i32 @calculate_offset(%struct.genome_struct* %8, %struct.genome_struct* %9, i32 %10)
store i32 %11, i32* %7
%12 = load %struct.genome_struct*, %struct.genome_struct** %4
%13 = load %struct.genome_struct*, %struct.genome_struct** %5
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = call i32 @invdist_noncircular_nomem(%struct.genome_struct* %12, %struct.genome_struct* %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.genome_struct = type { i32 }
define i32 @invdist_circular_nomem(%struct.genome_struct* %0, %struct.genome_struct* %1, i32 %2) {
%4 = tail call i32 @calculate_offset(%struct.genome_struct* %0, %struct.genome_struct* %1, i32 %2)
%5 = tail call i32 @invdist_noncircular_nomem(%struct.genome_struct* %0, %struct.genome_struct* %1, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char a = getchar();
  char b = getchar();
  putchar(getchar());
  putchar(b);
  putchar(a);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
movsbl -0x6(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
movsbl %bpl,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = call signext i8 (...) @getchar()
%7 = call i32 @putchar(i8 signext %6)
%8 = load i8, i8* %3
%9 = call i32 @putchar(i8 signext %8)
%10 = load i8, i8* %2
%11 = call i32 @putchar(i8 signext %10)
%12 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call signext i8 (...) @getchar()
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @putchar(i8 signext %3)
%5 = tail call i32 @putchar(i8 signext %2)
%6 = tail call i32 @putchar(i8 signext %1)
%7 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
unsigned long __hpte_page_size(unsigned long, unsigned long, int);
unsigned long hpte_base_page_size(unsigned long h, unsigned long l) {
  return __hpte_page_size(h, l, 1);
}


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

x86 assembly (clang, -O2):
<hpte_base_page_size>:
mov    $0x1,%edx
jmp    1030 <__hpte_page_size@plt>

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

LLVM IR (-O2):
define i64 @hpte_base_page_size(i64 %0, i64 %1) {
%3 = tail call i64 @__hpte_page_size(i64 %0, i64 %1, i32 1)
ret i64 %3
}
/* Variables and functions */
int write(int, unsigned char *, int);
int i2c_write_register(int fd, unsigned char reg_addr_or_cntrl,
                       unsigned char val) {
  unsigned char buff[2];
  int ret = 0;
  buff[0] = reg_addr_or_cntrl;
  buff[1] = val;
  ret = write(fd, buff, 2);
  if ((ret == -1) || (ret != 2))
    return -1;
  else
    return (ret);
}


x86 assembly (clang, -O0):
<i2c_write_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xc(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
je     1161 <i2c_write_register+0x51>
cmpl   $0x2,-0x10(%rbp)
je     116d <i2c_write_register+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <i2c_write_register+0x63>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_register>:
push   %rax
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
lea    (%rcx,%rcx,2),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @i2c_write_register(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %2, i8* %6
%7 = call i32 @write(i32 %0, i8* %5, i32 2)
%8 = icmp eq i32 %7, 2
%9 = select i1 %8, i32 2, i32 -1
ret i32 %9
}
unsigned foo(int x) {
  unsigned a = ((x & 1) | 2) & 0x80000000;
  unsigned b = ((x & 2) | 2) & 0x80000000;
  unsigned c = ((x & 4) | 2) & 0x80000000;
  return a + b + c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     $0x2,%eax
and    $0x80000000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
or     $0x2,%eax
and    $0x80000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
or     $0x2,%eax
and    $0x80000000,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = or i32 %7, 2
%9 = and i32 %8, -2147483648
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = and i32 %10, 2
%12 = or i32 %11, 2
%13 = and i32 %12, -2147483648
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = and i32 %14, 4
%16 = or i32 %15, 2
%17 = and i32 %16, -2147483648
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = add i32 %18, %19
%21 = load i32, i32* %5
%22 = add i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
void dfn_as(s) short s;
{}


x86 assembly (clang, -O0):
<dfn_as>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dfn_as(i32 %0) {
%2 = alloca i16
%3 = trunc i32 %0 to i16
store i16 %3, i16* %2
ret void
}

LLVM IR (-O2):
define void @dfn_as(i32 %0) {
ret void
}
/* Variables and functions */
int parse_long(int, char **, long *);
int parse_int(int argc, char *argv[], int *data) {
  long ldata;
  int result;
  if (!data)
    return -1;
  result = parse_long(argc, argv, &ldata);
  *data = (int)ldata;
  return result;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113a <parse_int+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <parse_int+0x4f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <parse_long@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
test   %rdx,%rdx
je     1133 <parse_int+0x23>
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0x8(%rsp),%rdx
call   1030 <parse_long@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @parse_int(i32 %0, i8** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
%10 = load i32*, i32** %7
%11 = icmp ne i32* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 -1, i32* %4
br label %21
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i8**, i8*** %6
%16 = call i32 @parse_long(i32 %14, i8** %15, i64* %8)
store i32 %16, i32* %9
%17 = load i64, i64* %8
%18 = trunc i64 %17 to i32
%19 = load i32*, i32** %7
store i32 %18, i32* %19
%20 = load i32, i32* %9
store i32 %20, i32* %4
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @parse_int(i32 %0, i8** %1, i32* writeonly %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = icmp eq i32* %2, null
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = call i32 @parse_long(i32 %0, i8** %1, i64* %4)
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %12
}
int __attribute__((no)) foo(void) { return 123; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 123
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 123
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fio_rand64();
uint64_t next(void) { return fio_rand64(); }


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

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

LLVM IR (-O0):
define i32 @next() {
%1 = call i32 (...) @fio_rand64()
ret i32 %1
}

LLVM IR (-O2):
define i32 @next() {
%1 = tail call i32 (...) @fio_rand64()
ret i32 %1
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s) {
  char *s2;
  s2 = malloc(strlen(s) + 1);
  strcpy(s2, s);
  return s2;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int addRecursively(void *elem, void *args) {
  int value = *((int *)elem);
  int *partialSum = (int *)args;
  *partialSum += value;
  return 0;
}


x86 assembly (clang, -O0):
<addRecursively>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @addRecursively(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %6
%12 = load i32, i32* %5
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %12
store i32 %15, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @addRecursively(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
store i32 %7, i32* %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x7f() {
  Assert_real((isupper(127) == 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_isupper.c",
              640, ("isupper should be 0 for 0x7f"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x280,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x7f\00"
define void @t_isupper_0x7f() {
%1 = call i64 @isupper(i32 127)
%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 640, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x7f\00"
define void @t_isupper_0x7f() {
%1 = tail call i64 @isupper(i32 127)
%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 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int home_handler(char **save) {
  write_instr(0x00);
  write_imm(0x4A);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<home_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4a,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<home_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4a,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @home_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 74)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @home_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 74)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
int compute_sample(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @compute_sample(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int num_online_cpus() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<num_online_cpus>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_online_cpus>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @num_online_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @num_online_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void output_values_weight_us(double main_out_value, double sec_out_value) {
  printf("Your converted value is %g pounds, %g ounces\n\n", main_out_value,
         sec_out_value);
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"Your converted value is %g pounds, %g ounces\0A\0A\00"
define void @output_values_weight_us(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Your converted value is %g pounds, %g ounces\0A\0A\00"
define void @output_values_weight_us(double %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %0, double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data_clr(int, int);
void rem_off() { data_clr(2, 1); }


x86 assembly (clang, -O0):
<rem_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <data_clr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rem_off>:
mov    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <data_clr@plt>

LLVM IR (-O0):
define void @rem_off() {
%1 = call i32 @data_clr(i32 2, i32 1)
ret void
}

LLVM IR (-O2):
define void @rem_off() {
%1 = tail call i32 @data_clr(i32 2, i32 1)
ret void
}
/* Type definitions */
typedef long int32_t;

/* Variables and functions */
int /*<<< orphan*/ CAS(long, long, long volatile *);
long INC_ATOMIC(volatile int32_t *val) {
  int32_t actual;
  do {
    actual = *val;
  } while (!CAS(actual, actual + 1, val));
  return actual;
}


x86 assembly (clang, -O0):
<INC_ATOMIC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x8(%rbp),%rdx
call   1030 <CAS@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111c <INC_ATOMIC+0xc>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INC_ATOMIC>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%rbx
lea    0x1(%rbx),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <CAS@plt>
test   %eax,%eax
je     1120 <INC_ATOMIC+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @INC_ATOMIC(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
br label %4
4: ; preds = %7, %1
%5 = load i64*, i64** %2
%6 = load volatile i64, i64* %5
store i64 %6, i64* %3
br label %7
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i64, i64* %3
%10 = add nsw i64 %9, 1
%11 = load i64*, i64** %2
%12 = call i32 @CAS(i64 %8, i64 %10, i64* %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %4, label %15
15: ; preds = %7
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @INC_ATOMIC(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* %0
%4 = add nsw i64 %3, 1
%5 = tail call i32 @CAS(i64 %3, i64 %4, i64* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ bsGetUInt32();
unsigned int bsGetInt32(void) { return (int)bsGetUInt32(); }


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

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

LLVM IR (-O0):
define i32 @bsGetInt32() {
%1 = call i64 (...) @bsGetUInt32()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @bsGetInt32() {
%1 = tail call i64 (...) @bsGetUInt32()
%2 = trunc i64 %1 to i32
ret i32 %2
}
int count_digits(int n) {
  if (n == 0)
    return 0;
  return 1 + count_digits(n / 10);
}


x86 assembly (clang, -O0):
<count_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <count_digits+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1149 <count_digits+0x39>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <count_digits@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_digits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <count_digits+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <count_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sdiv i32 %4, 10
%7 = add nuw nsw i32 %5, 1
%8 = add i32 %4, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cb_data_destroy(void *data) { free(data); }


x86 assembly (clang, -O0):
<cb_data_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):
<cb_data_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cb_data_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/);
scalar_t__ isspace(int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
void skip_space(void) {
  int c;
  while ((c = getc(stdin)) != EOF) {
    if (isspace(c))
      continue;
    ungetc(c, stdin);
    return;
  }
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%eax
je     1180 <skip_space+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     116f <skip_space+0x3f>
jmp    1138 <skip_space+0x8>
mov    -0x4(%rbp),%edi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %r15
push   %r14
push   %rbx
mov    0x2eac(%rip),%r14
mov    0x2e9d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14),%edi
call   1050 <getc@plt>
cmp    (%r15),%eax
je     117a <skip_space+0x4a>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1150 <skip_space+0x20>
mov    (%r14),%esi
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <ungetc@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define void @skip_space() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* @stdin
%4 = call i32 @getc(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i64 @isspace(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %2
12: ; preds = %7
%13 = load i32, i32* %1
%14 = load i32, i32* @stdin
%15 = call i32 @ungetc(i32 %13, i32 %14)
br label %16
16: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define void @skip_space() {
br label %1
1: ; preds = %6, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @getc(i32 %2)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = tail call i64 @isspace(i32 %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %1
9: ; preds = %6
%10 = load i32, i32* @stdin
%11 = tail call i32 @ungetc(i32 %3, i32 %10)
br label %12
12: ; preds = %1, %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setguardsize(int /*<<< orphan*/ *, size_t);
int my_pthread_attr_setguardsize(pthread_attr_t *__attr, size_t guard_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_setguardsize(realattr, guard_size);
}


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

x86 assembly (clang, -O2):
<my_pthread_attr_setguardsize>:
movslq (%rdi),%rdi
jmp    1030 <pthread_attr_setguardsize@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setguardsize(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i64, i64* %4
%12 = call i32 @pthread_attr_setguardsize(i32* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setguardsize(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setguardsize(i32* %5, i64 %1)
ret i32 %6
}
/* Variables and functions */
float expf(float const);
float Maths_Exp(const float number) { return expf(number); }


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

x86 assembly (clang, -O2):
<Maths_Exp>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @Maths_Exp(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
struct TYPE_3__ {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
struct itimerval {
  TYPE_2__ member_1;
  TYPE_1__ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int /*<<< orphan*/ setitimer(int /*<<< orphan*/, struct itimerval const *,
                             int /*<<< orphan*/);
void chx_systick_reset(void) {
  const struct itimerval it = {{0, 0}, {0, 0}};
  setitimer(ITIMER_REAL, &it, 0);
}


x86 assembly (clang, -O0):
<chx_systick_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <setitimer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chx_systick_reset>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <setitimer@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@ITIMER_REAL = global i32 0
define void @chx_systick_reset() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = load i32, i32* @ITIMER_REAL
%4 = call i32 @setitimer(i32 %3, %struct.itimerval* %1, i32 0)
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@ITIMER_REAL = global i32 0
define void @chx_systick_reset() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = load i32, i32* @ITIMER_REAL
%4 = call i32 @setitimer(i32 %3, %struct.itimerval* %1, i32 0)
ret void
}
/* Variables and functions */
int close(int);
int stream__close(void *cookie) { return close((int)cookie); }


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

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

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

LLVM IR (-O2):
define i32 @stream__close(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @close(i32 %3)
ret i32 %4
}
void XMoveWindow() {}


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

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

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

LLVM IR (-O2):
define void @XMoveWindow() {
ret void
}
/* Variables and functions */
float atanf(float const);
void glmATan3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = atanf(x[i]);
}


x86 assembly (clang, -O0):
<glmATan3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmATan3f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <atanf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmATan3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmATan3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <atanf@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <atanf@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <atanf@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @glmATan3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @atanf(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @atanf(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @atanf(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
void av_hwframe_transfer_data() {}


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

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

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

LLVM IR (-O2):
define void @av_hwframe_transfer_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void uninitvar_system(void) {
  char *c;
  (void)system(c);
}


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

x86 assembly (clang, -O2):
<uninitvar_system>:
jmp    1030 <system@plt>

LLVM IR (-O0):
define void @uninitvar_system() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @system(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_system() {
%1 = tail call i32 @system(i8* undef)
ret void
}
/* Variables and functions */
unsigned char serial_in();
unsigned char serial_in_lowercase(void) {
  unsigned char ch = serial_in();
  if (ch == '\r')
    ch = '\n';
  if ('A' <= ch && ch <= 'Z')
    ch = ch - 'A' + 'a';
  return ch;
}


x86 assembly (clang, -O0):
<serial_in_lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <serial_in@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    1133 <serial_in_lowercase+0x23>
movb   $0xa,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     115e <serial_in_lowercase+0x4e>
movzbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     115e <serial_in_lowercase+0x4e>
movzbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_in_lowercase>:
push   %rax
xor    %eax,%eax
call   1030 <serial_in@plt>
cmp    $0xd,%al
movzbl %al,%eax
mov    $0xa,%ecx
cmovne %eax,%ecx
lea    -0x41(%rcx),%eax
lea    0x20(%rcx),%edx
cmp    $0x1a,%al
movzbl %dl,%eax
cmovae %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @serial_in_lowercase() {
%1 = alloca i8
%2 = call zeroext i8 (...) @serial_in()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 13
br i1 %5, label %6, label %7
6: ; preds = %0
store i8 10, i8* %1
br label %7
7: ; preds = %6, %0
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
%10 = icmp sle i32 65, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8, i8* %1
%13 = zext i8 %12 to i32
%14 = icmp sle i32 %13, 90
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8, i8* %1
%17 = zext i8 %16 to i32
%18 = sub nsw i32 %17, 65
%19 = add nsw i32 %18, 97
%20 = trunc i32 %19 to i8
store i8 %20, i8* %1
br label %21
21: ; preds = %15, %11, %7
%22 = load i8, i8* %1
ret i8 %22
}

LLVM IR (-O2):
define zeroext i8 @serial_in_lowercase() {
%1 = tail call zeroext i8 (...) @serial_in()
%2 = icmp eq i8 %1, 13
%3 = select i1 %2, i8 10, i8 %1
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
%6 = add i8 %3, 32
%7 = select i1 %5, i8 %6, i8 %3
ret i8 %7
}
int host_get_version() {
  int version = 0;
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, "
                       "0x00"
                       "\n"
                       ".byte "
                       "0x00"
                       ", 0x00\n"
                       ".byte 0x00, 0x00, 0x00\n"
                       ".byte 0x00\n"
                       : "=a"(version));
  return version;
}


x86 assembly (clang, -O0):
<host_get_version>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
(bad)
...
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_get_version>:
(bad)
...
ret

LLVM IR (-O0):
define i32 @host_get_version() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @host_get_version() {
%1 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00\0A.byte 0x00, 0x00, 0x00\0A.byte 0x00\0A", "={ax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ list_compare(int *);
int value_compare(int *a) {
  if (a)
    list_compare(a);
}


x86 assembly (clang, -O0):
<value_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1130 <value_compare+0x20>
mov    -0x10(%rbp),%rdi
call   1030 <list_compare@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_compare>:
test   %rdi,%rdi
je     111f <value_compare+0xf>
push   %rax
call   1030 <list_compare@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @value_compare(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** %3
%8 = call i32 @list_compare(i32* %7)
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @value_compare(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @list_compare(i32* %0)
br label %5
5: ; preds = %3, %1
ret i32 undef
}
int cmp(const void *a, const void *b) { return *(long *)a - *(long *)b; }


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

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

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int _unlink(char *name) {
  if (name) {
  }
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <_unlink+0x18>
jmp    1118 <_unlink+0x18>
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* @ENOENT
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
void hda9_(void) {}


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

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

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

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