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

/* Variables and functions */
unsigned char *zrealloc(unsigned char *, unsigned int);
unsigned char *ziplistResize(unsigned char *zl, unsigned int len) {
  zl = zrealloc(zl, len);
  (*((uint32_t *)(zl))) = len;
  zl[len - 1] = 255;
  return zl;
}


x86 assembly (clang, -O0):
<ziplistResize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <zrealloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movb   $0xff,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ziplistResize>:
push   %rbx
mov    %esi,%ebx
call   1030 <zrealloc@plt>
mov    %ebx,(%rax)
add    $0xffffffff,%ebx
movb   $0xff,(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ziplistResize(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 = load i32, i32* %4
%7 = call i8* @zrealloc(i8* %5, i32 %6)
store i8* %7, i8** %3
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sub i32 %12, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 -1, i8* %15
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @ziplistResize(i8* %0, i32 %1) {
%3 = tail call i8* @zrealloc(i8* %0, i32 %1)
%4 = bitcast i8* %3 to i32*
store i32 %1, i32* %4
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
store i8 -1, i8* %7
ret i8* %3
}
int Gcd(int x, int y) {
  int z = x % y;
  while (z != 0) {
    x = y;
    y = z;
    z = x % y;
  }
  return y;
}


x86 assembly (clang, -O0):
<Gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1139 <Gcd+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1114 <Gcd+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gcd>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1120 <Gcd+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
mov    %esi,%eax
cltd
idiv   %ecx
mov    %ecx,%esi
test   %edx,%edx
jne    1110 <Gcd+0x10>
mov    %ecx,%eax
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Gcd(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %1, %2 ]
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ %1, %2 ], [ %6, %5 ]
ret i32 %11
}
int ChkDesKeyLen(unsigned long len) {
  return len != (8) && len != (2 * (8)) && len != (3 * (8)) ? (0) : (1);
}


