xunge/DecIR huggingface dataset:
/* Variables and functions */
void *reallocateMemory(int /*<<< orphan*/ *, size_t);
void *allocateMemory(size_t size) { return reallocateMemory(NULL, size); }


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

x86 assembly (clang, -O2):
<allocateMemory>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <reallocateMemory@plt>

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

LLVM IR (-O2):
define i8* @allocateMemory(i64 %0) {
%2 = tail call i8* @reallocateMemory(i32* null, i64 %0)
ret i8* %2
}
/* Variables and functions */
#define ECONNRESET 130
#define EINPROGRESS 129
#define EINTR 128
scalar_t__ is_network_error(int);
scalar_t__ is_wouldblock(int);
bool should_retry_error(int err) {
  if (is_network_error(err)) {
    return true;
  }
  if (is_wouldblock(err)) {
    return true;
  }
  switch (err) {
  case EINPROGRESS:
  case EINTR:
  case ECONNRESET:
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<should_retry_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <is_network_error@plt>
cmp    $0x0,%rax
je     1149 <should_retry_error+0x29>
movl   $0x1,-0x4(%rbp)
jmp    118e <should_retry_error+0x6e>
mov    -0x8(%rbp),%edi
call   1030 <is_wouldblock@plt>
cmp    $0x0,%rax
je     1167 <should_retry_error+0x47>
movl   $0x1,-0x4(%rbp)
jmp    118e <should_retry_error+0x6e>
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x2,%eax
ja     1187 <should_retry_error+0x67>
jmp    117b <should_retry_error+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    118e <should_retry_error+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<should_retry_error>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <is_network_error@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    114b <should_retry_error+0x2b>
mov    %ebp,%edi
call   1030 <is_wouldblock@plt>
test   %rax,%rax
jne    114b <should_retry_error+0x2b>
add    $0xffffff80,%ebp
xor    %ebx,%ebx
cmp    $0x3,%ebp
setb   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @should_retry_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @is_network_error(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %17
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i64 @is_wouldblock(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %17
13: ; preds = %8
%14 = load i32, i32* %3
switch i32 %14, label %16 [
i32 129, label %15
i32 128, label %15
i32 130, label %15
]
15: ; preds = %13, %13, %13
store i32 1, i32* %2
br label %17
16: ; preds = %13
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %12, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @should_retry_error(i32 %0) {
%2 = tail call i64 @is_network_error(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @is_wouldblock(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = add i32 %0, -128
%9 = icmp ult i32 %8, 3
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int _eml_parse822_is_special(char c) {
  return strchr("()<>@,;:\\\".[]", c) ? 1 : 0;
}


x86 assembly (clang, -O0):
<_eml_parse822_is_special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eml_parse822_is_special>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"()<>@,;:\\\22.[]\00"
define i32 @_eml_parse822_is_special(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"()<>@,;:\\\22.[]\00"
define i32 @_eml_parse822_is_special(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fsetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void nocrash_fsetpos() {
  FILE *f;
  fpos_t position;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    fsetpos(f, &position);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_fsetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1170 <nocrash_fsetpos+0x40>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <fsetpos@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_fsetpos>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1165 <nocrash_fsetpos+0x35>
mov    %rax,%rbx
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
call   1050 <fsetpos@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_fsetpos() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @fsetpos(i32* %7, i32* %2)
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_fsetpos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = call i32 @fsetpos(i32* %3, i32* %1)
%7 = call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %0
ret void
}
int lruCacheGet(int key) {}


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

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

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

LLVM IR (-O2):
define i32 @lruCacheGet(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int crc_update(int, int *, int);
uint8_t crc(uint8_t *data, int len) {
  return crc_update(0x00, data, len) ^ 0x00;
}


x86 assembly (clang, -O0):
<crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <crc_update@plt>
xor    $0x0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <crc_update@plt>

LLVM IR (-O0):
define i32 @crc(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 @crc_update(i32 0, i32* %5, i32 %6)
%8 = xor i32 %7, 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @crc(i32* %0, i32 %1) {
%3 = tail call i32 @crc_update(i32 0, i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int main() {
  printf("%p", (int *)0);
  printf("%p", (void *)0);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null)
ret i32 0
}
/* Variables and functions */
size_t get_nchan_from_depth(int);
size_t get_burst_nextra(size_t ndata2, int depth) {
  size_t nchan = get_nchan_from_depth(depth);
  size_t nextra = nchan;
  if (nextra > ndata2)
    nextra = ndata2;
  return nextra;
}


x86 assembly (clang, -O0):
<get_burst_nextra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <get_nchan_from_depth@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1149 <get_burst_nextra+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_burst_nextra>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <get_nchan_from_depth@plt>
cmp    %rbx,%rax
cmova  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @get_burst_nextra(i64 %0, i32 %1) {
%3 = tail call i64 @get_nchan_from_depth(i32 %1)
%4 = icmp ugt i64 %3, %0
%5 = select i1 %4, i64 %0, i64 %3
ret i64 %5
}
char *alloc(nbytes)
int nbytes;
{
  void *malloc();
  return (malloc(nbytes));
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
movslq %edi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @alloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
ret i8* %3
}
int test_imm_8Dint8_reg(signed char val) {
  return ((val) & (-0x8D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Dint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -141
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "format: launch_pin <replay dir> <pin_tool_name>\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"format: launch_pin <replay dir> <pin_tool_name>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"format: launch_pin <replay dir> <pin_tool_name>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}
void lower_case(char *str) {
  for (; *str != '\0'; str++)
    if ('A' <= *str && *str <= 'Z')
      *str = *str + ('a' - 'A');
}


x86 assembly (clang, -O0):
<lower_case>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <lower_case+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114e <lower_case+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114e <lower_case+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1153 <lower_case+0x53>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <lower_case+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_case>:
mov    (%rdi),%al
test   %al,%al
je     112a <lower_case+0x2a>
add    $0x1,%rdi
jmp    111b <lower_case+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <lower_case+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <lower_case+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <lower_case+0x10>
ret

LLVM IR (-O0):
define void @lower_case(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %26, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %29
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 65, %11
br i1 %12, label %13, label %25
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %18, label %25
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = add nsw i32 %21, 32
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %2
store i8 %23, i8* %24
br label %25
25: ; preds = %18, %13, %8
br label %26
26: ; preds = %25
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %2
br label %3
29: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @lower_case(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
long heuristic(m)
long m;
{ return ((138L * m) / 100L); }


x86 assembly (clang, -O0):
<heuristic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x8a,-0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<heuristic>:
imul   $0x8a,%rdi,%rcx
movabs $0xa3d70a3d70a3d70b,%rdx
0a d7 a3
mov    %rcx,%rax
imul   %rdx
add    %rdx,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x6,%rcx
add    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @heuristic(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 138, %3
%5 = sdiv i64 %4, 100
ret i64 %5
}

LLVM IR (-O2):
define i64 @heuristic(i64 %0) {
%2 = mul nsw i64 %0, 138
%3 = sdiv i64 %2, 100
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x37() {
  Assert_real((isascii(55)),
              "/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_isascii.c",
              280, ("isascii should be 1 for 7"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x37>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x118,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 7\00"
define void @t_isascii_0x37() {
%1 = call i32 @isascii(i32 55)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for 7\00"
define void @t_isascii_0x37() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_file_chooser_get_current_folder_uri() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_get_current_folder_uri() {
ret void
}
unsigned char inportb(unsigned short port) {
  unsigned char value;
  asm volatile("inb %1, %0" : "=a"(value) : "dN"(port));
  return value;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_value;
typedef int /*<<< orphan*/ sqlite3_context;

/* Variables and functions */
int /*<<< orphan*/ EVP_sha512();
int /*<<< orphan*/ sqlite3_digest_type(int /*<<< orphan*/ *, int,
                                       int /*<<< orphan*/ **,
                                       int /*<<< orphan*/);
void sqlite3_digest_sha512(sqlite3_context *context, int argc,
                           sqlite3_value **argv) {
  sqlite3_digest_type(context, argc, argv, EVP_sha512());
}


x86 assembly (clang, -O0):
<sqlite3_digest_sha512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <EVP_sha512@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <sqlite3_digest_type@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_digest_sha512>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <EVP_sha512@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sqlite3_digest_type@plt>

LLVM IR (-O0):
define void @sqlite3_digest_sha512(i32* %0, i32 %1, i32** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32** %2, i32*** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32**, i32*** %6
%10 = call i32 (...) @EVP_sha512()
%11 = call i32 @sqlite3_digest_type(i32* %7, i32 %8, i32** %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @sqlite3_digest_sha512(i32* %0, i32 %1, i32** %2) {
%4 = tail call i32 (...) @EVP_sha512()
%5 = tail call i32 @sqlite3_digest_type(i32* %0, i32 %1, i32** %2, i32 %4)
ret void
}
int yyerror(char *s) {}


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

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

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

LLVM IR (-O2):
define i32 @yyerror(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool scan_section(const uint8_t *data, unsigned size) {
  for (unsigned i = 0; i < size; i++) {
    if (data[i] != 0xff)
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<scan_section>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1151 <scan_section+0x51>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
cmpl   $0xff,(%rax,%rcx,4)
je     113e <scan_section+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1158 <scan_section+0x58>
jmp    1143 <scan_section+0x43>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <scan_section+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_section>:
test   %esi,%esi
je     113e <scan_section+0x3e>
mov    $0x1,%eax
cmpl   $0xff,(%rdi)
jne    113d <scan_section+0x3d>
mov    %esi,%ecx
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
cmp    %rax,%rcx
je     1135 <scan_section+0x35>
lea    0x1(%rdx),%rax
cmpl   $0xff,(%rdi,%rdx,4)
je     1120 <scan_section+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @scan_section(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %19, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
%7 = icmp eq i32 %6, 255
br i1 %7, label %8, label %19
8: ; preds = %4, %11
%9 = phi i64 [ %15, %11 ], [ 1, %4 ]
%10 = icmp eq i64 %9, %5
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, i32* %0, i64 %9
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 255
%15 = add nuw nsw i64 %9, 1
br i1 %14, label %8, label %16
16: ; preds = %8, %11
%17 = icmp ult i64 %9, %5
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %16, %4, %2
%20 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %18, %16 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *err) {
  fprintf(stderr, "%s\n", err);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int concat_str(char **, char *);
int concat_char(char **str, const char cat) {
  char cat_str[2];
  cat_str[0] = cat;
  cat_str[1] = '\0';
  return concat_str(str, cat_str);
}


x86 assembly (clang, -O0):
<concat_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <concat_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_char>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rsi
call   1030 <concat_str@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @concat_char(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
%5 = alloca [2 x i8]
store i8** %0, i8*** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %8
%9 = load i8**, i8*** %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @concat_str(i8** %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @concat_char(i8** %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 @concat_str(i8** %0, i8* %4)
ret i32 %6
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int *a, int p, int r) {
  if (p < r) {
    int q = partition(a, p, r);
    quick_sort(a, p, q - 1);
    quick_sort(a, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void exynos_drm_iommu_cleanup(void *in_vmm) { return; }


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

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

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

LLVM IR (-O2):
define void @exynos_drm_iommu_cleanup(i8* nocapture %0) {
ret void
}
double f10(double y) {
  double t = y + (-0.0);
  return t + (-0.0);
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xedd(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @f10(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, -0.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = fadd double %6, -0.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f10(double returned %0) {
ret double %0
}
INSTR(OCBWB) { NEXT_INSTR(); }


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

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

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

LLVM IR (-O2):
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (...) @NEXT_INSTR()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x2a() {
  Assert_real((isspace(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_isspace.c",
              215, ("isspace should be 0 for *"));
}


x86 assembly (clang, -O0):
<t_isspace_0x2a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <isspace@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_isspace_0x2a>:
push   %rax
mov    $0x2a,%edi
call   1030 <isspace@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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for *\00"
define void @t_isspace_0x2a() {
%1 = call i64 @isspace(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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for *\00"
define void @t_isspace_0x2a() {
%1 = tail call i64 @isspace(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 *wattsup_get_implementation(char *, size_t);
char *energymon_get_source_wattsup(char *buffer, size_t n) {
  return wattsup_get_implementation(buffer, n);
}


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

x86 assembly (clang, -O2):
<energymon_get_source_wattsup>:
jmp    1030 <wattsup_get_implementation@plt>

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

LLVM IR (-O2):
define i8* @energymon_get_source_wattsup(i8* %0, i64 %1) {
%3 = tail call i8* @wattsup_get_implementation(i8* %0, i64 %1)
ret i8* %3
}
double grib_op_gt_d(double a, double b) { return a > b; }


x86 assembly (clang, -O0):
<grib_op_gt_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_gt_d>:
cmpltsd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @grib_op_gt_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @grib_op_gt_d(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
void *allocate(size_t size) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @allocate(i64 %0) {
ret i8* undef
}
/* Variables and functions */
double *malloc(int);
double *copy_point(double *v) {
  double *value = malloc(3 * sizeof(double));
  value[0] = v[0];
  value[1] = v[1];
  value[2] = v[2];
  return value;
}


x86 assembly (clang, -O0):
<copy_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_point>:
push   %rbx
mov    %rdi,%rbx
mov    $0x18,%edi
call   1030 <malloc@plt>
movups (%rbx),%xmm0
movups %xmm0,(%rax)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define double* @copy_point(double* %0) {
%2 = alloca double*
%3 = alloca double*
store double* %0, double** %2
%4 = call double* @malloc(i32 24)
store double* %4, double** %3
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
%20 = load double*, double** %3
ret double* %20
}

LLVM IR (-O2):
define noalias double* @copy_point(double* nocapture %0) {
%2 = tail call double* @malloc(i32 24)
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = bitcast double* %2 to <2 x double>*
store <2 x double> %4, <2 x double>* %5
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %2, i64 2
store double %7, double* %8
ret double* %2
}
void TiraEnter(char *texto) {
  int c;
  for (c = 0; texto[c] >= ' '; c++)
    ;
  texto[c] = '\0';
}


x86 assembly (clang, -O0):
<TiraEnter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jl     1137 <TiraEnter+0x37>
jmp    1129 <TiraEnter+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <TiraEnter+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TiraEnter>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x1f,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jg     1110 <TiraEnter+0x10>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @TiraEnter(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp sgt i8 %5, 31
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
__attribute__((always_)) int foo(int *x, long y) {
  asm goto("" : : "r"(x), "r"(y) : "memory" : lab);
  return 0;
lab:
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
jmp    1119 <foo+0x19>
movl   $0x0,-0x4(%rbp)
jmp    112c <foo+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
%6 = load i32*, i32** %4
%7 = load i64, i64* %5
to label %8 [label %9]
8: ; preds = %2
store i32 0, i32* %3
br label %10
9: ; preds = %2
store i32 1, i32* %3
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32* %0, i64 %1) {
to label %4 [label %3]
3: ; preds = %2
br label %4
4: ; preds = %2, %3
%5 = phi i32 [ 1, %3 ], [ 0, %2 ]
ret i32 %5
}
double max(double a, double b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void console_ESC_m(char *esc_param) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpeq_pi32(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test86(__m64 a, __m64 b) { return _mm_cmpeq_pi32(a, b); }


x86 assembly (clang, -O0):
<test86>:
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 <_mm_cmpeq_pi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test86>:
jmp    1030 <_mm_cmpeq_pi32@plt>

LLVM IR (-O0):
define i32 @test86(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 @_mm_cmpeq_pi32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test86(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpeq_pi32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumelement(int *, int);
main() {
  int x[10];
  int i = 10;
  for (; i;) {
    i--;
    *(x + i) = i;
  }
  printf("\n%d", sumelement(x, 7));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     1159 <main+0x39>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
jmp    1136 <main+0x16>
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
call   1040 <sumelement@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x900000008,%rax
mov    %rax,0x20(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <sumelement@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 %10, i32* %14
br label %4
15: ; preds = %4
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%17 = call i32 @sumelement(i32* %16, i32 7)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %1
ret i32 %19
}

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