xunge/DecIR huggingface dataset:
/* Variables and functions */
int ft_strcmp(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char *ss = "bbd";
  char *dd = "abd";
  printf("%d", ft_strcmp(ss, dd));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ft_strcmp@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <ft_strcmp@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"bbd\00"
@.str.1 = [4 x i8] c"abd\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @ft_strcmp(i8* %4, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"bbd\00"
@.str.1 = [4 x i8] c"abd\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @ft_strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void Error_Quit(char const *msg) {
  fprintf(stderr, "WEBSERV: %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<Error_Quit>:
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):
<Error_Quit>:
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 = [13 x i8] c"WEBSERV: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @Error_Quit(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 ([13 x i8], [13 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 = [13 x i8] c"WEBSERV: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @Error_Quit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int do_566() { return 566; }


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

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

LLVM IR (-O0):
define i32 @do_566() {
ret i32 566
}

LLVM IR (-O2):
define i32 @do_566() {
ret i32 566
}
/* Variables and functions */
int sum(unsigned long long);
int solve(unsigned long long m, unsigned long long n) {
  return (10 + sum(n) - sum(m - 1)) % 10;
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sum@plt>
add    $0xa,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <sum@plt>
mov    %eax,%ebp
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rdi
call   1030 <sum@plt>
sub    %eax,%ebp
add    $0xa,%ebp
movslq %ebp,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solve(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @sum(i64 %5)
%7 = add nsw i32 10, %6
%8 = load i64, i64* %3
%9 = sub i64 %8, 1
%10 = call i32 @sum(i64 %9)
%11 = sub nsw i32 %7, %10
%12 = srem i32 %11, 10
ret i32 %12
}

LLVM IR (-O2):
define i32 @solve(i64 %0, i64 %1) {
%3 = tail call i32 @sum(i64 %1)
%4 = add nsw i32 %3, 10
%5 = add i64 %0, -1
%6 = tail call i32 @sum(i64 %5)
%7 = sub i32 %4, %6
%8 = srem i32 %7, 10
ret i32 %8
}
int is_digit(const char c) {
  if (c >= '0' && c <= '9') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_digit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_digit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_digit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  (void)fprintf(
      stderr,
      "usage: mesg [-q?] [-t tty] [y | n]\n	-q		-- quiet mode, "
      "suppress all output\n	-t tty		-- specify the tty to "
      "check/modify\n	-?		-- print this help message\n");
  (void)exit(2);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [152 x i8] c"usage: mesg [-q?] [-t tty] [y | n]\0A\09-q\09\09-- quiet mode, suppress all output\0A\09-t tty\09\09-- specify the tty to check/modify\0A\09-?\09\09-- print this help message\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [152 x i8] c"usage: mesg [-q?] [-t tty] [y | n]\0A\09-q\09\09-- quiet mode, suppress all output\0A\09-t tty\09\09-- specify the tty to check/modify\0A\09-?\09\09-- print this help message\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FlightStatsSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightStatsSettingsRequestUpdate() {
  UAVObjRequestUpdate(FlightStatsSettingsHandle());
}


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

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

LLVM IR (-O0):
define void @FlightStatsSettingsRequestUpdate() {
%1 = call i32 (...) @FlightStatsSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightStatsSettingsRequestUpdate() {
%1 = tail call i32 (...) @FlightStatsSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
void cio_file_st_set_meta_len(char *map, uint16_t len) {
  map[22] = (uint8_t)len >> 8;
  map[23] = (uint8_t)len;
}


x86 assembly (clang, -O0):
<cio_file_st_set_meta_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x16(%rax)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x17(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cio_file_st_set_meta_len>:
rol    $0x8,%si
mov    %si,0x16(%rdi)
ret

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

LLVM IR (-O2):
define void @cio_file_st_set_meta_len(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 8
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 22
store i8 %4, i8* %5
%6 = trunc i64 %1 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 23
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_uppercase(char *);
int main(int argc, char **argv) {
  print_uppercase("First test");
  print_uppercase("This is the second test!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"First test\00"
@.str.1 = [25 x i8] c"This is the second test!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @print_uppercase(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @print_uppercase(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"First test\00"
@.str.1 = [25 x i8] c"This is the second test!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @print_uppercase(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @print_uppercase(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *alloc(unsigned long);
int /*<<< orphan*/ byte_copy(void *, unsigned long, char const *);
unsigned long str_len(char const *);
void *str_dup(const char *s) {
  unsigned long n;
  void *ptr;
  n = str_len(s);
  ptr = alloc(n + 1);
  if (ptr)
    byte_copy(ptr, n + 1, s);
  return ptr;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <str_len@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117a <str_dup+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x8(%rbp),%rdx
call   1040 <byte_copy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <str_len@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <alloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1162 <str_dup+0x32>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <byte_copy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @str_len(i8* %0)
%3 = add i64 %2, 1
%4 = tail call i8* @alloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @byte_copy(i8* %4, i64 %3, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ sumtoby(scalar_t__, int);
uint64_t solve(uint64_t n) {
  return sumtoby(n, 3) + sumtoby(n, 5) - sumtoby(n, 15);
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <sumtoby@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <sumtoby@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xf,%esi
call   1030 <sumtoby@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x3,%esi
call   1030 <sumtoby@plt>
mov    %rax,%r14
mov    %r15,%rdi
mov    $0x5,%esi
call   1030 <sumtoby@plt>
mov    %rax,%rbx
add    %r14,%rbx
mov    %r15,%rdi
mov    $0xf,%esi
call   1030 <sumtoby@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @solve(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @sumtoby(i64 %3, i32 3)
%5 = load i64, i64* %2
%6 = call i64 @sumtoby(i64 %5, i32 5)
%7 = add nsw i64 %4, %6
%8 = load i64, i64* %2
%9 = call i64 @sumtoby(i64 %8, i32 15)
%10 = sub nsw i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @solve(i64 %0) {
%2 = tail call i64 @sumtoby(i64 %0, i32 3)
%3 = tail call i64 @sumtoby(i64 %0, i32 5)
%4 = add nsw i64 %3, %2
%5 = tail call i64 @sumtoby(i64 %0, i32 15)
%6 = sub i64 %4, %5
ret i64 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ internal_fiat_p384_nonzero(uintptr_t);
void fiat_p384_nonzero(uint32_t *out1, const uint32_t arg1[12]) {
  *out1 = (uint32_t)internal_fiat_p384_nonzero((uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_nonzero>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <internal_fiat_p384_nonzero@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @fiat_p384_nonzero(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = ptrtoint i64* %5 to i64
%7 = call i64 @internal_fiat_p384_nonzero(i64 %6)
%8 = load i64*, i64** %3
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @fiat_p384_nonzero(i64* nocapture writeonly %0, i64* %1) {
%3 = ptrtoint i64* %1 to i64
%4 = tail call i64 @internal_fiat_p384_nonzero(i64 %3)
store i64 %4, i64* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_IntRegister(int, void (*)());
void stub1(uint32_t);
void CRYPTOIntRegister(void (*pfnHandler)(void)) {
  NOROM_IntRegister(39, pfnHandler);
  ((void (*)(uint32_t ui32Interrupt))(
      (uint32_t *)(((uint32_t *)0x10000180)[12]))[4])(39);
}


x86 assembly (clang, -O0):
<CRYPTOIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x27,%edi
call   1030 <NOROM_IntRegister@plt>
mov    $0x10000180,%eax
mov    0x60(%rax),%rax
mov    $0x27,%edi
call   *0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTOIntRegister>:
push   %rax
mov    %rdi,%rsi
mov    $0x27,%edi
call   1030 <NOROM_IntRegister@plt>
mov    0x100001e0,%rax
10
mov    $0x27,%edi
pop    %rcx
jmp    *0x20(%rax)

LLVM IR (-O0):
define void @CRYPTOIntRegister(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @NOROM_IntRegister(i32 39, void (...)* %4)
%6 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 268435840 to i64*), i64 12)
%7 = inttoptr i64 %6 to i64*
%8 = getelementptr inbounds i64, i64* %7, i64 4
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to void (i64)*
ret void
}

LLVM IR (-O2):
define void @CRYPTOIntRegister(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @NOROM_IntRegister(i32 39, void (...)* %2)
%4 = load i64, i64* inttoptr (i64 268435936 to i64*)
%5 = inttoptr i64 %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 4
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to void (i64)*
tail call void %8(i64 39)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_close;
int syscall(int /*<<< orphan*/, int);
int close(int fd) {
  if (fd == 1021 || fd == 1022 || fd == 1023) {
    return 0;
  }
  return syscall(__NR_close, fd);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3fd,-0x8(%rbp)
je     1142 <close+0x32>
cmpl   $0x3fe,-0x8(%rbp)
je     1142 <close+0x32>
cmpl   $0x3ff,-0x8(%rbp)
jne    114e <close+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1162 <close+0x52>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    %edi,%esi
lea    -0x3fd(%rsi),%eax
cmp    $0x3,%eax
jae    1120 <close+0x10>
xor    %eax,%eax
ret
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_close = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1021
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1022
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 1023
br i1 %11, label %12, label %13
12: ; preds = %9, %6, %1
store i32 0, i32* %2
br label %17
13: ; preds = %9
%14 = load i32, i32* @__NR_close
%15 = load i32, i32* %3
%16 = call i32 @syscall(i32 %14, i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@__NR_close = global i32 0
define i32 @close(i32 %0) {
%2 = add i32 %0, -1021
%3 = icmp ult i32 %2, 3
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @__NR_close
%6 = tail call i32 @syscall(i32 %5, i32 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_line(const char const str[], int n) {
  int i = 0;
  for (i = 0; i < n; i++) {
    printf("%c", str[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <print_line+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <print_line+0x1d>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <print_line+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_line+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_line(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
char *hash_plugin_detailed(void) {
  return (
      "md5 - A simple md5 plugin\n"
      "------------------------\n"
      "Use this module to crack simple md5 hashes\n"
      "Input should be in form: \'user:hash\' or just \'hash\'\n"
      "Known software that uses this password hashing method:\n"
      "IPB < 2.0, MiniBB, phpBB < 3.0.0, Wordpress < 2.5, Joomla < 1.0.13,\n"
      "AdaptCMS Lite 1.5, b2evolution, Beehive, CMS Made Simple, DanneoCMS,\n"
      "CruxCMS, easyPortal, Flux CMS, Geek Log, Joomla < 1.0.13, Koobi CMS < "
      "6.x\n"
      "PHP-Fusion, PHP-Nuke, Serendipity < 1.4.1, Typo3, TangoCMS, XOOPS\n"
      "DeluxeBB, IPB < 2.x, PhpMyForum, W-Agora, WoltLab BB1 and BB2, Drupal\n"
      "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [594 x i8] c"md5 - A simple md5 plugin\0A------------------------\0AUse this module to crack simple md5 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AIPB < 2.0, MiniBB, phpBB < 3.0.0, Wordpress < 2.5, Joomla < 1.0.13,\0AAdaptCMS Lite 1.5, b2evolution, Beehive, CMS Made Simple, DanneoCMS,\0ACruxCMS, easyPortal, Flux CMS, Geek Log, Joomla < 1.0.13, Koobi CMS < 6.x\0APHP-Fusion, PHP-Nuke, Serendipity < 1.4.1, Typo3, TangoCMS, XOOPS\0ADeluxeBB, IPB < 2.x, PhpMyForum, W-Agora, WoltLab BB1 and BB2, Drupal\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([594 x i8], [594 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [594 x i8] c"md5 - A simple md5 plugin\0A------------------------\0AUse this module to crack simple md5 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AIPB < 2.0, MiniBB, phpBB < 3.0.0, Wordpress < 2.5, Joomla < 1.0.13,\0AAdaptCMS Lite 1.5, b2evolution, Beehive, CMS Made Simple, DanneoCMS,\0ACruxCMS, easyPortal, Flux CMS, Geek Log, Joomla < 1.0.13, Koobi CMS < 6.x\0APHP-Fusion, PHP-Nuke, Serendipity < 1.4.1, Typo3, TangoCMS, XOOPS\0ADeluxeBB, IPB < 2.x, PhpMyForum, W-Agora, WoltLab BB1 and BB2, Drupal\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([594 x i8], [594 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Programming C");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Programming C\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct lu_phy_attr {
  int dummy;
};

/* Variables and functions */
uint8_t dlt_media_load(struct lu_phy_attr *lu, int load) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.lu_phy_attr = type { i32 }
define i32 @dlt_media_load(%struct.lu_phy_attr* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_value(char const *, char const *, char const *,
                             char const *);
void set_enum(const char *group, const char *name, const char *key, int value,
              const char **map, int n) {
  if (value >= 0 && value < n)
    set_value(group, name, key, map[value]);
}


x86 assembly (clang, -O0):
<set_enum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     1162 <set_enum+0x52>
mov    -0x1c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1162 <set_enum+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
call   1030 <set_value@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_enum>:
test   %ecx,%ecx
js     1124 <set_enum+0x14>
cmp    %r9d,%ecx
jge    1124 <set_enum+0x14>
mov    %ecx,%eax
mov    (%r8,%rax,8),%rcx
jmp    1030 <set_value@plt>
ret

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

LLVM IR (-O2):
define void @set_enum(i8* %0, i8* %1, i8* %2, i32 %3, i8** nocapture %4, i32 %5) {
%7 = icmp sgt i32 %3, -1
%8 = icmp slt i32 %3, %5
%9 = and i1 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = zext i32 %3 to i64
%12 = getelementptr inbounds i8*, i8** %4, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @set_value(i8* %0, i8* %1, i8* %2, i8* %13)
br label %15
15: ; preds = %10, %6
ret void
}
/* Variables and functions */
scalar_t__ COND_HI();
int /*<<< orphan*/ EA_AY_DI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_shi_8_di(void) {
  m68ki_write_8(EA_AY_DI_8(), COND_HI() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_shi_8_di>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_DI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_HI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_shi_8_di>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_DI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_HI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_shi_8_di() {
%1 = call i32 (...) @EA_AY_DI_8()
%2 = call i64 (...) @COND_HI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_shi_8_di() {
%1 = tail call i32 (...) @EA_AY_DI_8()
%2 = tail call i64 (...) @COND_HI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int test_imm_26uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x26 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_26uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 38
%6 = icmp ne i64 %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_26uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 38
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RTTarFileSetOwner(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileSetOwner() {
ret void
}
void border_se_ext_corner_special_sand_long_vert(unsigned char *pic,
                                                 unsigned char *mirr) {
  *pic = 0x2F;
  ;
}


x86 assembly (clang, -O0):
<border_se_ext_corner_special_sand_long_vert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2f,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_se_ext_corner_special_sand_long_vert>:
movb   $0x2f,(%rdi)
ret

LLVM IR (-O0):
define void @border_se_ext_corner_special_sand_long_vert(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
store i8 47, i8* %5
ret void
}

LLVM IR (-O2):
define void @border_se_ext_corner_special_sand_long_vert(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 47, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void string_print(const void *a) { printf("%s", (char *)a); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @string_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int isPrime(long unsigned int num) {
  long unsigned int x;
  for (x = 2; x < num; x++) {
    if (num % x == 0 && x != num) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1164 <isPrime+0x64>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    114e <isPrime+0x4e>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     114e <isPrime+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    116b <isPrime+0x6b>
jmp    1153 <isPrime+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <isPrime+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%ecx
cmp    $0x3,%rdi
jb     1144 <isPrime+0x44>
mov    $0x2,%esi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1130 <isPrime+0x30>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
jne    113b <isPrime+0x3b>
jmp    1147 <isPrime+0x47>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
je     1147 <isPrime+0x47>
add    $0x1,%rsi
cmp    %rsi,%rdi
jne    1110 <isPrime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i64 %0) {
%2 = icmp ugt i64 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i64 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i64 [ %9, %3 ], [ 2, %1 ]
%7 = urem i64 %0, %6
%8 = icmp eq i64 %7, 0
%9 = add nuw i64 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
char val() { return 'a'; }


x86 assembly (clang, -O0):
<val>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val>:
mov    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @val() {
ret i8 97
}

LLVM IR (-O2):
define signext i8 @val() {
ret i8 97
}
/* Variables and functions */
int i2c_read_array(unsigned char, char *, int);
int i2c_read_byte(unsigned char addr, char *ch) {
  return i2c_read_array(addr, ch, 1);
}


x86 assembly (clang, -O0):
<i2c_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
movzbl %al,%edi
call   1030 <i2c_read_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read_byte>:
mov    $0x1,%edx
jmp    1030 <i2c_read_array@plt>

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

LLVM IR (-O2):
define i32 @i2c_read_byte(i8 zeroext %0, i8* %1) {
%3 = tail call i32 @i2c_read_array(i8 zeroext %0, i8* %1, i32 1)
ret i32 %3
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t bits(uint64_t u, unsigned int i, unsigned int j) {
  return (u & (((uint64_t)1 << (i + 1)) - ((uint64_t)1 << j))) >> j;
}


x86 assembly (clang, -O0):
<bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x10(%rbp),%ecx
sub    %edx,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits>:
lea    0x1(%rsi),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
add    %esi,%eax
and    %edi,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @bits(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 = add i32 %8, 1
%10 = shl i32 1, %9
%11 = load i32, i32* %6
%12 = shl i32 1, %11
%13 = sub i32 %10, %12
%14 = and i32 %7, %13
%15 = load i32, i32* %6
%16 = lshr i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @bits(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, 1
%5 = shl nuw i32 1, %4
%6 = shl nsw i32 -1, %2
%7 = add i32 %6, %5
%8 = and i32 %7, %0
%9 = lshr i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_lock_fd() {
  printf("NOT IMPLEMENTED:"
         "pa_lock_fd"
         "\n");
}


x86 assembly (clang, -O0):
<pa_lock_fd>:
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_lock_fd>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [27 x i8] c"NOT IMPLEMENTED:pa_lock_fd\00"
define i32 @pa_lock_fd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ symlink(char *, char *);
int main(int argc, char *argv[]) {
  if (symlink("Makefile", "Makefile2") == 0) {
    printf("ok");
  } else {
    perror("symlink");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <symlink@plt>
cmp    $0x0,%rax
jne    1174 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x50>
lea    0xe9b(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <symlink@plt>
test   %rax,%rax
jne    1159 <main+0x29>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1050 <perror@plt>
jmp    1155 <main+0x25>

LLVM IR (-O0):
@.str = [9 x i8] c"Makefile\00"
@.str.1 = [10 x i8] c"Makefile2\00"
@.str.2 = [3 x i8] c"ok\00"
@.str.3 = [8 x i8] c"symlink\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @symlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Makefile\00"
@.str.1 = [10 x i8] c"Makefile2\00"
@.str.2 = [3 x i8] c"ok\00"
@.str.3 = [8 x i8] c"symlink\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @symlink(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}
void gdb_register_trampoline(struct vm_method *method) {}


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

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

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

LLVM IR (-O2):
%struct.vm_method = type opaque
define void @gdb_register_trampoline(%struct.vm_method* nocapture %0) {
ret void
}
/* Variables and functions */
int look_for_symbol(void *, char *);
int detect_extrae(void *handle) {
  return look_for_symbol(handle, "Extrae_init");
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Extrae_init\00"
define i32 @detect_extrae(i8* %0) {
%2 = tail call i32 @look_for_symbol(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort();
int /*<<< orphan*/ copy_string();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ initialize_array();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  printf("Starting tests.\n");
  fflush(stdout);
  initialize_array();
  copy_string();
  bubble_sort();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1060 <initialize_array@plt>
mov    $0x0,%al
call   1030 <copy_string@plt>
mov    $0x0,%al
call   1070 <bubble_sort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1060 <initialize_array@plt>
xor    %eax,%eax
call   1040 <copy_string@plt>
xor    %eax,%eax
call   1070 <bubble_sort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Starting tests.\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = call i32 (...) @initialize_array()
%10 = call i32 (...) @copy_string()
%11 = call i32 (...) @bubble_sort()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [16 x i8] c"Starting tests.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 (...) @initialize_array()
%7 = tail call i32 (...) @copy_string()
%8 = tail call i32 (...) @bubble_sort()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(int);
int gpio_get_value(unsigned gpio) {
  WARN_ON(1);
  return 0;
}


x86 assembly (clang, -O0):
<gpio_get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <WARN_ON@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gpio_get_value(i32 %0) {
%2 = tail call i32 @WARN_ON(i32 1)
ret i32 0
}
void delay() {
  volatile int i = 0x10000;
  while (i--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x10000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1124 <delay+0x24>
jmp    110b <delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x10000,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store volatile i32 65536, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, -1
store volatile i32 %4, i32* %1
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 65536, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}