x86 assembly (clang, -O0):
<ChkDesKeyLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x8,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <ChkDesKeyLen+0x33>
xor    %eax,%eax
cmpq   $0x10,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <ChkDesKeyLen+0x33>
cmpq   $0x18,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkDesKeyLen>:
mov    $0x1,%eax
cmp    $0x8,%rdi
je     1111 <ChkDesKeyLen+0x11>
cmp    $0x10,%rdi
jne    1112 <ChkDesKeyLen+0x12>
ret
xor    %eax,%eax
cmp    $0x18,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ChkDesKeyLen(i64 %0) {
switch i64 %0, label %2 [
i64 16, label %5
i64 8, label %5
]
2: ; preds = %1
%3 = icmp eq i64 %0, 24
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
chrdisp(chr) {
  register int c;
  c = chr;
  if (c < ' ')
    printf("<CTRL-%c>", c + '@');
  else
    printf("%c", c);
}


x86 assembly (clang, -O0):
<chrdisp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1144 <chrdisp+0x34>
mov    -0xc(%rbp),%esi
add    $0x40,%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1155 <chrdisp+0x45>
mov    -0xc(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrdisp>:
push   %rax
mov    %edi,%esi
cmp    $0x1f,%edi
jg     113b <chrdisp+0x1b>
add    $0x40,%esi
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rcx
ret
mov    %esi,%edi
call   1030 <putchar@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"<CTRL-%c>\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @chrdisp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 64
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %15
12: ; preds = %1
%13 = load i32, i32* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [10 x i8] c"<CTRL-%c>\00"
define i32 @chrdisp(i32 %0) {
%2 = icmp slt i32 %0, 32
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nsw i32 %0, 64
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %8
6: ; preds = %1
%7 = tail call i32 @putchar(i32 %0)
br label %8
8: ; preds = %6, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free_cliff_list(int /*<<< orphan*/);
int /*<<< orphan*/ get_ints_to_tidy();
int /*<<< orphan*/ tidy_ints();
void cliff_teardown() {
  tidy_ints();
  free_cliff_list(get_ints_to_tidy());
}


x86 assembly (clang, -O0):
<cliff_teardown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tidy_ints@plt>
mov    $0x0,%al
call   1050 <get_ints_to_tidy@plt>
mov    %eax,%edi
call   1040 <free_cliff_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cliff_teardown>:
push   %rax
xor    %eax,%eax
call   1030 <tidy_ints@plt>
xor    %eax,%eax
call   1050 <get_ints_to_tidy@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <free_cliff_list@plt>

LLVM IR (-O0):
define void @cliff_teardown() {
%1 = call i32 (...) @tidy_ints()
%2 = call i32 (...) @get_ints_to_tidy()
%3 = call i32 @free_cliff_list(i32 %2)
ret void
}

LLVM IR (-O2):
define void @cliff_teardown() {
%1 = tail call i32 (...) @tidy_ints()
%2 = tail call i32 (...) @get_ints_to_tidy()
%3 = tail call i32 @free_cliff_list(i32 %2)
ret void
}
void cmx_atomic_smp_mb(void) {
  __asm__ volatile("mfence" : : : "memory");
  return;
}


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

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

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

LLVM IR (-O2):
define void @cmx_atomic_smp_mb() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int rsock_scm_optname_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 5:
    return -1;
  case 6:
    return -1;
  case 7:
    return -1;
  case 9:
    return -1;
  case 10:
    return -1;
  case 11:
    return -1;
  case 13:
    return -1;
  case 15:
    return -1;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_scm_optname_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffb,%rax
mov    %rax,-0x28(%rbp)
sub    $0xa,%rax
ja     119a <rsock_scm_optname_to_int+0x9a>
mov    -0x28(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <rsock_scm_optname_to_int+0xa1>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rsock_scm_optname_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int nod(int);
int /*<<< orphan*/ printf(char *, int);
void find2() {
  int n = 1;
  while (nod(n) < 500) {
    n++;
  }
  printf("%d\n", n * (n + 1) / 2);
}


x86 assembly (clang, -O0):
<find2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <nod@plt>
cmp    $0x1f4,%eax
jge    1150 <find2+0x30>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <find2+0xf>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find2>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <nod@plt>
cmp    $0x1f4,%eax
jl     1130 <find2+0x10>
lea    0x1(%rbx),%esi
imul   %ebx,%esi
shr    %esi
lea    0xeb0(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @find2() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = call i32 @nod(i32 %3)
%5 = icmp slt i32 %4, 500
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
%13 = mul nsw i32 %10, %12
%14 = sdiv i32 %13, 2
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @find2() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 @nod(i32 %2)
%4 = icmp slt i32 %3, 500
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = mul nsw i32 %5, %2
%8 = lshr i32 %7, 1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}
int cairo_code_draw_envMaximumLabel_get_height() { return 73; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envMaximumLabel_get_height() {
ret i32 73
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envMaximumLabel_get_height() {
ret i32 73
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_tcp_socket() {
  int sock;
  if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
    perror("Can't create TCP socket");
    exit(1);
  }
  return sock;
}


x86 assembly (clang, -O0):
<create_tcp_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    117a <create_tcp_socket+0x4a>
lea    0xe95(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_tcp_socket>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
test   %eax,%eax
js     1157 <create_tcp_socket+0x27>
pop    %rcx
ret
lea    0xea2(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [24 x i8] c"Can't create TCP socket\00"
define i32 @create_tcp_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = load i32, i32* @IPPROTO_TCP
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [24 x i8] c"Can't create TCP socket\00"
define i32 @create_tcp_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %0
ret i32 %4
}
/* Type definitions */
struct mpd_pair {
  int dummy;
};
struct mpd_connection {
  int dummy;
};

/* Variables and functions */
struct mpd_pair *mpd_recv_pair_named(struct mpd_connection *, char *);
__attribute__((malloc)) struct mpd_pair *
mpd_recv_command_pair(struct mpd_connection *connection) {
  return mpd_recv_pair_named(connection, "command");
}


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

x86 assembly (clang, -O2):
<mpd_recv_command_pair>:
lea    0xee9(%rip),%rsi
jmp    1030 <mpd_recv_pair_named@plt>

LLVM IR (-O0):
%struct.mpd_pair = type { i32 }
%struct.mpd_connection = type { i32 }
@.str = [8 x i8] c"command\00"
define noalias %struct.mpd_pair* @mpd_recv_command_pair(%struct.mpd_connection* %0) {
%2 = alloca %struct.mpd_connection*
store %struct.mpd_connection* %0, %struct.mpd_connection** %2
%3 = load %struct.mpd_connection*, %struct.mpd_connection** %2
%4 = call %struct.mpd_pair* @mpd_recv_pair_named(%struct.mpd_connection* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.mpd_pair* %4
}

LLVM IR (-O2):
%struct.mpd_pair = type { i32 }
%struct.mpd_connection = type { i32 }
@.str = [8 x i8] c"command\00"
define noalias %struct.mpd_pair* @mpd_recv_command_pair(%struct.mpd_connection* %0) {
%2 = tail call %struct.mpd_pair* @mpd_recv_pair_named(%struct.mpd_connection* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.mpd_pair* %2
}
void pci_null_debug(const char *msg __attribute__((unused)), ...) {}


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

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

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

LLVM IR (-O2):
define void @pci_null_debug(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int setreuid(int /*<<< orphan*/, int /*<<< orphan*/);
int pthread_setreuid_np(uid_t ruid, uid_t euid) { return setreuid(ruid, euid); }


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

x86 assembly (clang, -O2):
<pthread_setreuid_np>:
jmp    1030 <setreuid@plt>

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

LLVM IR (-O2):
define i32 @pthread_setreuid_np(i32 %0, i32 %1) {
%3 = tail call i32 @setreuid(i32 %0, i32 %1)
ret i32 %3
}
void fusion_float_write(float *p, float f) { p[0x12345] = f; }


x86 assembly (clang, -O0):
<fusion_float_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x48d14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fusion_float_write>:
movss  %xmm0,0x48d14(%rdi)
ret

LLVM IR (-O0):
define void @fusion_float_write(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 74565
store float %5, float* %7
ret void
}

LLVM IR (-O2):
define void @fusion_float_write(float* nocapture writeonly %0, float %1) {
%3 = getelementptr inbounds float, float* %0, i64 74565
store float %1, float* %3
ret void
}
void view_clearStack() {}


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

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

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

LLVM IR (-O2):
define void @view_clearStack() {
ret void
}
int main(const int argc, const char *const *argv) {
  (void)argc;
  (void)argv;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char *pathncat(char *, char const *, size_t);
char *pathncat2(char *path0, const char *path1, const char *path2,
                size_t size) {
  pathncat(path0, path1, size);
  return pathncat(path0, path2, size);
}


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

x86 assembly (clang, -O2):
<pathncat2>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rcx,%rdx
call   1030 <pathncat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <pathncat@plt>

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

LLVM IR (-O2):
define i8* @pathncat2(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i8* @pathncat(i8* %0, i8* %1, i64 %3)
%6 = tail call i8* @pathncat(i8* %0, i8* %2, i64 %3)
ret i8* %6
}
/* Variables and functions */
int GET32(int);
unsigned int uart_getc(void) {
  while (1) {
    if (GET32(0x20215054) & 0x01) {
      break;
    }
  }
  return (GET32(0x20215040) & 0xFF);
}


x86 assembly (clang, -O0):
<uart_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_getc+0x9>
mov    $0x20215054,%edi
call   1030 <GET32@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <uart_getc+0x24>
jmp    1139 <uart_getc+0x29>
jmp    1119 <uart_getc+0x9>
mov    $0x20215040,%edi
call   1030 <GET32@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20215054,%edi
call   1030 <GET32@plt>
test   $0x1,%al
je     1120 <uart_getc+0x10>
mov    $0x20215040,%edi
call   1030 <GET32@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_getc() {
br label %1
1: ; preds = %0, %6
%2 = call i32 @GET32(i32 539054164)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
%8 = call i32 @GET32(i32 539054144)
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @uart_getc() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @GET32(i32 539054164)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 @GET32(i32 539054144)
%7 = and i32 %6, 255
ret i32 %7
}
int m_max_int(int left, int right) { return (left > right) ? left : right; }


x86 assembly (clang, -O0):
<m_max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <m_max_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <m_max_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_max_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @m_max_int(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @m_max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inorder(struct node *);
struct node *insert(struct node *, int);
int main() {
  struct node *root = NULL;
  root = insert(root, 50);
  inorder(root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x32,%esi
call   1040 <insert@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inorder@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x32,%esi
call   1040 <insert@plt>
mov    %rax,%rdi
call   1030 <inorder@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call %struct.node* @insert(%struct.node* %3, i32 50)
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call i32 @inorder(%struct.node* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.node* @insert(%struct.node* null, i32 50)
%2 = tail call i32 @inorder(%struct.node* %1)
ret i32 0
}
char *PlatformGetLine(char *Buf, int MaxLen) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @PlatformGetLine(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ removedead();
void territoryscore(void) { removedead(); }


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

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

LLVM IR (-O0):
define void @territoryscore() {
%1 = call i32 (...) @removedead()
ret void
}

LLVM IR (-O2):
define void @territoryscore() {
%1 = tail call i32 (...) @removedead()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x09() {
  Assert_real((isalnum(9) == 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_isalnum.c",
              50, ("isalnum should be 0 for 0x09"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x09>:
push   %rax
mov    $0x9,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x09\00"
define void @t_isalnum_0x09() {
%1 = call i64 @isalnum(i32 9)
%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 50, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x09\00"
define void @t_isalnum_0x09() {
%1 = tail call i64 @isalnum(i32 9)
%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 50, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gencos(int /*<<< orphan*/);
int /*<<< orphan*/ gencrc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  printf("/*\n * automatically generated by %s, do not edit!\n */\n\n"
         "#ifdef HAVE_CONFIG_H\n#include \"config.h\"\n#endif\n\n#include "
         "\"modem.h\"\n\n",
         argv[0]);
  gencos(stdout);
  gencrc(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <gencos@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <gencrc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rsi),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rbx
mov    (%rbx),%edi
call   1040 <gencos@plt>
mov    (%rbx),%edi
call   1050 <gencrc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [125 x i8] c"/*\0A * automatically generated by %s, do not edit!\0A */\0A\0A#ifdef HAVE_CONFIG_H\0A#include \22config.h\22\0A#endif\0A\0A#include \22modem.h\22\0A\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stdout
%11 = call i32 @gencos(i32 %10)
%12 = load i32, i32* @stdout
%13 = call i32 @gencrc(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [125 x i8] c"/*\0A * automatically generated by %s, do not edit!\0A */\0A\0A#ifdef HAVE_CONFIG_H\0A#include \22config.h\22\0A#endif\0A\0A#include \22modem.h\22\0A\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @gencos(i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @gencrc(i32 %7)
ret i32 0
}
void foo719() {}


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

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

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

LLVM IR (-O2):
define void @foo719() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay_us(int);
void Delay_ms(int delayms) {
  while (delayms != 0) {
    Delay_us(1000);
    delayms--;
  }
}


x86 assembly (clang, -O0):
<Delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113d <Delay_ms+0x2d>
mov    $0x3e8,%edi
call   1030 <Delay_us@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <Delay_ms+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay_ms>:
push   %rbx
test   %edi,%edi
je     112f <Delay_ms+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <Delay_us@plt>
add    $0xffffffff,%ebx
jne    1120 <Delay_ms+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Delay_ms(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @Delay_us(i32 1000)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void write_shield_data_to_demo(struct entity_t *shield) { ; }


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

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

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

LLVM IR (-O2):
%struct.entity_t = type opaque
define void @write_shield_data_to_demo(%struct.entity_t* nocapture %0) {
ret void
}
int hash_block_size() { return 4; }


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

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

LLVM IR (-O0):
define i32 @hash_block_size() {
ret i32 4
}

LLVM IR (-O2):
define i32 @hash_block_size() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("KABIR\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"KABIR\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_area(double area) { printf("The area is %.2lf\n", area); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"The area is %.2lf\0A\00"
define void @print_area(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"The area is %.2lf\0A\00"
define void @print_area(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
void test___atomic_nand_fetch_0(char *mem) { __atomic_nand_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_nand_fetch_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test___atomic_nand_fetch_0+0x4f>
jmp    111f <test___atomic_nand_fetch_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
and    %cl,%al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_nand_fetch_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
or     $0xfe,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test___atomic_nand_fetch_0+0x10>
ret

LLVM IR (-O0):
define void @test___atomic_nand_fetch_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw nand i8* %5, i8 %6 acq_rel
%8 = and i8 %7, %6
%9 = xor i8 %8, -1
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_nand_fetch_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lotlistGetServer(char *, int);
int /*<<< orphan*/ lotlistLoad();
int /*<<< orphan*/ lotlistMarkLocals(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char buff[512];
  lotlistLoad();
  lotlistGetServer(buff, 3000);
  printf("server: %s\n", buff);
  lotlistMarkLocals("bbs-001.boitho.com");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
mov    $0x0,%al
call   1050 <lotlistLoad@plt>
lea    -0x200(%rbp),%rdi
mov    $0xbb8,%esi
call   1060 <lotlistGetServer@plt>
lea    -0x200(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1040 <lotlistMarkLocals@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
xor    %eax,%eax
call   1050 <lotlistLoad@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xbb8,%esi
call   1060 <lotlistGetServer@plt>
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
call   1040 <lotlistMarkLocals@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"server: %s\0A\00"
@.str.1 = [19 x i8] c"bbs-001.boitho.com\00"
define i32 @main() {
%1 = alloca [512 x i8]
%2 = call i32 (...) @lotlistLoad()
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%4 = call i32 @lotlistGetServer(i8* %3, i32 3000)
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @lotlistMarkLocals(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"server: %s\0A\00"
@.str.1 = [19 x i8] c"bbs-001.boitho.com\00"
define i32 @main() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @lotlistLoad()
%4 = call i32 @lotlistGetServer(i8* %2, i32 3000)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = call i32 @lotlistMarkLocals(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
unsigned long loBits(unsigned long u) { return u & 0x7fffffffUL; }


x86 assembly (clang, -O0):
<loBits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7fffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loBits>:
mov    %rdi,%rax
and    $0x7fffffff,%eax
ret

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

LLVM IR (-O2):
define i64 @loBits(i64 %0) {
%2 = and i64 %0, 2147483647
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int main() {
  char ch;
  char *mem = (char *)malloc(20 * 1024 * 1024);
  memset(mem, 0, 20 * 1024 * 1024);
  int i;
  for (i = 0; i < 20 * 1024 * 1024; ++i) {
    ch = mem[i];
  }
  free(mem);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1400000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1400000,%edx
call   1040 <memset@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x1400000,-0x14(%rbp)
jge    118d <main+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x5(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1400000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1400000,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 20971520)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @memset(i8* %2, i32 0, i32 20971520)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int sr;

/* Variables and functions */
int or1k_mfspr(int);
int /*<<< orphan*/ or1k_mtspr(int, int);
void or1k_interrupts_restore(uint32_t sr_iee) {
  uint32_t sr = or1k_mfspr(0x0011U);
  sr = (((sr)&0xfffffffbU) | ((!!(sr_iee)) << 2));
  or1k_mtspr(0x0011U, sr);
}


x86 assembly (clang, -O0):
<or1k_interrupts_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffffb,%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x11,%edi
call   1030 <or1k_mtspr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or1k_interrupts_restore>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
setne  %bl
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
and    $0xfffffffb,%eax
lea    (%rax,%rbx,4),%esi
mov    $0x11,%edi
pop    %rbx
jmp    1030 <or1k_mtspr@plt>

LLVM IR (-O0):
define void @or1k_interrupts_restore(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @or1k_mfspr(i32 17)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -5
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = shl i32 %11, 2
%13 = or i32 %6, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @or1k_mtspr(i32 17, i32 %14)
ret void
}

LLVM IR (-O2):
define void @or1k_interrupts_restore(i32 %0) {
%2 = tail call i32 @or1k_mfspr(i32 17)
%3 = and i32 %2, -5
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 4
%6 = or i32 %3, %5
%7 = tail call i32 @or1k_mtspr(i32 17, i32 %6)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a = __VERIFIER_nondet_int();
  int b = sizeof(int);
  if (a < 0) {
    a = -a;
  }
  a = a + b;
  if (a < sizeof(int)) {
  ERROR:
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1142 <main+0x32>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    1165 <main+0x55>
jmp    115e <main+0x4e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
el(pn) int pn;
{ brc(pn, 'K'); }


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

x86 assembly (clang, -O2):
<el>:
mov    $0x4b,%esi
xor    %eax,%eax
jmp    1030 <brc@plt>

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

LLVM IR (-O2):
define i32 @el(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @brc to i32 (i32, i32, ...)*)(i32 %0, i32 75)
ret i32 undef
}
int of_property_count_strings(struct device_node *np, const char *propname) {
  return -38;
}


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

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

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

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_property_count_strings(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -38
}