xunge/DecIR huggingface dataset:
/* Variables and functions */
int maxArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[] = {1, 8, 6, 2, 5, 4, 8, 3, 7};
  int hs = 9;
  int max = maxArea(a, hs);
  printf("max %d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
movl   $0x9,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <maxArea@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <maxArea@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [9 x i32] [i32 1, i32 8, i32 6, i32 2, i32 5, i32 4, i32 8, i32 3, i32 7]
@.str = [8 x i8] c"max %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [9 x i32]* %2 to i8*
store i32 9, i32* %3
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @maxArea(i32* %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [9 x i32] [i32 1, i32 8, i32 6, i32 2, i32 5, i32 4, i32 8, i32 3, i32 7]
@.str = [8 x i8] c"max %d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxArea(i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *ntru_calloc(size_t nmemb, size_t size) {
  void *ptr;
  ptr = calloc(nmemb, size);
  if (size)
    if (!ptr) {
      fprintf(stderr, "failed to allocate memory, aborting!");
      abort();
    }
  return ptr;
}


x86 assembly (clang, -O0):
<ntru_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1188 <ntru_calloc+0x58>
cmpq   $0x0,-0x18(%rbp)
jne    1183 <ntru_calloc+0x53>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1188 <ntru_calloc+0x58>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntru_calloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <calloc@plt>
test   %rbx,%rbx
je     1143 <ntru_calloc+0x13>
test   %rax,%rax
je     1145 <ntru_calloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"failed to allocate memory, aborting!\00"
define i8* @ntru_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %11
br label %19
19: ; preds = %18, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"failed to allocate memory, aborting!\00"
define noalias i8* @ntru_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i64 %1, 0
%5 = icmp ne i8* %3, null
%6 = or i1 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct sld_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sld_list_delete(struct sld_list *, scalar_t__);
void *sld_list_get(struct sld_list *, scalar_t__);
scalar_t__ sld_list_size(struct sld_list *);
void *sld_list_pop(struct sld_list *list) {
  void *object = NULL;
  object = sld_list_get(list, sld_list_size(list) - 1);
  sld_list_delete(list, sld_list_size(list) - 1);
  return object;
}


x86 assembly (clang, -O0):
<sld_list_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sld_list_size@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
sub    $0x1,%rsi
call   1030 <sld_list_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sld_list_size@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
sub    $0x1,%rsi
call   1050 <sld_list_delete@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sld_list = type { i32 }
define i8* @sld_list_pop(%struct.sld_list* %0) {
%2 = alloca %struct.sld_list*
%3 = alloca i8*
store %struct.sld_list* %0, %struct.sld_list** %2
store i8* null, i8** %3
%4 = load %struct.sld_list*, %struct.sld_list** %2
%5 = load %struct.sld_list*, %struct.sld_list** %2
%6 = call i64 @sld_list_size(%struct.sld_list* %5)
%7 = sub nsw i64 %6, 1
%8 = call i8* @sld_list_get(%struct.sld_list* %4, i64 %7)
store i8* %8, i8** %3
%9 = load %struct.sld_list*, %struct.sld_list** %2
%10 = load %struct.sld_list*, %struct.sld_list** %2
%11 = call i64 @sld_list_size(%struct.sld_list* %10)
%12 = sub nsw i64 %11, 1
%13 = call i32 @sld_list_delete(%struct.sld_list* %9, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
%struct.sld_list = type { i32 }
define i8* @sld_list_pop(%struct.sld_list* %0) {
%2 = tail call i64 @sld_list_size(%struct.sld_list* %0)
%3 = add nsw i64 %2, -1
%4 = tail call i8* @sld_list_get(%struct.sld_list* %0, i64 %3)
%5 = tail call i64 @sld_list_size(%struct.sld_list* %0)
%6 = add nsw i64 %5, -1
%7 = tail call i32 @sld_list_delete(%struct.sld_list* %0, i64 %6)
ret i8* %4
}
void *dlopen(const char *str, int x) { return (void *)0; }


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

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

LLVM IR (-O0):
define i8* @dlopen(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* @dlopen(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
void *test_anti_range_132(short n) {
  extern void *alloc_anti_range_132(short) __attribute__((alloc_size(1)));
  if ((-0x7fff - 1) + 2 <= n && n <= 2)
    n = (-0x7fff - 1) + 2 - 1;
  return alloc_anti_range_132(n);
}


x86 assembly (clang, -O0):
<test_anti_range_132>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffff8002,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_132+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1143 <test_anti_range_132+0x33>
movw   $0x8001,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_132@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_132>:
lea    0x7ffe(%rdi),%eax
movzwl %ax,%eax
cmp    $0x8001,%eax
mov    $0x8001,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_132@plt>

LLVM IR (-O0):
define i8* @test_anti_range_132(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 -32766, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -32767, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_132(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_132(i16 signext %0) {
%2 = add i16 %0, 32766
%3 = icmp ult i16 %2, -32767
%4 = select i1 %3, i16 -32767, i16 %0
%5 = tail call i8* @alloc_anti_range_132(i16 signext %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ get_line(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
main() {
  char buffer[4096];
  get_line(buffer, stdin);
  *(buffer + strlen(buffer) - 1) = '\0';
  printf("%s\n", buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1000,%rsp
lea    -0x1000(%rbp),%rdi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
lea    -0x1000(%rbp),%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1001(%rbp,%rax,1)
lea    -0x1000(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1000,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <get_line@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rsp,%rax,1)
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @get_line(i8* %2, i32 %3)
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -1
store i8 0, i8* %10
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @get_line(i8* %2, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8 0, i8* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void GPMCPrefetchWaitPinSelect(unsigned int baseAddr, unsigned int waitPin) {
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) &=
      ~(0x00000030u);
  (*((volatile unsigned int *)(baseAddr + (0x1E0 + ((1 - 1) * (0x4)))))) |=
      ((waitPin << (0x00000004u)) & (0x00000030u));
}


x86 assembly (clang, -O0):
<GPMCPrefetchWaitPinSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffcf,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
shl    $0x4,%edx
and    $0x30,%edx
mov    -0x4(%rbp),%eax
add    $0x1e0,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCPrefetchWaitPinSelect>:
add    $0x1e0,%edi
andl   $0xffffffcf,(%rdi)
shl    $0x4,%esi
and    $0x30,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCPrefetchWaitPinSelect(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 = add i32 %5, 480
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -49
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = shl i32 %11, 4
%13 = and i32 %12, 48
%14 = load i32, i32* %3
%15 = add i32 %14, 480
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, %13
store volatile i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @GPMCPrefetchWaitPinSelect(i32 %0, i32 %1) {
%3 = add i32 %0, 480
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -49
store volatile i32 %7, i32* %5
%8 = shl i32 %1, 4
%9 = and i32 %8, 48
%10 = load volatile i32, i32* %5
%11 = or i32 %10, %9
store volatile i32 %11, i32* %5
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
unsigned int mget3b(const uint8_t *data) {
  return data[2] | (data[1] * 0x0100) | (data[0] * 0x010000);
}


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

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

LLVM IR (-O0):
define i32 @mget3b(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 256
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = mul nsw i32 %13, 65536
%15 = or i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @mget3b(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 8
%7 = or i32 %6, %3
%8 = load i32, i32* %0
%9 = shl nsw i32 %8, 16
%10 = or i32 %7, %9
ret i32 %10
}
void ff_hevc_put_hevc_pel_pixels64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels64_8_sse4() {
ret void
}
/* Variables and functions */
void stub1(char, int);
void testClosureBIrV(void (*closure)(char, int), char a1, int a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureBIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112f <testClosureBIrV+0x2f>
mov    -0x8(%rbp),%rax
mov    -0x9(%rbp),%cl
mov    -0x10(%rbp),%esi
movsbl %cl,%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureBIrV>:
test   %rdi,%rdi
je     1110 <testClosureBIrV+0x10>
mov    %rdi,%rax
movsbl %sil,%edi
mov    %edx,%esi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureBIrV(void (i8, i32)* %0, i8 signext %1, i32 %2) {
%4 = icmp eq void (i8, i32)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i8 signext %1, i32 %2)
br label %6
6: ; preds = %5, %3
ret void
}
int comp_int_asc(const void *a, const void *b) {
  int a_tmp = *((int *)a);
  int b_tmp = *((int *)b);
  if (b_tmp > a_tmp)
    return -1;
  if (a_tmp > b_tmp)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<comp_int_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1136 <comp_int_asc+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <comp_int_asc+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <comp_int_asc+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <comp_int_asc+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_int_asc>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setg   %dl
mov    $0xffffffff,%eax
cmovge %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp_int_asc(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 = icmp sgt i32 %6, %4
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int ENXIO;
int pm8921_bms_get_init_fcc(void) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8921_bms_get_init_fcc>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_bms_get_init_fcc>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @pm8921_bms_get_init_fcc() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @pm8921_bms_get_init_fcc() {
%1 = load i32, i32* @ENXIO
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
unsigned long GetKey262();
unsigned long getkey() { return GetKey262(); }


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

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

LLVM IR (-O0):
define i64 @getkey() {
%1 = call i64 (...) @GetKey262()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getkey() {
%1 = tail call i64 (...) @GetKey262()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_send(void *bus, void *m,
                                                       uint64_t *cookie) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_send>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_send>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_send(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_send(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
double RAND_MAX;
double rand();
double get_next_double() {
  double range = (1.0 - 0);
  double div = RAND_MAX / range;
  return 0.0 + (rand() / div);
}


x86 assembly (clang, -O0):
<get_next_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
movsd  (%rax),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
divsd  -0x10(%rbp),%xmm1
xorps  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_double>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
divsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @get_next_double() {
%1 = alloca double
%2 = alloca double
store double 1.000000e+00, double* %1
%3 = load double, double* @RAND_MAX
%4 = load double, double* %1
%5 = fdiv double %3, %4
store double %5, double* %2
%6 = call double (...) @rand()
%7 = load double, double* %2
%8 = fdiv double %6, %7
%9 = fadd double 0.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @get_next_double() {
%1 = load double, double* @RAND_MAX
%2 = tail call double (...) @rand()
%3 = fdiv double %2, %1
%4 = fadd double %3, 0.000000e+00
ret double %4
}
/* Type definitions */
struct fdi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ track_pc(struct fdi *, int);
void track_pc_18(struct fdi *fdi) { track_pc(fdi, 18); }


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

x86 assembly (clang, -O2):
<track_pc_18>:
mov    $0x12,%esi
jmp    1030 <track_pc@plt>

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

LLVM IR (-O2):
%struct.fdi = type { i32 }
define void @track_pc_18(%struct.fdi* %0) {
%2 = tail call i32 @track_pc(%struct.fdi* %0, i32 18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void handler(int s) {
  printf(".");
  fflush(stdout);
  alarm(1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@stdout = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @handler(i32 %0) {
%2 = tail call i32 @putchar(i32 46)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @alarm(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tinyMD5();
int main(void) { tinyMD5(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @tinyMD5()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tinyMD5()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g6_cb(void *arg) { puts("GPIO_6 triggered"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"GPIO_6 triggered\00"
define void @g6_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"GPIO_6 triggered\00"
define void @g6_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
void secure_lock(pthread_mutex_t *mutex) {
  int rc = pthread_mutex_lock(mutex);
  if (rc) {
    printf("Failed to secure mutex lock");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<secure_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1168 <secure_lock+0x38>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_lock>:
push   %rax
call   1050 <pthread_mutex_lock@plt>
test   %eax,%eax
jne    113c <secure_lock+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to secure mutex lock\00"
define void @secure_lock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to secure mutex lock\00"
define void @secure_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
int kgsl_mmu_enabled(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @kgsl_mmu_enabled() {
ret i32 0
}

LLVM IR (-O2):
define i32 @kgsl_mmu_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **agrv) {
  printf("Hello world! \n");
  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)
lea    0xed3(%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 = [15 x i8] c"Hello world! \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello world! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct packet_t {
  int dummy;
};
struct interface_t {
  int dummy;
};

/* Variables and functions */
int packet_get(struct interface_t *, struct packet_t *, int);
int /*<<< orphan*/ packet_put(struct interface_t *, struct packet_t *);
int packet_transfer(struct interface_t *iface, struct packet_t *request,
                    struct packet_t *response, int timeout) {
  packet_put(iface, request);
  return packet_get(iface, response, timeout);
}


x86 assembly (clang, -O0):
<packet_transfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <packet_put@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <packet_get@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_transfer>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
call   1040 <packet_put@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <packet_get@plt>

LLVM IR (-O0):
%struct.interface_t = type { i32 }
%struct.packet_t = type { i32 }
define i32 @packet_transfer(%struct.interface_t* %0, %struct.packet_t* %1, %struct.packet_t* %2, i32 %3) {
%5 = alloca %struct.interface_t*
%6 = alloca %struct.packet_t*
%7 = alloca %struct.packet_t*
%8 = alloca i32
store %struct.interface_t* %0, %struct.interface_t** %5
store %struct.packet_t* %1, %struct.packet_t** %6
store %struct.packet_t* %2, %struct.packet_t** %7
store i32 %3, i32* %8
%9 = load %struct.interface_t*, %struct.interface_t** %5
%10 = load %struct.packet_t*, %struct.packet_t** %6
%11 = call i32 @packet_put(%struct.interface_t* %9, %struct.packet_t* %10)
%12 = load %struct.interface_t*, %struct.interface_t** %5
%13 = load %struct.packet_t*, %struct.packet_t** %7
%14 = load i32, i32* %8
%15 = call i32 @packet_get(%struct.interface_t* %12, %struct.packet_t* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.interface_t = type { i32 }
%struct.packet_t = type { i32 }
define i32 @packet_transfer(%struct.interface_t* %0, %struct.packet_t* %1, %struct.packet_t* %2, i32 %3) {
%5 = tail call i32 @packet_put(%struct.interface_t* %0, %struct.packet_t* %1)
%6 = tail call i32 @packet_get(%struct.interface_t* %0, %struct.packet_t* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x59() {
  Assert_real((isprint(89)),
              "/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_isprint.c",
              450, ("isprint should be 1 for Y"));
}


x86 assembly (clang, -O0):
<t_isprint_0x59>:
push   %rbp
mov    %rsp,%rbp
mov    $0x59,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1c2,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x59>:
push   %rax
mov    $0x59,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1c2,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for Y\00"
define void @t_isprint_0x59() {
%1 = call i32 @isprint(i32 89)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 450, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for Y\00"
define void @t_isprint_0x59() {
%1 = tail call i32 @isprint(i32 89)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 450, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
struct ListNode *mergeList(struct ListNode *);
struct ListNode *sortList(struct ListNode *head) {
  return mergeList(head);
}


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

x86 assembly (clang, -O2):
<sortList>:
jmp    1030 <mergeList@plt>

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

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define %struct.ListNode* @sortList(%struct.ListNode* %0) {
%2 = tail call %struct.ListNode* @mergeList(%struct.ListNode* %0)
ret %struct.ListNode* %2
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgswap(void) { gen("xchgl\t%eax,%ecx"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"xchgl\09%eax,%ecx\00"
define void @cgswap() {
%1 = call i32 @gen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"xchgl\09%eax,%ecx\00"
define void @cgswap() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo412(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo412(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x2a() {
  Assert_real((isupper(42) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              215, ("isupper should be 0 for *"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for *\00"
define void @t_isupper_0x2a() {
%1 = tail call i64 @isupper(i32 42)
%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 215, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *strcopy(const char *str) {
  int l;
  char *r;
  if (str == 0)
    return 0;
  l = strlen(str) + 1;
  r = malloc(l);
  memcpy(r, str, l);
  return r;
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strcopy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1187 <strcopy+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     115d <strcopy+0x2d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1160 <strcopy+0x30>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strcopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %20
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i8* @malloc(i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = call i32 @memcpy(i8* %15, i8* %16, i32 %17)
%19 = load i8*, i8** %5
store i8* %19, i8** %2
br label %20
20: ; preds = %9, %8
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @strcopy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i32 %5)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
void strcpy5(char *s, char *t) {}


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

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

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

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

/* Variables and functions */
scalar_t__ ftello64(int /*<<< orphan*/ *);
long ftell(FILE *f) { return (long)ftello64(f); }


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

x86 assembly (clang, -O2):
<ftell>:
jmp    1030 <ftello64@plt>

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

LLVM IR (-O2):
define i64 @ftell(i32* nocapture %0) {
%2 = tail call i64 @ftello64(i32* %0)
ret i64 %2
}
int hanoi(int n) {
  if (n == 1) {
    return 1;
  }
  return 2 * (hanoi(n - 1)) + 1;
}


x86 assembly (clang, -O0):
<hanoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <hanoi+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1145 <hanoi+0x35>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <hanoi@plt>
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hanoi>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     112c <hanoi+0x1c>
push   %rax
add    $0xffffffff,%edi
call   1030 <hanoi@plt>
add    %eax,%eax
add    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @hanoi(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @hanoi(i32 %6)
%8 = shl nsw i32 %7, 1
%9 = or i32 %8, 1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ base64_is_well_formed_imp(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strings_length(char *);
bool base64_is_well_formed(char *data) {
  assert(data);
  return base64_is_well_formed_imp(data, strings_length(data)) > 0;
}


x86 assembly (clang, -O0):
<base64_is_well_formed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strings_length@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <base64_is_well_formed_imp@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_is_well_formed>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <strings_length@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <base64_is_well_formed_imp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @base64_is_well_formed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strings_length(i8* %6)
%8 = call i64 @base64_is_well_formed_imp(i8* %5, i32 %7)
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @base64_is_well_formed(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strings_length(i8* %0)
%4 = tail call i64 @base64_is_well_formed_imp(i8* %0, i32 %3)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strncpy0(char *dest, const char *src, size_t size) {
  strncpy(dest, src, size);
  dest[size - 1] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strncpy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy0>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strncpy0(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = sub i64 %12, 1
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strncpy0(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
unsigned xrop3_52_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_52_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_52_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_52_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}