xunge/DecIR huggingface dataset:
/* Variables and functions */
int rand();
unsigned short generate_random_valid_port() {
  return (rand() % 65535) & 0xFFFF;
}


x86 assembly (clang, -O0):
<generate_random_valid_port>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xffff,%ecx
cltd
idiv   %ecx
and    $0xffff,%edx
mov    %dx,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_valid_port>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff80008001,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
shr    $0xf,%eax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @generate_random_valid_port() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 65535
%3 = and i32 %2, 65535
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @generate_random_valid_port() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 65535
%3 = trunc i32 %2 to i16
ret i16 %3
}
/* Variables and functions */
int skips(int);
int disambget(int lvl, int off, int n) {
  int delta = (skips(lvl) + 1) * n;
  return off + delta;
}


x86 assembly (clang, -O0):
<disambget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <skips@plt>
add    $0x1,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disambget>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <skips@plt>
add    $0x1,%eax
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @disambget(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = call i32 @skips(i32 %8)
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @disambget(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @skips(i32 %0)
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, %2
%7 = add nsw i32 %6, %1
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t U8TO32_LE(const unsigned char *p) {
  return (((uint32_t)(p[0])) | ((uint32_t)(p[1]) << 8) |
          ((uint32_t)(p[2]) << 16) | ((uint32_t)(p[3]) << 24));
}


x86 assembly (clang, -O0):
<U8TO32_LE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @U8TO32_LE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @U8TO32_LE(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
const unsigned char *skip(const unsigned char *in) {
  while (in && *in && (*in <= 32)) {
    in++;
  }
  return in;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113d <skip+0x3d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     113d <skip+0x3d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114d <skip+0x4d>
jmp    115e <skip+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
test   %rdi,%rdi
je     1121 <skip+0x21>
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xff,%cl
cmp    $0x20,%cl
jb     1110 <skip+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @skip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %18, %1
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 32
br label %16
16: ; preds = %11, %6, %3
%17 = phi i1 [ false, %6 ], [ false, %3 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %3
21: ; preds = %16
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @skip(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = add i8 %5, -1
%7 = icmp ult i8 %6, 32
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %3, label %9
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
void foo1(void) {
  int buf[10];
  buf[10] = 3;
}


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo1() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
store i32 3, i32* %2
ret void
}

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

/* Variables and functions */
uint16_t be16dec(const uint8_t *buf) {
  return (uint16_t)(buf[0] << 8 | buf[1]);
}


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

x86 assembly (clang, -O2):
<be16dec>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @be16dec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @be16dec(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, long);
void string__NativeString__copy_to(char *self, char *p0, long p1, long p2,
                                   long p3) {
  memcpy(p0 + p3, self + p2, p1);
RET_LABEL:;
}


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

x86 assembly (clang, -O2):
<string__NativeString__copy_to>:
lea    (%rsi,%r8,1),%rax
lea    (%rdi,%rcx,1),%rsi
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @string__NativeString__copy_to(i8* %0, i8* %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %7
%12 = load i64, i64* %10
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8*, i8** %6
%15 = load i64, i64* %9
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i64, i64* %8
%18 = call i32 @memcpy(i8* %13, i8* %16, i64 %17)
br label %19
19: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @string__NativeString__copy_to(i8* %0, i8* %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i8, i8* %1, i64 %4
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = tail call i32 @memcpy(i8* %6, i8* %7, i64 %2)
ret void
}
/* Variables and functions */
int ipv6_addr_split_int(char *, char, int);
int ipv6_addr_split_prefix(char *addr_str) {
  return ipv6_addr_split_int(addr_str, '/', 128);
}


x86 assembly (clang, -O0):
<ipv6_addr_split_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
mov    $0x80,%edx
call   1030 <ipv6_addr_split_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_addr_split_prefix>:
mov    $0x2f,%esi
mov    $0x80,%edx
jmp    1030 <ipv6_addr_split_int@plt>

LLVM IR (-O0):
define i32 @ipv6_addr_split_prefix(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ipv6_addr_split_int(i8* %3, i8 signext 47, i32 128)
ret i32 %4
}

LLVM IR (-O2):
define i32 @ipv6_addr_split_prefix(i8* %0) {
%2 = tail call i32 @ipv6_addr_split_int(i8* %0, i8 signext 47, i32 128)
ret i32 %2
}
int floatformat_always_valid(const struct floatformat *fmt
                             __attribute__((unused)),
                             const char *from __attribute__((unused))) {
  return 1;
}


x86 assembly (clang, -O0):
<floatformat_always_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.floatformat = type opaque
define i32 @floatformat_always_valid(%struct.floatformat* %0, i8* %1) {
%3 = alloca %struct.floatformat*
%4 = alloca i8*
store %struct.floatformat* %0, %struct.floatformat** %3
store i8* %1, i8** %4
ret i32 1
}

LLVM IR (-O2):
%struct.floatformat = type opaque
define i32 @floatformat_always_valid(%struct.floatformat* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int readln(char *, int);
int main() {
  char s[10];
  int len = readln(s, 10);
  if (len > 0)
    printf("string=\"%s\", len=%d\n", s, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    $0xa,%esi
call   1040 <readln@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115d <main+0x3d>
lea    -0xe(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rdi
mov    $0xa,%esi
call   1040 <readln@plt>
test   %eax,%eax
jle    114a <main+0x2a>
lea    0xec2(%rip),%rdi
lea    0xe(%rsp),%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"string=\22%s\22, len=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @readln(i8* %4, i32 10)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
br label %12
12: ; preds = %8, %0
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [21 x i8] c"string=\22%s\22, len=%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @readln(i8* %2, i32 10)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
br label %7
7: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
size_t Heap_roundup(size_t size) {
  static int multsize = 4 * sizeof(int);
  if (size % multsize != 0)
    size += multsize - (size % multsize);
  return size;
}


x86 assembly (clang, -O0):
<Heap_roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq 0x2f0d(%rip),%rcx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
je     114c <Heap_roundup+0x4c>
movslq 0x2ef7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq 0x2ee8(%rip),%rcx
xor    %edx,%edx
div    %rcx
mov    -0x10(%rbp),%rax
sub    %rdx,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Heap_roundup>:
mov    %edi,%ecx
and    $0xf,%ecx
mov    $0x10,%eax
sub    %rcx,%rax
test   %rcx,%rcx
cmove  %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
@Heap_roundup.multsize = internal global i32 16
define i64 @Heap_roundup(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @Heap_roundup.multsize
%5 = sext i32 %4 to i64
%6 = urem i64 %3, %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i32, i32* @Heap_roundup.multsize
%10 = sext i32 %9 to i64
%11 = load i64, i64* %2
%12 = load i32, i32* @Heap_roundup.multsize
%13 = sext i32 %12 to i64
%14 = urem i64 %11, %13
%15 = sub i64 %10, %14
%16 = load i64, i64* %2
%17 = add i64 %16, %15
store i64 %17, i64* %2
br label %18
18: ; preds = %8, %1
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @Heap_roundup(i64 %0) {
%2 = and i64 %0, 15
%3 = icmp eq i64 %2, 0
%4 = sub nuw nsw i64 16, %2
%5 = select i1 %3, i64 0, i64 %4
%6 = add i64 %5, %0
ret i64 %6
}
int num_boxes(int len) {
  int aux = 0;
  if (len == 0)
    return 0;
  aux = len / 6;
  if (aux == 0)
    return 1;
  if (len % 6 == 0)
    return aux;
  else
    return aux + 1;
}


x86 assembly (clang, -O0):
<num_boxes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <num_boxes+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1170 <num_boxes+0x70>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1148 <num_boxes+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1170 <num_boxes+0x70>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <num_boxes+0x67>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <num_boxes+0x70>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_boxes>:
test   %edi,%edi
je     1140 <num_boxes+0x40>
lea    0x5(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xb,%ecx
jb     113f <num_boxes+0x3f>
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
imul   $0xaaaaaaab,%edi,%edx
add    $0x2aaaaaaa,%edx
ror    %edx
add    %ecx,%eax
cmp    $0x2aaaaaab,%edx
sbb    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @num_boxes(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = add i32 %0, 5
%5 = icmp ult i32 %4, 11
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = sdiv i32 %0, 6
%8 = srem i32 %0, 6
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = add nsw i32 %7, %10
br label %12
12: ; preds = %6, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xaa() {
  Assert_real((isdigit(170) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              855, ("isdigit should be 0 for 0xaa"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xaa>:
push   %rax
mov    $0xaa,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x357,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xaa\00"
define void @t_isdigit_0xaa() {
%1 = call i64 @isdigit(i32 170)
%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 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xaa\00"
define void @t_isdigit_0xaa() {
%1 = tail call i64 @isdigit(i32 170)
%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 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void func(struct Foo *foo) { (void)foo; }


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

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

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

LLVM IR (-O2):
%struct.Foo = type opaque
define void @func(%struct.Foo* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ static_func();
int main() {
  for (int i = 0; i < 10; ++i) {
    bar();
  }
  static_func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1155 <main+0x35>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1040 <static_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @bar()
%4 = tail call i32 (...) @bar()
%5 = tail call i32 (...) @bar()
%6 = tail call i32 (...) @bar()
%7 = tail call i32 (...) @bar()
%8 = tail call i32 (...) @bar()
%9 = tail call i32 (...) @bar()
%10 = tail call i32 (...) @bar()
%11 = tail call i32 (...) @static_func()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *);
void write_mem(const char *regname_data, const char *regname_address) {
  pA("PASMEM0(%s, T_SINT32, mem_ptr, %s);", regname_data, regname_address);
}


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

x86 assembly (clang, -O2):
<write_mem>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <pA@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"PASMEM0(%s, T_SINT32, mem_ptr, %s);\00"
define void @write_mem(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @pA(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"PASMEM0(%s, T_SINT32, mem_ptr, %s);\00"
define void @write_mem(i8* %0, i8* %1) {
%3 = tail call i32 @pA(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ log_oom(char *, int, char *);
void *lsd_nomem_error(char *file, int line, char *mesg) {
  log_oom(file, line, mesg);
  abort();
  return NULL;
}


x86 assembly (clang, -O0):
<lsd_nomem_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <log_oom@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<lsd_nomem_error>:
push   %rax
call   1040 <log_oom@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @log_oom(i8* %7, i32 %8, i8* %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define noalias i8* @lsd_nomem_error(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @log_oom(i8* %0, i32 %1, i8* %2)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ atx();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basAtx() { pushNumber(atx()); }


x86 assembly (clang, -O0):
<basAtx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <atx@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @basAtx() {
%1 = call i32 (...) @atx()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basAtx() {
%1 = tail call i32 (...) @atx()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t decode_u32le(uint8_t **cursor) {
  uint8_t *p = *cursor;
  *cursor += 4;
  return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
}


x86 assembly (clang, -O0):
<decode_u32le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
or     (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_u32le>:
mov    (%rdi),%rcx
lea    0x10(%rcx),%rax
mov    %rax,(%rdi)
mov    0xc(%rcx),%edx
shl    $0x18,%edx
mov    0x4(%rcx),%eax
mov    0x8(%rcx),%esi
shl    $0x10,%esi
or     %edx,%esi
shl    $0x8,%eax
or     %esi,%eax
or     (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @decode_u32le(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
store i32* %5, i32** %3
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 4
store i32* %8, i32** %6
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 3
%11 = load i32, i32* %10
%12 = shl i32 %11, 24
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 16
%17 = or i32 %12, %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = shl i32 %20, 8
%22 = or i32 %17, %21
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 0
%25 = load i32, i32* %24
%26 = or i32 %22, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @decode_u32le(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 4
store i32* %3, i32** %0
%4 = getelementptr inbounds i32, i32* %2, i64 3
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = getelementptr inbounds i32, i32* %2, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %9, %6
%11 = getelementptr inbounds i32, i32* %2, i64 1
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = or i32 %14, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((weak)) weakDefault(void) {
  printf("default implementation");
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"default implementation\00"
define weak void @weakDefault() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"default implementation\00"
define weak void @weakDefault() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
void updateSeriesArchive(unsigned int seriesID, const char *archived) {
  return;
}


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

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

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

LLVM IR (-O2):
define void @updateSeriesArchive(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void le_read64(void *dest, const void *src) {
  char *cdest = (char *)dest;
  const char *csrc = (const char *)src;
  if (1) {
    memcpy(dest, src, 8);
  } else {
    int i;
    for (i = 0; i < 8; i++) {
      cdest[i] = csrc[7 - i];
    }
  }
}


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

x86 assembly (clang, -O2):
<le_read64>:
mov    $0x8,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @le_read64(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 8)
ret void
}
void nseel_asm_assign_fromfp(void) {
  __asm__("fstpl (%edi)\n"
          "movl 4(%edi), %edx\n"
          "addl $0x00100000, %edx\n"
          "andl $0x7FF00000, %edx\n"
          "cmpl $0x00100000, %edx\n"
          "movl %edi, %eax\n"
          "jg 0f\n"
          "subl %edx, %edx\n"
          "movl %edx, (%edi)\n"
          "movl %edx, 4(%edi)\n"
          "0:\n");
}


x86 assembly (clang, -O0):
<nseel_asm_assign_fromfp>:
push   %rbp
mov    %rsp,%rbp
fstpl  (%edi)
mov    0x4(%edi),%edx
add    $0x100000,%edx
and    $0x7ff00000,%edx
cmp    $0x100000,%edx
mov    %edi,%eax
jg     112e <nseel_asm_assign_fromfp+0x2e>
sub    %edx,%edx
mov    %edx,(%edi)
mov    %edx,0x4(%edi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_assign_fromfp>:
fstpl  (%edi)
mov    0x4(%edi),%edx
add    $0x100000,%edx
and    $0x7ff00000,%edx
cmp    $0x100000,%edx
mov    %edi,%eax
jg     1126 <nseel_asm_assign_fromfp+0x26>
sub    %edx,%edx
mov    %edx,(%edi)
mov    %edx,0x4(%edi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_assign_fromfp() {
tail call void asm sideeffect "fstpl (%edi)\0Amovl 4(%edi), %edx\0Aaddl $$0x00100000, %edx\0Aandl $$0x7FF00000, %edx\0Acmpl $$0x00100000, %edx\0Amovl %edi, %eax\0Ajg 0f\0Asubl %edx, %edx\0Amovl %edx, (%edi)\0Amovl %edx, 4(%edi)\0A0:\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ diament(int, int);
int /*<<< orphan*/ owal(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prostokat(int, int);
int /*<<< orphan*/ strzalka(int, int);
int main() {
  prostokat(5, 6);
  printf("\t");
  owal(6, 6);
  printf("\t");
  strzalka(5, 6);
  printf("\t");
  diament(5, 6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x6,%esi
call   1050 <prostokat@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x6,%esi
mov    %esi,%edi
call   1060 <owal@plt>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x6,%esi
call   1070 <strzalka@plt>
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x6,%esi
call   1040 <diament@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x6,%esi
call   1050 <prostokat@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0x6,%edi
mov    $0x6,%esi
call   1060 <owal@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
mov    $0x6,%esi
call   1070 <strzalka@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
mov    $0x6,%esi
call   1040 <diament@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
define i32 @main() {
%1 = call i32 @prostokat(i32 5, i32 6)
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @owal(i32 6, i32 6)
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strzalka(i32 5, i32 6)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @diament(i32 5, i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @prostokat(i32 5, i32 6)
%2 = tail call i32 @putchar(i32 9)
%3 = tail call i32 @owal(i32 6, i32 6)
%4 = tail call i32 @putchar(i32 9)
%5 = tail call i32 @strzalka(i32 5, i32 6)
%6 = tail call i32 @putchar(i32 9)
%7 = tail call i32 @diament(i32 5, i32 6)
ret i32 0
}
long long unsigned int div16(long long unsigned int value) {
  return value >> 4;
}


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

x86 assembly (clang, -O2):
<div16>:
mov    %rdi,%rax
shr    $0x4,%rax
ret

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

LLVM IR (-O2):
define i64 @div16(i64 %0) {
%2 = lshr i64 %0, 4
ret i64 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ REG_UART_BASE(scalar_t__);
__attribute__((always_)) __attribute__((flatten)) uint32_t
UART_HIGHPULSE(uint32_t i) {
  return (REG_UART_BASE(i) + 0x2c);
}


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

x86 assembly (clang, -O2):
<UART_HIGHPULSE>:
push   %rax
call   1030 <REG_UART_BASE@plt>
add    $0x2c,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @UART_HIGHPULSE(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @REG_UART_BASE(i64 %3)
%5 = add nsw i64 %4, 44
ret i64 %5
}

LLVM IR (-O2):
define i64 @UART_HIGHPULSE(i64 %0) {
%2 = tail call i64 @REG_UART_BASE(i64 %0)
%3 = add nsw i64 %2, 44
ret i64 %3
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int32_t ori(int32_t reg1, uint16_t kte) { return (reg1 | kte); }


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

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

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

LLVM IR (-O2):
define i32 @ori(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
char _char_from_byte(uint8_t byte) {
  if ((byte >= '!') && (byte <= 0x7F)) {
    return (char)byte;
  } else if ('\n' == byte) {
    return '.';
  } else if ('\r' == byte) {
    return '.';
  } else if (' ' == byte) {
    return ' ';
  } else {
    return '.';
  }
}


x86 assembly (clang, -O0):
<_char_from_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x21,%eax
jl     112f <_char_from_byte+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jg     112f <_char_from_byte+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1181 <_char_from_byte+0x81>
movsbl -0x2(%rbp),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    1149 <_char_from_byte+0x49>
movb   $0x2e,-0x1(%rbp)
jmp    1181 <_char_from_byte+0x81>
movsbl -0x2(%rbp),%ecx
mov    $0xd,%eax
cmp    %ecx,%eax
jne    1163 <_char_from_byte+0x63>
movb   $0x2e,-0x1(%rbp)
jmp    1181 <_char_from_byte+0x81>
movsbl -0x2(%rbp),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
jne    117d <_char_from_byte+0x7d>
movb   $0x20,-0x1(%rbp)
jmp    1181 <_char_from_byte+0x81>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_char_from_byte>:
cmp    $0x20,%dil
mov    $0x20,%ecx
mov    $0x2e,%eax
cmove  %ecx,%eax
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @_char_from_byte(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 33
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 127
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %29
13: ; preds = %7, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 10, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 46, i8* %2
br label %29
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 13, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 46, i8* %2
br label %29
23: ; preds = %18
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 32, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i8 32, i8* %2
br label %29
28: ; preds = %23
store i8 46, i8* %2
br label %29
29: ; preds = %28, %27, %22, %17, %11
%30 = load i8, i8* %2
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @_char_from_byte(i8 signext %0) {
%2 = icmp sgt i8 %0, 32
%3 = icmp eq i8 %0, 32
%4 = select i1 %3, i8 32, i8 46
%5 = select i1 %2, i8 %0, i8 %4
ret i8 %5
}
void nop(char *addr, int size) {
  for (int i = 0; i < size; i++)
    addr[i] = 0x90;
}


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <nop+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x90,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <nop+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop>:
test   %esi,%esi
jle    1125 <nop+0x15>
push   %rax
mov    %esi,%edx
mov    $0x90,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @nop(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *Strdup(const char *source) {
  if (source != NULL)
    return strdup(source);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <Strdup+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <Strdup+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
test   %rdi,%rdi
je     111a <Strdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @Strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Type definitions */
struct stack_client {
  int dummy;
};
struct stack {
  int dummy;
};
struct linkedlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ atomic_noop();
void deactivate_local_hazard_pointers_lemma(struct stack *stack,
                                            struct stack_client *client,
                                            struct linkedlist *hpList) {
  { atomic_noop(); }
}


x86 assembly (clang, -O0):
<deactivate_local_hazard_pointers_lemma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <atomic_noop@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stack = type { i32 }
%struct.stack_client = type { i32 }
%struct.linkedlist = type { i32 }
define void @deactivate_local_hazard_pointers_lemma(%struct.stack* %0, %struct.stack_client* %1, %struct.linkedlist* %2) {
%4 = alloca %struct.stack*
%5 = alloca %struct.stack_client*
%6 = alloca %struct.linkedlist*
store %struct.stack* %0, %struct.stack** %4
store %struct.stack_client* %1, %struct.stack_client** %5
store %struct.linkedlist* %2, %struct.linkedlist** %6
%7 = call i32 (...) @atomic_noop()
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
%struct.stack_client = type { i32 }
%struct.linkedlist = type { i32 }
define void @deactivate_local_hazard_pointers_lemma(%struct.stack* nocapture readnone %0, %struct.stack_client* nocapture readnone %1, %struct.linkedlist* nocapture readnone %2) {
%4 = tail call i32 (...) @atomic_noop()
ret void
}
BOOST_AUTO_TEST_CASE(arcsec) { TESTCASE1(arcsec, 1, 0); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 1, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0)
ret i32 undef
}
int heap_bench_cmp(void *a, void *b) { return *(int *)a - *(int *)b; }


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

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

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

LLVM IR (-O2):
define i32 @heap_bench_cmp(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 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void getFilePath(char *filePath, bool checkTemp) {
  strcpy(filePath, getenv("HOME"));
  if (checkTemp) {
    strcat(filePath, "/.pa/commands_tmp");
  } else {
    strcat(filePath, "/.pa/commands");
  }
}


x86 assembly (clang, -O0):
<getFilePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb2(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
cmpl   $0x0,-0xc(%rbp)
je     117d <getFilePath+0x4d>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <strcat@plt>
jmp    118d <getFilePath+0x5d>
mov    -0x8(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFilePath>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <strcpy@plt>
test   %ebp,%ebp
lea    0xec0(%rip),%rax
lea    0xea7(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [18 x i8] c"/.pa/commands_tmp\00"
@.str.2 = [14 x i8] c"/.pa/commands\00"
define void @getFilePath(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @strcpy(i8* %5, i32 %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %16
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 @strcat(i8* %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [18 x i8] c"/.pa/commands_tmp\00"
@.str.2 = [14 x i8] c"/.pa/commands\00"
define void @getFilePath(i8* %0, i32 %1) {
%3 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcpy(i8* %0, i32 %3)
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 @strcat(i8* %0, i8* %6)
ret void
}
int fun160() { return 160; }


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

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

LLVM IR (-O0):
define i32 @fun160() {
ret i32 160
}

LLVM IR (-O2):
define i32 @fun160() {
ret i32 160
}
float sqrf(float a) { return a * a; }


x86 assembly (clang, -O0):
<sqrf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrf>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @sqrf(float %0) {
%2 = fmul float %0, %0
ret float %2
}