xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(char *program) {
  printf("Server mode: %s -l <listening port>\n", program);
  printf("Client mode: %s -h <host address> -p <port> -n <name>\n", program);
  return;
}


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

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Server mode: %s -l <listening port>\0A\00"
@.str.1 = [55 x i8] c"Client mode: %s -h <host address> -p <port> -n <name>\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Server mode: %s -l <listening port>\0A\00"
@.str.1 = [55 x i8] c"Client mode: %s -h <host address> -p <port> -n <name>\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_ECuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xEC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ECuint64_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, 236
%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_ECuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 236
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ bwputc(char);
int bwputstr(char *str) {
  while (*str) {
    if (bwputc(*str) < 0)
      return -1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bwputstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <bwputstr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <bwputc@plt>
cmp    $0x0,%rax
jge    114b <bwputstr+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <bwputstr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <bwputstr+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwputstr>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114f <bwputstr+0x3f>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <bwputc@plt>
test   %rax,%rax
js     114a <bwputstr+0x3a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <bwputstr+0x20>
jmp    114f <bwputstr+0x3f>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bwputstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i64 @bwputc(i8 signext %8)
%11 = icmp slt i64 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ -1, %7 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ mstring_get_length(char *);
char *mstring_get_sub_py(char *, int, scalar_t__);
char *mstring_grate(char *in) {
  return mstring_get_sub_py(in, 1, mstring_get_length(in) - 1);
}


x86 assembly (clang, -O0):
<mstring_grate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mstring_get_length@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
mov    $0x1,%esi
call   1030 <mstring_get_sub_py@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstring_grate>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mstring_get_length@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <mstring_get_sub_py@plt>

LLVM IR (-O0):
define i8* @mstring_grate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @mstring_get_length(i8* %4)
%6 = sub nsw i64 %5, 1
%7 = call i8* @mstring_get_sub_py(i8* %3, i32 1, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @mstring_grate(i8* %0) {
%2 = tail call i64 @mstring_get_length(i8* %0)
%3 = add nsw i64 %2, -1
%4 = tail call i8* @mstring_get_sub_py(i8* %0, i32 1, i64 %3)
ret i8* %4
}
int test_imm_AFuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xAF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AFuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 175
%7 = icmp ne i64 %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_AFuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11468800
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(scalar_t__, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
scalar_t__ STDIN_FILENO;
int select(scalar_t__, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int unix_text_kbhit(void) {
  struct timeval tv = {0, 0};
  fd_set readfds;
  FD_ZERO(&readfds);
  FD_SET(STDIN_FILENO, &readfds);
  return select(STDIN_FILENO + 1, &readfds, NULL, NULL, &tv) == 1;
}


x86 assembly (clang, -O0):
<unix_text_kbhit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0xc(%rbp),%rdi
call   1040 <FD_ZERO@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <FD_SET@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x8(%rbp),%r8
mov    %rcx,%rdx
call   1050 <select@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_text_kbhit>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
lea    0x14(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    0x2e8c(%rip),%rbx
mov    (%rbx),%rdi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
mov    (%rbx),%rdi
add    $0x1,%rdi
lea    0x8(%rsp),%r8
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@STDIN_FILENO = global i64 0
define i32 @unix_text_kbhit() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = bitcast %struct.timeval* %1 to i8*
%4 = call i32 @FD_ZERO(i32* %2)
%5 = load i64, i64* @STDIN_FILENO
%6 = call i32 @FD_SET(i64 %5, i32* %2)
%7 = load i64, i64* @STDIN_FILENO
%8 = add nsw i64 %7, 1
%9 = call i32 @select(i64 %8, i32* %2, i32* null, i32* null, %struct.timeval* %1)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@STDIN_FILENO = global i64 0
define i32 @unix_text_kbhit() {
%1 = alloca i64
%2 = bitcast i64* %1 to %struct.timeval*
%3 = alloca i32
%4 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%5 = bitcast i32* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %3)
%7 = load i64, i64* @STDIN_FILENO
%8 = call i32 @FD_SET(i64 %7, i32* %3)
%9 = load i64, i64* @STDIN_FILENO
%10 = add nsw i64 %9, 1
%11 = call i32 @select(i64 %10, i32* %3, i32* null, i32* null, %struct.timeval* %2)
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
short sqrt(short);
short internal_sqrt_s(short value) { return sqrt(value); }


x86 assembly (clang, -O0):
<internal_sqrt_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
call   1030 <sqrt@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_sqrt_s>:
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define signext i16 @internal_sqrt_s(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call signext i16 @sqrt(i16 signext %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @internal_sqrt_s(i16 signext %0) {
%2 = tail call signext i16 @sqrt(i16 signext %0)
ret i16 %2
}
void str_replace_cr(char *src) {
  char *ptr = src;
  while (*ptr++ != '\0') {
    if ((*ptr == '\r') || (*ptr == '\n')) {
      *ptr = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<str_replace_cr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115c <str_replace_cr+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     114b <str_replace_cr+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1157 <str_replace_cr+0x57>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    115c <str_replace_cr+0x5c>
jmp    1110 <str_replace_cr+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_replace_cr>:
mov    (%rdi),%al
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
test   %al,%al
je     1127 <str_replace_cr+0x27>
movzbl (%rdi),%eax
add    $0x1,%rdi
cmp    $0xd,%al
je     1123 <str_replace_cr+0x23>
cmp    $0xa,%al
jne    1110 <str_replace_cr+0x10>
movb   $0x0,-0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @str_replace_cr(i8* nocapture %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %8, %1
%4 = phi i8 [ %9, %8 ], [ %2, %1 ]
%5 = phi i8* [ %6, %8 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = icmp eq i8 %4, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = load i8, i8* %6
switch i8 %9, label %3 [
i8 13, label %10
i8 10, label %10
]
10: ; preds = %8, %8
store i8 0, i8* %6
br label %11
11: ; preds = %3, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ embedded_ltoa(char *, long, int, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, char);
unsigned int embedded_prints(char *, int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int print_long(long number) {
  char buffer[36];
  embedded_ltoa(buffer, number, 10, 1, 0, 0, 'a');
  return embedded_prints(buffer, 0, 0);
}


x86 assembly (clang, -O0):
<print_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xa,%edx
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x61,(%rsp)
call   1030 <embedded_ltoa@plt>
lea    -0x30(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <embedded_prints@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_long>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rsi
movl   $0x61,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <embedded_ltoa@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <embedded_prints@plt>
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @print_long(i64 %0) {
%2 = alloca [36 x i8]
%3 = getelementptr inbounds [36 x i8], [36 x i8]* %2, i64 0, i64 0
%4 = call i32 @embedded_ltoa(i8* %3, i64 %0, i32 10, i32 1, i32 0, i32 0, i8 signext 97)
%5 = call i32 @embedded_prints(i8* %3, i32 0, i32 0)
ret i32 %5
}
/* Variables and functions */
double atof_ext(char *);
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int len;
  double resul;
  char cadena[100];
  while ((len = get_line(cadena, 100)) > 0) {
    resul = atof_ext(cadena);
    printf("%g\n", resul);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1180 <main+0x50>
lea    -0x80(%rbp),%rdi
call   1040 <atof_ext@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1181 <main+0x51>
mov    %rsp,%rbx
lea    0xeae(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <atof_ext@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [100 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = call i32 @get_line(i8* %6, i32 100)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%11 = call double @atof_ext(i8* %10)
store double %11, double* %3
%12 = load double, double* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %12)
br label %5
14: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 100)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call double @atof_ext(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call i32 @get_line(i8* %2, i32 100)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
void foo317() {}


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

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

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

LLVM IR (-O2):
define void @foo317() {
ret void
}
/* Variables and functions */
int __builtin_allegrex_trunc_w_s(float);
int pspFpuTrunc(float fs) { return (__builtin_allegrex_trunc_w_s(fs)); }


x86 assembly (clang, -O0):
<pspFpuTrunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_allegrex_trunc_w_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pspFpuTrunc>:
jmp    1030 <__builtin_allegrex_trunc_w_s@plt>

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

LLVM IR (-O2):
define i32 @pspFpuTrunc(float %0) {
%2 = tail call i32 @__builtin_allegrex_trunc_w_s(float %0)
ret i32 %2
}
void longjmp() {}


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

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

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

LLVM IR (-O2):
define void @longjmp() {
ret void
}
void nseel_asm_mod_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_mod_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawString(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ hex2str(unsigned int);
void drawHex(unsigned val, int x, int y) { drawString(hex2str(val), x, y); }


x86 assembly (clang, -O0):
<drawHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hex2str@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <drawString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawHex>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1040 <hex2str@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <drawString@plt>

LLVM IR (-O0):
define void @drawHex(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 = call i32 @hex2str(i32 %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @drawString(i32 %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @drawHex(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @hex2str(i32 %0)
%5 = tail call i32 @drawString(i32 %4, i32 %1, i32 %2)
ret void
}
unsigned long ori(unsigned char ra, unsigned char rs, unsigned short uimm) {
  return (24 << 26) | (rs << 21) | (ra << 16) | (uimm << 0);
}


x86 assembly (clang, -O0):
<ori>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x15,%eax
or     $0x60000000,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzwl -0x4(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<ori>:
mov    %esi,%eax
shl    $0x15,%rax
mov    %edi,%ecx
shl    $0x10,%rcx
or     %rax,%rcx
mov    %edx,%eax
add    %rcx,%rax
add    $0x60000000,%rax
ret

LLVM IR (-O0):
define i64 @ori(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i16
store i8 %0, i8* %4
store i8 %1, i8* %5
store i16 %2, i16* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 21
%10 = or i32 1610612736, %9
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %10, %13
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = shl i32 %16, 0
%18 = or i32 %14, %17
%19 = sext i32 %18 to i64
ret i64 %19
}

LLVM IR (-O2):
define i64 @ori(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2) {
%4 = zext i8 %1 to i64
%5 = shl nuw nsw i64 %4, 21
%6 = zext i8 %0 to i64
%7 = shl nuw nsw i64 %6, 16
%8 = zext i16 %2 to i64
%9 = or i64 %7, %5
%10 = or i64 %9, %8
%11 = or i64 %10, 1610612736
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void release_forcewake_lock(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<release_forcewake_lock>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @release_forcewake_lock(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
int starts_with(char *str, char c) {
  if (strlen(str) > 0 && str[0] == c)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1154 <starts_with+0x44>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1154 <starts_with+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115b <starts_with+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
jle    112c <starts_with+0x1c>
mov    $0x1,%eax
cmp    %bpl,(%rbx)
je     112e <starts_with+0x1e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, %1
br i1 %7, label %9, label %8
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %10
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
double timespectod(struct timespec a) { return a.tv_sec + a.tv_nsec / 1e9; }


x86 assembly (clang, -O0):
<timespectod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespectod>:
cvtsi2sd %edi,%xmm1
divsd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
define double @timespectod(double %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { double, i32 }*
%5 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 1
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+09
%13 = fadd double %8, %12
ret double %13
}

LLVM IR (-O2):
define double @timespectod(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %3, 1.000000e+09
%5 = fadd double %4, %0
ret double %5
}
/* Type definitions */
struct xml_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _xml_path_count(struct xml_node *, char *, int *);
int xml_path_count(struct xml_node *root, char *path) {
  int count = 0;
  _xml_path_count(root, path, &count);
  return count;
}


x86 assembly (clang, -O0):
<xml_path_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <_xml_path_count@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_path_count>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <_xml_path_count@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.xml_node = type { i32 }
define i32 @xml_path_count(%struct.xml_node* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @_xml_path_count(%struct.xml_node* %0, i8* %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
void g_thread_init() {}


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

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

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

LLVM IR (-O2):
define void @g_thread_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void errorHandler(char errorText[]) {
  fprintf(stderr, "\n%s\n", errorText);
  fprintf(stderr, "*** PROGRAM TERMINATED ***\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<errorHandler>:
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
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

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


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

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

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

LLVM IR (-O2):
define void @screen_blank() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_error(char *);
void err_iface_down(void) { write_error("Specified interface not active"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"Specified interface not active\00"
define void @err_iface_down() {
%1 = call i32 @write_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Specified interface not active\00"
define void @err_iface_down() {
%1 = tail call i32 @write_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void _quick_sort(int array[], int low, int high) {
  int pivot;
  if (low < high) {
    pivot = partition(array, low, high);
    _quick_sort(array, low, pivot);
    _quick_sort(array, pivot + 1, high);
  }
}


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

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

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

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


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
jmp    1030 <atan2@plt>

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

LLVM IR (-O2):
define double @f4(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
void arrayZeroFill(int array[], int size) {
  for (int i = 0; i < size; i++) {
    array[i] = 0;
  }
}


x86 assembly (clang, -O0):
<arrayZeroFill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <arrayZeroFill+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <arrayZeroFill+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayZeroFill>:
test   %esi,%esi
jle    1126 <arrayZeroFill+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @arrayZeroFill(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
void foo() {
  char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd";
  bar(Blah);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x3a,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <bar@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x48,%rsp
movups 0xf0f(%rip),%xmm0
movups %xmm0,0x2a(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <bar@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.foo.Blah = [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00"
define void @foo() {
%1 = alloca [58 x i8]
%2 = bitcast [58 x i8]* %1 to i8*
%3 = getelementptr inbounds [58 x i8], [58 x i8]* %1, i64 0, i64 0
%4 = call i32 @bar(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.foo.Blah = [58 x i8] c"asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd\00"
define void @foo() {
%1 = alloca [58 x i8]
%2 = getelementptr inbounds [58 x i8], [58 x i8]* %1, i64 0, i64 0
%3 = call i32 @bar(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat3d_copy(double *, double const *);
int /*<<< orphan*/ mat3d_transpose(double *);
void mat3d_transpose_new(double dest[9], const double src[9]) {
  mat3d_copy(dest, src);
  mat3d_transpose(dest);
}


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

x86 assembly (clang, -O2):
<mat3d_transpose_new>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3d_copy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mat3d_transpose@plt>

LLVM IR (-O0):
define void @mat3d_transpose_new(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @mat3d_copy(double* %5, double* %6)
%8 = load double*, double** %3
%9 = call i32 @mat3d_transpose(double* %8)
ret void
}

LLVM IR (-O2):
define void @mat3d_transpose_new(double* %0, double* %1) {
%3 = tail call i32 @mat3d_copy(double* %0, double* %1)
%4 = tail call i32 @mat3d_transpose(double* %0)
ret void
}
int get_det_bytes(int det_no) {
  int det_bytes = det_no;
  if ((det_no / 8) < det_no) {
    det_bytes /= 8;
    det_bytes++;
  } else {
    det_bytes /= 8;
  }
  return det_bytes;
}


x86 assembly (clang, -O0):
<get_det_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    -0x4(%rbp),%eax
jge    113d <get_det_bytes+0x3d>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <get_det_bytes+0x4b>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_det_bytes>:
lea    0x7(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x3,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
setl   %al
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_det_bytes(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = icmp slt i32 %2, %0
%4 = zext i1 %3 to i32
%5 = add nsw i32 %2, %4
ret i32 %5
}
/* Variables and functions */
int fix_bad_code(char *pstring) {
  if (pstring == NULL || *pstring == '\0')
    return 0;
  while (*pstring++ != '\0')
    ;
  *(pstring - 2) = 'Z';
  return 1;
}


x86 assembly (clang, -O0):
<fix_bad_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <fix_bad_code+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <fix_bad_code+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1163 <fix_bad_code+0x63>
jmp    1134 <fix_bad_code+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1154 <fix_bad_code+0x54>
jmp    1134 <fix_bad_code+0x34>
mov    -0x10(%rbp),%rax
movb   $0x5a,-0x2(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_bad_code>:
xor    %eax,%eax
test   %rdi,%rdi
je     1122 <fix_bad_code+0x22>
cmpb   $0x0,(%rdi)
je     1122 <fix_bad_code+0x22>
add    $0x1,%rdi
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <fix_bad_code+0x10>
movb   $0x5a,-0x2(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fix_bad_code(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
store i8 90, i8* %7
br label %12
12: ; preds = %1, %3, %11
%13 = phi i32 [ 1, %11 ], [ 0, %3 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *makefilename(const char *prefix, const char *suffix) {
  char *filename;
  filename =
      (char *)malloc((strlen(prefix) + strlen(suffix) + 1) * sizeof(char));
  strcpy(filename, prefix);
  strcat(filename, suffix);
  return (filename);
}


x86 assembly (clang, -O0):
<makefilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makefilename>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @makefilename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %7, %9
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %5
%21 = load i8*, i8** %4
%22 = call i32 @strcat(i8* %20, i8* %21)
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @makefilename(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ __NOP();
void wait(unsigned long delay) {
  while (delay--) {
    __NOP();
  }
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1141 <wait+0x31>
mov    $0x0,%al
call   1030 <__NOP@plt>
jmp    111c <wait+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rbx
test   %rdi,%rdi
je     112d <wait+0x1d>
mov    %rdi,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <__NOP@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <wait+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @wait(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ %0, %1 ]
%5 = add i64 %4, -1
%6 = tail call i32 (...) @__NOP()
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(const char *bin) {
  printf("Usage: %s inputfile [outputfile]\n", bin);
  printf(
      "  inputfile:  The inputfile may not add the file extension (i0..i3).\n");
  printf("  outputfile: The outputfile parameter is optional.\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: %s inputfile [outputfile]\0A\00"
@.str.1 = [70 x i8] c" inputfile: The inputfile may not add the file extension (i0..i3).\0A\00"
@.str.2 = [53 x i8] c" outputfile: The outputfile parameter is optional.\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: %s inputfile [outputfile]\0A\00"
@str = [69 x i8] c" inputfile: The inputfile may not add the file extension (i0..i3).\00"
@str.3 = [52 x i8] c" outputfile: The outputfile parameter is optional.\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.3, i64 0, i64 0))
ret void
}