xunge/DecIR huggingface dataset:
/* Variables and functions */
char *chatdat_get_token(char const *);
char *chatdat_clean_line(const char *line) {
  char *token = chatdat_get_token(line);
  return (char *)(token + 1);
}


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

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

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

LLVM IR (-O2):
define i8* @chatdat_clean_line(i8* %0) {
%2 = tail call i8* @chatdat_get_token(i8* %0)
%3 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %3
}
void psycho_anal_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @psycho_anal_exit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;
struct connection {
  int dummy;
};

/* Variables and functions */
void native_runtime_wsmessage(void *addr, struct connection *c, u_int8_t op,
                              const void *data, size_t len) {
  void (*cb)(struct connection *, u_int8_t, const void *, size_t);
  *(void **)&(cb) = addr;
  cb(c, op, data, len);
}


x86 assembly (clang, -O0):
<native_runtime_wsmessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   *%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_runtime_wsmessage>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8,%rcx
jmp    *%rax

LLVM IR (-O0):
%struct.connection = type { i32 }
define void @native_runtime_wsmessage(i8* %0, %struct.connection* %1, i32 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca %struct.connection*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca void (%struct.connection*, i32, i8*, i64)*
store i8* %0, i8** %6
store %struct.connection* %1, %struct.connection** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%12 = load i8*, i8** %6
%13 = bitcast void (%struct.connection*, i32, i8*, i64)** %11 to i8**
store i8* %12, i8** %13
%14 = load void (%struct.connection*, i32, i8*, i64)*, void (%struct.connection*, i32, i8*, i64)** %11
%15 = load %struct.connection*, %struct.connection** %7
%16 = load i32, i32* %8
%17 = load i8*, i8** %9
%18 = load i64, i64* %10
ret void
}

