xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ argint(int, int *);
int /*<<< orphan*/ curproc();
int fetchstr(int /*<<< orphan*/, int, char **);
int argstr(int n, char **pp) {
  int addr;
  if (argint(n, &addr) < 0)
    return -1;
  return fetchstr(curproc(), addr, pp);
}


x86 assembly (clang, -O0):
<argstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1050 <argint@plt>
cmp    $0x0,%rax
jge    1161 <argstr+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <argstr+0x49>
mov    $0x0,%al
call   1030 <curproc@plt>
mov    %eax,%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <fetchstr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argstr>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xc(%rsp),%rsi
call   1050 <argint@plt>
test   %rax,%rax
js     115e <argstr+0x2e>
xor    %eax,%eax
call   1030 <curproc@plt>
mov    0xc(%rsp),%esi
mov    %eax,%edi
mov    %rbx,%rdx
call   1040 <fetchstr@plt>
jmp    1163 <argstr+0x33>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @argstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @argint(i32 %0, i32* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = call i32 (...) @curproc()
%9 = load i32, i32* %3
%10 = call i32 @fetchstr(i32 %8, i32 %9, i8** %1)
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ %10, %7 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d\n%d", &a, &b);
  printf("%d minutos.\n", (60 * a + b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
imul   $0x3c,-0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
imul   $0x3c,0x4(%rsp),%esi
add    (%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d\0A%d\00"
@.str.1 = [13 x i8] c"%d minutos.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 60, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d\0A%d\00"
@.str.1 = [13 x i8] c"%d minutos.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, 60
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
void mcsafe_inject_dst(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @mcsafe_inject_dst(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ff_flex_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<ff_flex_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ff_flex_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
void advance(char **form) {
  (*form)++;
  while (isspace(**form))
    (*form)++;
}


x86 assembly (clang, -O0):
<advance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1156 <advance+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    112a <advance+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <advance+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @advance(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myMapLines();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  myMapLines();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1030 <myMapLines@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @myMapLines()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @myMapLines()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void snail_cnt_start(void) {
  mbus_remote_register_write(0x3, 0x01, ((0 << 5) | (1 << 4) | (2 << 2) | (1)));
}


x86 assembly (clang, -O0):
<snail_cnt_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x19,%edx
call   1030 <mbus_remote_register_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snail_cnt_start>:
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x19,%edx
jmp    1030 <mbus_remote_register_write@plt>

LLVM IR (-O0):
define void @snail_cnt_start() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 1, i32 25)
ret void
}

LLVM IR (-O2):
define void @snail_cnt_start() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 1, i32 25)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main(int agrc, char *argv[]) {
  printf("hallo\n");
  char buffer[512] = {0};
  gets(buffer);
  printf(buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
lea    -0x210(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x210(%rbp),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    $0x200,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"hallo\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [512 x i8]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @printf(i8* %5)
ret i32 0
}
/* Variables and functions */
int mwsp_send_command(int, int, int);
int mwsp_acc_calibration(int fd) { return mwsp_send_command(fd, 205, 0x1); }


x86 assembly (clang, -O0):
<mwsp_acc_calibration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xcd,%esi
mov    $0x1,%edx
call   1030 <mwsp_send_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mwsp_acc_calibration>:
mov    $0xcd,%esi
mov    $0x1,%edx
jmp    1030 <mwsp_send_command@plt>

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

LLVM IR (-O2):
define i32 @mwsp_acc_calibration(i32 %0) {
%2 = tail call i32 @mwsp_send_command(i32 %0, i32 205, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
uint string_hash_from(const char *str) {
  uint hash = *str;
  while (*str++)
    hash = hash * 31 + *str;
  return hash;
}


x86 assembly (clang, -O0):
<string_hash_from>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     113f <string_hash_from+0x3f>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <string_hash_from+0x12>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash_from>:
movsbl (%rdi),%ecx
test   %ecx,%ecx
je     1125 <string_hash_from+0x25>
add    $0x1,%rdi
mov    %ecx,%eax
nopl   (%rax)
shl    $0x5,%eax
sub    %ecx,%eax
movsbl (%rdi),%edx
add    %edx,%eax
add    $0x1,%rdi
mov    %eax,%ecx
test   %edx,%edx
jne    1110 <string_hash_from+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash_from(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1
%5 = sext i8 %2 to i32
br label %6
6: ; preds = %4, %6
%7 = phi i8* [ %9, %6 ], [ %0, %4 ]
%8 = phi i32 [ %13, %6 ], [ %5, %4 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul nsw i32 %8, 31
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = add nsw i32 %10, %12
%14 = icmp eq i8 %11, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %1
%16 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int startwith(char *source, const char *pattern) {
  return !memcmp(source, pattern, strlen(pattern));
}


x86 assembly (clang, -O0):
<startwith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startwith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startwith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @memcmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @startwith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char getchar();
int main(void) {
  int a, i, j, teller;
  char s[25];
  for (i = 0; (s[i] = getchar()) != '\n'; i++)
    ;
  s[i] = '\0';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
movslq -0xc(%rbp),%rcx
mov    %al,-0x30(%rbp,%rcx,1)
movsbl %al,%eax
cmp    $0xa,%eax
je     1154 <main+0x44>
jmp    1146 <main+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x30(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inlinedIsDifferent(int /*<<< orphan*/);
void testInlinedIsDifferent() { inlinedIsDifferent(0); }


x86 assembly (clang, -O0):
<testInlinedIsDifferent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <inlinedIsDifferent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInlinedIsDifferent>:
xor    %edi,%edi
jmp    1030 <inlinedIsDifferent@plt>

LLVM IR (-O0):
define void @testInlinedIsDifferent() {
%1 = call i32 @inlinedIsDifferent(i32 0)
ret void
}

LLVM IR (-O2):
define void @testInlinedIsDifferent() {
%1 = tail call i32 @inlinedIsDifferent(i32 0)
ret void
}
/* Variables and functions */
int EOF;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", EOF);
  return EXIT_SUCCESS;
}


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)
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
@EXIT_SUCCESS = 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 = load i32, i32* @EOF
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int test_imm_92int64_highword_reg(long long val) {
  return ((val >> 32) & (0x92 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_92int64_highword_reg>:
movabs $0x9200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_92int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 146
%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_92int64_highword_reg(i64 %0) {
%2 = and i64 %0, 627065225216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ wpa_cli_close_connection();
void wpa_cli_terminate(int sig) {
  wpa_cli_close_connection();
  exit(0);
}


x86 assembly (clang, -O0):
<wpa_cli_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <wpa_cli_close_connection@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<wpa_cli_terminate>:
push   %rax
xor    %eax,%eax
call   1030 <wpa_cli_close_connection@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @wpa_cli_terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @wpa_cli_close_connection()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @wpa_cli_terminate(i32 %0) {
%2 = tail call i32 (...) @wpa_cli_close_connection()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t gte_int16_t(int16_t a, int16_t b) { return a >= b; }


x86 assembly (clang, -O0):
<gte_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gte_int16_t>:
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @gte_int16_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gte_int16_t(i32 %0, i32 %1) {
%3 = icmp sge i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void finalize_connection_context(void *ctx) {
  int *context = ctx;
  free(context);
}


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

x86 assembly (clang, -O2):
<finalize_connection_context>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @finalize_connection_context(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @free(i32* %6)
ret void
}

LLVM IR (-O2):
define void @finalize_connection_context(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @free(i32* %2)
ret void
}
int compara(void *x1, void *x2) {
  int *p1 = x1, *p2 = x2;
  if (*p1 < *p2)
    return -1;
  return *p1 > *p2;
}


x86 assembly (clang, -O0):
<compara>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <compara+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <compara+0x51>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compara(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void platform_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @platform_initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ res_hl(int);
void opcb_9e() { res_hl(3); }


x86 assembly (clang, -O0):
<opcb_9e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <res_hl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcb_9e>:
mov    $0x3,%edi
jmp    1030 <res_hl@plt>

LLVM IR (-O0):
define void @opcb_9e() {
%1 = call i32 @res_hl(i32 3)
ret void
}

LLVM IR (-O2):
define void @opcb_9e() {
%1 = tail call i32 @res_hl(i32 3)
ret void
}
void sws_scaleVec() {}


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

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

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

LLVM IR (-O2):
define void @sws_scaleVec() {
ret void
}
int isincr(unsigned int num) {
  int prev = 10;
  while (num) {
    unsigned int digit = num % 10;
    num /= 10;
    if (digit > prev)
      return 0;
    prev = digit;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isincr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1159 <isincr+0x59>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    114e <isincr+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1160 <isincr+0x60>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isincr+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isincr>:
mov    $0xa,%ecx
mov    $0xcccccccd,%eax
nopw   0x0(%rax,%rax,1)
test   %edi,%edi
je     1131 <isincr+0x31>
mov    %edi,%edx
imul   %rax,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %esi,%edi
cmp    %ecx,%edi
mov    %edi,%ecx
mov    %edx,%edi
jbe    1110 <isincr+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isincr(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ %0, %1 ], [ %8, %6 ]
%4 = phi i32 [ 10, %1 ], [ %7, %6 ]
%5 = icmp eq i32 %3, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = urem i32 %3, 10
%8 = udiv i32 %3, 10
%9 = icmp ugt i32 %7, %4
br i1 %9, label %10, label %2
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int f283(int *);
int f284(int *p) { return f283(p); }


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

x86 assembly (clang, -O2):
<f284>:
jmp    1030 <f283@plt>

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

LLVM IR (-O2):
define i32 @f284(i32* %0) {
%2 = tail call i32 @f283(i32* %0)
ret i32 %2
}
/* Variables and functions */
int UTF8_putc(unsigned char *, int, unsigned long);
int cpy_utf8(unsigned long value, void *arg) {
  unsigned char **p;
  int ret;
  p = arg;
  ret = UTF8_putc(*p, 0xff, value);
  *p += ret;
  return 1;
}


x86 assembly (clang, -O0):
<cpy_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xff,%esi
call   1030 <UTF8_putc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy_utf8>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    (%rsi),%rdi
mov    $0xff,%esi
call   1030 <UTF8_putc@plt>
cltq
add    %rax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpy_utf8(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i64 %0, i64* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = load i64, i64* %3
%12 = call i32 @UTF8_putc(i8* %10, i32 255, i64 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i8**, i8*** %5
%15 = load i8*, i8** %14
%16 = sext i32 %13 to i64
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8* %17, i8** %14
ret i32 1
}

LLVM IR (-O2):
define i32 @cpy_utf8(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @UTF8_putc(i8* %4, i32 255, i64 %0)
%6 = load i8*, i8** %3
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** %3
ret i32 1
}
/* Variables and functions */
int sock_connect(char *);
int /*<<< orphan*/ usage();
int sock_init(int argc, char **argv) {
  int fd;
  if (argc < 3) {
    usage();
    return -1;
  }
  fd = sock_connect(argv[2]);
  if (fd == -1) {
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<sock_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114c <sock_init+0x2c>
mov    $0x0,%al
call   1030 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <sock_init+0x58>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <sock_connect@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1172 <sock_init+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <sock_init+0x58>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_init>:
push   %rax
cmp    $0x2,%edi
jg     1134 <sock_init+0x14>
xor    %eax,%eax
call   1030 <usage@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x10(%rsi),%rdi
pop    %rax
jmp    1040 <sock_connect@plt>

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

LLVM IR (-O2):
define i32 @sock_init(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @sock_connect(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ -1, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
long double acosd(long double);
long double acosd_neg(long double x) { return -acosd(x); }


x86 assembly (clang, -O0):
<acosd_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <acosd@plt>
fchs
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosd_neg>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <acosd@plt>
fchs
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @acosd_neg(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @acosd(x86_fp80 %3)
%5 = fneg x86_fp80 %4
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @acosd_neg(x86_fp80 %0) {
%2 = tail call x86_fp80 @acosd(x86_fp80 %0)
%3 = fneg x86_fp80 %2
ret x86_fp80 %3
}
/* Variables and functions */
float __p_exp_pos(float const);
float _p_exp(const float x) {
  if (x >= 0.f)
    return __p_exp_pos(x);
  else
    return 1.f / __p_exp_pos(-x);
}


x86 assembly (clang, -O0):
<_p_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1142 <_p_exp+0x32>
movss  -0x8(%rbp),%xmm0
call   1030 <__p_exp_pos@plt>
movss  %xmm0,-0x4(%rbp)
jmp    116d <_p_exp+0x5d>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <__p_exp_pos@plt>
movaps %xmm0,%xmm1
movss  0xe9c(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_p_exp>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    1136 <_p_exp+0x26>
push   %rax
xorps  0xee0(%rip),%xmm0
call   1030 <__p_exp_pos@plt>
movss  0xee3(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret
jmp    1030 <__p_exp_pos@plt>

LLVM IR (-O0):
define float @_p_exp(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = call float @__p_exp_pos(float %7)
store float %8, float* %2
br label %14
9: ; preds = %1
%10 = load float, float* %3
%11 = fneg float %10
%12 = call float @__p_exp_pos(float %11)
%13 = fdiv float 1.000000e+00, %12
store float %13, float* %2
br label %14
14: ; preds = %9, %6
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @_p_exp(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call float @__p_exp_pos(float %0)
br label %9
5: ; preds = %1
%6 = fneg float %0
%7 = tail call float @__p_exp_pos(float %6)
%8 = fdiv float 1.000000e+00, %7
br label %9
9: ; preds = %5, %3
%10 = phi float [ %4, %3 ], [ %8, %5 ]
ret float %10
}
int do_fs_super_free(struct stp_fs_info *sb) { return -1; }


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

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

LLVM IR (-O0):
%struct.stp_fs_info = type opaque
define i32 @do_fs_super_free(%struct.stp_fs_info* %0) {
%2 = alloca %struct.stp_fs_info*
store %struct.stp_fs_info* %0, %struct.stp_fs_info** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.stp_fs_info = type opaque
define i32 @do_fs_super_free(%struct.stp_fs_info* nocapture readnone %0) {
ret i32 -1
}
int get_msb(int x) {
  unsigned shift_val = (sizeof(int) - 1u) << 3;
  int xright = x >> shift_val;
  return xright & 0xFF;
}


x86 assembly (clang, -O0):
<get_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msb>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @get_msb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 24, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = ashr i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_msb(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
/* Variables and functions */
char *ltrim(char *);
int /*<<< orphan*/ rtrim(char *);
char *trim(char *p) {
  rtrim(p);
  return ltrim(p);
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rtrim@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ltrim@plt>

LLVM IR (-O0):
define i8* @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @rtrim(i8* %3)
%5 = load i8*, i8** %2
%6 = call i8* @ltrim(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @trim(i8* %0) {
%2 = tail call i32 @rtrim(i8* %0)
%3 = tail call i8* @ltrim(i8* %0)
ret i8* %3
}
int clzi(int x) { return __builtin_clz(x); }


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

x86 assembly (clang, -O2):
<clzi>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @clzi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @clzi(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int SSLeay_add_ssl_algorithms();
int SSL_library_init() { return SSLeay_add_ssl_algorithms(); }


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

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

LLVM IR (-O0):
define i32 @SSL_library_init() {
%1 = call i32 (...) @SSLeay_add_ssl_algorithms()
ret i32 %1
}

LLVM IR (-O2):
define i32 @SSL_library_init() {
%1 = tail call i32 (...) @SSLeay_add_ssl_algorithms()
ret i32 %1
}
__attribute__((patchable_function_entry(0, 0))) void f00() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @f00() {
ret void
}
int K256GetBitVal(const char *Key, int n) {
  return Key[n >> 3] >> ((n & 7) ^ 7);
}


x86 assembly (clang, -O0):
<K256GetBitVal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
xor    $0x7,%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<K256GetBitVal>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
cltq
movsbl (%rdi,%rax,1),%eax
not    %cl
and    $0x7,%cl
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @K256GetBitVal(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %1, 7
%9 = xor i32 %8, 7
%10 = ashr i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ diff(char *, char *);
int main() { diff("a.txt", "b.txt"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"a.txt\00"
@.str.1 = [6 x i8] c"b.txt\00"
define i32 @main() {
%1 = call i32 @diff(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a.txt\00"
@.str.1 = [6 x i8] c"b.txt\00"
define i32 @main() {
%1 = tail call i32 @diff(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AUDDRV_VOIF_Stop();
void VoIF_Deinit() {
  AUDDRV_VOIF_Stop();
  return;
}


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

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

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

LLVM IR (-O2):
define void @VoIF_Deinit() {
%1 = tail call i32 (...) @AUDDRV_VOIF_Stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, unsigned char *, int);
unsigned char *int_deserialize(unsigned char *buffer, int *n) {
  memcpy(n, buffer, sizeof(int));
  return (buffer + sizeof(int));
}


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

x86 assembly (clang, -O2):
<int_deserialize>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @int_deserialize(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @memcpy(i32* %5, i8* %6, i32 4)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 4
ret i8* %9
}

LLVM IR (-O2):
define i8* @int_deserialize(i8* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %1, i8* %0, i32 4)
%4 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int, int, int);
void DoRTickCopy(void) { InlineWords(4, 41, 42, 16, 40); }


x86 assembly (clang, -O0):
<DoRTickCopy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x29,%esi
mov    $0x2a,%edx
mov    $0x10,%ecx
mov    $0x28,%r8d
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoRTickCopy>:
mov    $0x4,%edi
mov    $0x29,%esi
mov    $0x2a,%edx
mov    $0x10,%ecx
mov    $0x28,%r8d
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoRTickCopy() {
%1 = call i32 @InlineWords(i32 4, i32 41, i32 42, i32 16, i32 40)
ret void
}

LLVM IR (-O2):
define void @DoRTickCopy() {
%1 = tail call i32 @InlineWords(i32 4, i32 41, i32 42, i32 16, i32 40)
ret void
}
/* Variables and functions */
char get_mem(int);
char uart_get() {
  while ((get_mem(0x3F000000 + 0x00215054) & 0x1) == 0) {
  }
  return get_mem(0x3F000000 + 0x00215040);
}


x86 assembly (clang, -O0):
<uart_get>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_get+0x9>
mov    $0x3f215054,%edi
call   1030 <get_mem@plt>
movsbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1137 <uart_get+0x27>
jmp    1119 <uart_get+0x9>
mov    $0x3f215040,%edi
call   1030 <get_mem@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_get>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3f215054,%edi
call   1030 <get_mem@plt>
test   $0x1,%al
je     1120 <uart_get+0x10>
mov    $0x3f215040,%edi
pop    %rax
jmp    1030 <get_mem@plt>

LLVM IR (-O0):
define signext i8 @uart_get() {
br label %1
1: ; preds = %6, %0
%2 = call signext i8 @get_mem(i32 1059147860)
%3 = sext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = call signext i8 @get_mem(i32 1059147840)
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @uart_get() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 @get_mem(i32 1059147860)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call signext i8 @get_mem(i32 1059147840)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void protobuf_c_out_of_memory_default(void) {
  fprintf(stderr, "Out Of Memory!!!\n");
  abort();
}


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

x86 assembly (clang, -O2):
<protobuf_c_out_of_memory_default>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Out Of Memory!!!\0A\00"
define void @protobuf_c_out_of_memory_default() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Out Of Memory!!!\0A\00"
define void @protobuf_c_out_of_memory_default() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}