LLVM IR (-O2):
%struct.connection = type { i32 }
define void @native_runtime_wsmessage(i8* nocapture %0, %struct.connection* %1, i32 %2, i8* %3, i64 %4) {
%6 = bitcast i8* %0 to void (%struct.connection*, i32, i8*, i64)*
tail call void %6(%struct.connection* %1, i32 %2, i8* %3, i64 %4)
ret void
}
/* Type definitions */
struct input {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int deactivate_ui_input(struct input *);
int deactivate_input(struct input *a) {
  curs_set(0);
  return (deactivate_ui_input(a));
}


x86 assembly (clang, -O0):
<deactivate_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <curs_set@plt>
mov    -0x8(%rbp),%rdi
call   1030 <deactivate_ui_input@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deactivate_input>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <curs_set@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <deactivate_ui_input@plt>

LLVM IR (-O0):
%struct.input = type { i32 }
define i32 @deactivate_input(%struct.input* %0) {
%2 = alloca %struct.input*
store %struct.input* %0, %struct.input** %2
%3 = call i32 @curs_set(i32 0)
%4 = load %struct.input*, %struct.input** %2
%5 = call i32 @deactivate_ui_input(%struct.input* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.input = type { i32 }
define i32 @deactivate_input(%struct.input* %0) {
%2 = tail call i32 @curs_set(i32 0)
%3 = tail call i32 @deactivate_ui_input(%struct.input* %0)
ret i32 %3
}
/* Variables and functions */
int f(int *, int *);
int main(void) {
  int a = 5;
  return f(&a, &a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rdi,%rsi
call   1030 <f@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = call i32 @f(i32* %2, i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @f(i32* %1, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ wait_for_tracers(int /*<<< orphan*/);
void sig_handler_for_quit(int val) {
  fprintf(stderr, "Received signal %d. Terminating tracers.\n", val);
  wait_for_tracers(SIGTERM);
}


x86 assembly (clang, -O0):
<sig_handler_for_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <wait_for_tracers@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler_for_quit>:
push   %rax
mov    %edi,%edx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <wait_for_tracers@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Received signal %d. Terminating tracers.\0A\00"
@SIGTERM = global i32 0
define void @sig_handler_for_quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @SIGTERM
%7 = call i32 @wait_for_tracers(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Received signal %d. Terminating tracers.\0A\00"
@SIGTERM = global i32 0
define void @sig_handler_for_quit(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @SIGTERM
%5 = tail call i32 @wait_for_tracers(i32 %4)
ret void
}
int hash(void *elt) { return (((char *)elt)[0] - 'a'); }


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movsbl (%rdi),%eax
add    $0xffffff9f,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -97
ret i32 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __lxstat(int, char const *, struct stat *);
int lstat(const char *path, struct stat *buf) { return __lxstat(1, path, buf); }


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

x86 assembly (clang, -O2):
<lstat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <__lxstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @__lxstat(i32 1, i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @__lxstat(i32 1, i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ memset(char *, char, int);
int read(int, char *, int);
int value_from_fd(int fd) {
  char buf[16];
  int read_bytes;
  memset(buf, '\0', 16);
  read_bytes = read(fd, buf, 16 - 1);
  buf[read_bytes] = '\0';
  return atoi(buf);
}


x86 assembly (clang, -O0):
<value_from_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0xf,%edx
call   1040 <read@plt>
mov    %eax,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_from_fd>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xf,%edx
call   1040 <read@plt>
cltq
movb   $0x0,(%rsp,%rax,1)
mov    %r14,%rdi
call   1050 <atoi@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @value_from_fd(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i8 signext 0, i32 16)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 15)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %11
store i8 0, i8* %12
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%14 = call i32 @atoi(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @value_from_fd(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i8 signext 0, i32 16)
%5 = call i32 @read(i32 %0, i8* %3, i32 15)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 %6
store i8 0, i8* %7
%8 = call i32 @atoi(i8* %3)
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned char *data;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
unsigned char *ASN1_STRING_data(ASN1_STRING *x) { return (x->data); }


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

x86 assembly (clang, -O2):
<ASN1_STRING_data>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8* }
define i8* @ASN1_STRING_data(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8* }
define i8* @ASN1_STRING_data(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i8*, i8** %2
ret i8* %3
}
int test_imm_19uint8_mem(unsigned char *val) {
  return ((*val) & (-0x19 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_19uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffffe7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_19uint8_mem>:
testb  $0xe7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_19uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -25
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ docomplex();
int /*<<< orphan*/ docomplexf();
int /*<<< orphan*/ docomplexl();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  docomplex();
  docomplexf();
  docomplexl();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <docomplex@plt>
mov    $0x0,%al
call   1060 <docomplexf@plt>
mov    $0x0,%al
call   1050 <docomplexl@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <docomplex@plt>
xor    %eax,%eax
call   1060 <docomplexf@plt>
xor    %eax,%eax
call   1050 <docomplexl@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @docomplex()
%3 = call i32 (...) @docomplexf()
%4 = call i32 (...) @docomplexl()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @docomplex()
%2 = tail call i32 (...) @docomplexf()
%3 = tail call i32 (...) @docomplexl()
%4 = tail call i32 @exit(i32 0)
unreachable
}
float SLOW_OperatorAdd(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<SLOW_OperatorAdd>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLOW_OperatorAdd>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @SLOW_OperatorAdd(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
char *my_strcpy(char *src, char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    src[i] = str[i];
    i++;
  }
  src[i] = '\0';
  return (src);
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <my_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <my_strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <my_strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <my_strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ X509V3_EXT_METHOD;
struct TYPE_3__ {
  int /*<<< orphan*/ length;
  int /*<<< orphan*/ data;
};
typedef TYPE_1__ ASN1_OCTET_STRING;

/* Variables and functions */
char *hex_to_string(int /*<<< orphan*/, int /*<<< orphan*/);
char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
                            const ASN1_OCTET_STRING *oct) {
  return hex_to_string(oct->data, oct->length);
}


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

x86 assembly (clang, -O2):
<i2s_ASN1_OCTET_STRING>:
mov    (%rsi),%eax
mov    0x4(%rsi),%edi
mov    %eax,%esi
jmp    1030 <hex_to_string@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i8* @i2s_ASN1_OCTET_STRING(i32* %0, %struct.TYPE_3__* %1) {
%3 = alloca i32*
%4 = alloca %struct.TYPE_3__*
store i32* %0, i32** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i8* @hex_to_string(i32 %7, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
define i8* @i2s_ASN1_OCTET_STRING(i32* nocapture readnone %0, %struct.TYPE_3__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i8* @hex_to_string(i32 %4, i32 %6)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x08() {
  Assert_real((iscntrl(8)),
              "/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_iscntrl.c",
              45, ("iscntrl should be 1 for 0x08"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x08>:
push   %rax
mov    $0x8,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x2d,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x08\00"
define void @t_iscntrl_0x08() {
%1 = call i32 @iscntrl(i32 8)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x08\00"
define void @t_iscntrl_0x08() {
%1 = tail call i32 @iscntrl(i32 8)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_tree_model_unref_node() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_unref_node() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__1__GeneralIO__clr();
void LedsP__Led1__clr(void) { Msp430GpioC__1__GeneralIO__clr(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__clr() {
%1 = tail call i32 (...) @Msp430GpioC__1__GeneralIO__clr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcharacterarray_(char *x, unsigned int *n) { popNarray(x, *n); }


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

x86 assembly (clang, -O2):
<popcharacterarray_>:
mov    (%rsi),%esi
jmp    1030 <popNarray@plt>

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

LLVM IR (-O2):
define void @popcharacterarray_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
char *outs(p, s, maxl)
char *p;
short s;
long *maxl;
{
  short *q = (short *)p;
  if (*maxl < sizeof(short))
    fatal("out of space to store resource");
  *maxl = *maxl - sizeof(short);
  *q++ = s;
  return (char *)q;
}


x86 assembly (clang, -O0):
<outs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x2,(%rax)
jae    114b <outs+0x3b>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <fatal@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
sub    $0x2,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xa(%rbp),%cx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x2,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outs>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    (%rdx),%rax
cmp    $0x1,%rax
ja     1138 <outs+0x28>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <fatal@plt>
mov    0x0(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,0x0(%rbp)
mov    %r14w,(%rbx)
add    $0x2,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"out of space to store resource\00"
define i8* @outs(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i64*
%7 = alloca i16*
%8 = trunc i32 %1 to i16
store i8* %0, i8** %4
store i16 %8, i16* %5
store i64* %2, i64** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i16*
store i16* %10, i16** %7
%11 = load i64*, i64** %6
%12 = load i64, i64* %11
%13 = icmp ult i64 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = sub i64 %18, 2
%20 = load i64*, i64** %6
store i64 %19, i64* %20
%21 = load i16, i16* %5
%22 = load i16*, i16** %7
%23 = getelementptr inbounds i16, i16* %22, i32 1
store i16* %23, i16** %7
store i16 %21, i16* %22
%24 = load i16*, i16** %7
%25 = bitcast i16* %24 to i8*
ret i8* %25
}

LLVM IR (-O2):
@.str = [31 x i8] c"out of space to store resource\00"
define i8* @outs(i8* writeonly %0, i32 %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, 2
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %2
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %8, %6 ], [ %4, %3 ]
%11 = bitcast i8* %0 to i16*
%12 = trunc i32 %1 to i16
%13 = add i64 %10, -2
store i64 %13, i64* %2
%14 = getelementptr inbounds i8, i8* %0, i64 2
store i16 %12, i16* %11
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void cx_LongInt_print(long int *const value) { printf("%ldL", *value); }


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

x86 assembly (clang, -O2):
<cx_LongInt_print>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ldL\00"
define void @cx_LongInt_print(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int /*<<< orphan*/);
void unmap_file(void *data, uint64_t size) {
  if (!data)
    return;
  munmap(data, size);
}


x86 assembly (clang, -O0):
<unmap_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <unmap_file+0x1f>
jmp    113b <unmap_file+0x2b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @unmap_file(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @munmap(i8* %0, i32 %1)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gl2psPrintf(char *);
void gl2psPrintIPEFooter(void) { gl2psPrintf("</page>\n</ipe>\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"</page>\0A</ipe>\0A\00"
define void @gl2psPrintIPEFooter() {
%1 = call i32 @gl2psPrintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"</page>\0A</ipe>\0A\00"
define void @gl2psPrintIPEFooter() {
%1 = tail call i32 @gl2psPrintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int __capmax(unsigned int val, unsigned int max) {
  if (max < val) {
    return max;
  } else {
    return val;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @__capmax(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xaf() {
  Assert_real((isalpha(175) == 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_isalpha.c",
              880, ("isalpha should be 0 for 0xaf"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xaf>:
push   %rax
mov    $0xaf,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x370,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xaf\00"
define void @t_isalpha_0xaf() {
%1 = call i64 @isalpha(i32 175)
%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 880, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xaf\00"
define void @t_isalpha_0xaf() {
%1 = tail call i64 @isalpha(i32 175)
%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 880, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int16_t;

/* Variables and functions */
__attribute__((always_)) void LEUnpackInt16(int16_t *data,
                                            const uint8_t container[2]) {
  *data = (int16_t)container[0] | ((int16_t)container[1] << 8);
}


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

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

LLVM IR (-O0):
define void @LEUnpackInt16(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = load i64*, i64** %4
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
ret void
}

LLVM IR (-O2):
define void @LEUnpackInt16(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %1, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
store i32 %9, i32* %0
ret void
}
int cmp_int_ascend(const void *a, const void *b) {
  return (*(int *)a - *(int *)b);
}


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

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

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

LLVM IR (-O2):
define i32 @cmp_int_ascend(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int check_device(char *);
int /*<<< orphan*/ free(char *);
char *make_devname(char const *, char const *);
int check_input_device(const char *path, const char *name) {
  int ret;
  char *devname = make_devname(path, name);
  ret = check_device(devname);
  free(devname);
  return ret;
}


x86 assembly (clang, -O0):
<check_input_device>:
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 <make_devname@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <check_device@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_input_device>:
push   %rbp
push   %rbx
push   %rax
call   1040 <make_devname@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <check_device@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_input_device(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @make_devname(i8* %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @check_device(i8* %10)
store i32 %11, i32* %5
%12 = load i8*, i8** %6
%13 = call i32 @free(i8* %12)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @check_input_device(i8* %0, i8* %1) {
%3 = tail call i8* @make_devname(i8* %0, i8* %1)
%4 = tail call i32 @check_device(i8* %3)
%5 = tail call i32 @free(i8* %3)
ret i32 %4
}
int do_549() { return 549; }


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

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

LLVM IR (-O0):
define i32 @do_549() {
ret i32 549
}

LLVM IR (-O2):
define i32 @do_549() {
ret i32 549
}
void PPB_ann_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @PPB_ann_terminate() {
ret void
}
const char *_(const char *message) { return message; }


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

x86 assembly (clang, -O2):
<_>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @_(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
float sqrt(double);
float spec_power_to_roughness(float s) { return sqrt(2.0 / (s + 2.0)); }


x86 assembly (clang, -O0):
<spec_power_to_roughness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spec_power_to_roughness>:
cvtss2sd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @spec_power_to_roughness(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 2.000000e+00
%6 = fdiv double 2.000000e+00, %5
%7 = call float @sqrt(double %6)
ret float %7
}

LLVM IR (-O2):
define float @spec_power_to_roughness(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 2.000000e+00
%4 = fdiv double 2.000000e+00, %3
%5 = tail call float @sqrt(double %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void print_prompt() { write(1, "# ", 2); }


x86 assembly (clang, -O0):
<print_prompt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_prompt>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
define void @print_prompt() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
int main(int param) {
  int i = sizeof(3);
  int j = sizeof 3;
  int k = sizeof(int *);
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(
      stderr,
      "usage: %s [-V] [-f output] [-l] [-n] [-p] [-v] [-a|-s subdb] dbpath\n",
      prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
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    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [69 x i8] c"usage: %s [-V] [-f output] [-l] [-n] [-p] [-v] [-a|-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(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 ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"usage: %s [-V] [-f output] [-l] [-n] [-p] [-v] [-a|-s subdb] dbpath\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  foo(42);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 42)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gnu_ptrace(char *, void *);
void __attribute__((__no_instrument_function__))
__cyg_profile_func_exit(void *this_fn, void *call_site) {
  gnu_ptrace("exit", this_fn);
  (void)call_site;
}


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

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <gnu_ptrace@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"exit\00"
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @gnu_ptrace(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
define void @__cyg_profile_func_exit(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @gnu_ptrace(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_pascal_comment_entities();
int /*<<< orphan*/ test_pascal_comments();
void all_pascal_tests() {
  test_pascal_comments();
  test_pascal_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_pascal_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_pascal_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_pascal_comment_entities@plt>

LLVM IR (-O0):
define void @all_pascal_tests() {
%1 = call i32 (...) @test_pascal_comments()
%2 = call i32 (...) @test_pascal_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_pascal_tests() {
%1 = tail call i32 (...) @test_pascal_comments()
%2 = tail call i32 (...) @test_pascal_comment_entities()
ret void
}
/* Variables and functions */
char *strncpy(char *restrict dest, const char *restrict src, size_t n) {
  char *ret = dest;
  while (n--) {
    *dest++ = *src++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1158 <strncpy+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1118 <strncpy+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <strncpy+0x11>
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_get_prop_string() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_get_prop_string"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"NOT IMPLEMENTED:pa_format_info_get_prop_string\0A\00"
define i32 @pa_format_info_get_prop_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [47 x i8] c"NOT IMPLEMENTED:pa_format_info_get_prop_string\00"
define i32 @pa_format_info_get_prop_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int getAltSys(int pin) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getAltSys(i32 %0) {
ret i32 0
}