xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fpeek(scalar_t__ *, int, int /*<<< orphan*/ *);
uint32_t sum_next_24_bits(FILE *file) {
  uint8_t buf[3];
  fpeek(buf, 3, file);
  return buf[0] + buf[1] + buf[2];
}


x86 assembly (clang, -O0):
<sum_next_24_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x3,%esi
call   1030 <fpeek@plt>
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_next_24_bits>:
sub    $0x18,%rsp
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <fpeek@plt>
mov    0x8(%rsp),%rax
add    (%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @sum_next_24_bits(i32* %0) {
%2 = alloca i32*
%3 = alloca [3 x i64]
store i32* %0, i32** %2
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fpeek(i64* %4, i32 3, i32* %5)
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 0
%8 = load i64, i64* %7
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 1
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
%12 = getelementptr inbounds [3 x i64], [3 x i64]* %3, i64 0, i64 2
%13 = load i64, i64* %12
%14 = add nsw i64 %11, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @sum_next_24_bits(i32* %0) {
%2 = alloca [3 x i64]
%3 = bitcast [3 x i64]* %2 to i8*
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%5 = call i32 @fpeek(i64* %4, i32 3, i32* %0)
%6 = load i64, i64* %4
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 1
%8 = load i64, i64* %7
%9 = add nsw i64 %8, %6
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 2
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf(" Signal %d reçu\n ", sig);
  while (waitpid(-1, NULL, WNOHANG) > 0) {
  }
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0x0,%rax
jle    1160 <traitement_signal+0x40>
jmp    113a <traitement_signal+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rbx
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %rax,%rax
jg     1140 <traitement_signal+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c" Signal %d re\C3\A7u\0A \00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @waitpid(i32 -1, i32* null, i32 %6)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c" Signal %d re\C3\A7u\0A \00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* @WNOHANG
%5 = tail call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
/* Variables and functions */
scalar_t__ is_story(char *);
bool is_lurking_horror(void) {
  return is_story("203-870506") || is_story("219-870912") ||
         is_story("221-870918");
}


x86 assembly (clang, -O0):
<is_lurking_horror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <is_story@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    116a <is_lurking_horror+0x5a>
lea    0xece(%rip),%rdi
call   1030 <is_story@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    116a <is_lurking_horror+0x5a>
lea    0xebb(%rip),%rdi
call   1030 <is_story@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lurking_horror>:
push   %rbx
lea    0xee8(%rip),%rdi
call   1030 <is_story@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    114c <is_lurking_horror+0x3c>
lea    0xedd(%rip),%rdi
call   1030 <is_story@plt>
test   %rax,%rax
jne    114c <is_lurking_horror+0x3c>
lea    0xed7(%rip),%rdi
call   1030 <is_story@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"203-870506\00"
@.str.1 = [11 x i8] c"219-870912\00"
@.str.2 = [11 x i8] c"221-870918\00"
define i32 @is_lurking_horror() {
%1 = call i64 @is_story(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i64 @is_story(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i64 @is_story(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ true, %3 ], [ true, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"203-870506\00"
@.str.1 = [11 x i8] c"219-870912\00"
@.str.2 = [11 x i8] c"221-870918\00"
define i32 @is_lurking_horror() {
%1 = tail call i64 @is_story(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 @is_story(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @is_story(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
char *crypt(char const *, char const *);
scalar_t__ strcmp(char *, char const *);
int checkpass_crypt(const char *pass, const char *encrypted) {
  char *cipher;
  if (!pass || !encrypted)
    return 0;
  cipher = crypt(pass, encrypted);
  return strcmp(cipher, encrypted) == 0;
}


x86 assembly (clang, -O0):
<checkpass_crypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <checkpass_crypt+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1152 <checkpass_crypt+0x32>
movl   $0x0,-0x4(%rbp)
jmp    117f <checkpass_crypt+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <crypt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkpass_crypt>:
push   %rbx
xor    %eax,%eax
test   %rdi,%rdi
je     114e <checkpass_crypt+0x2e>
mov    %rsi,%rbx
test   %rsi,%rsi
je     114e <checkpass_crypt+0x2e>
mov    %rbx,%rsi
call   1030 <crypt@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @checkpass_crypt(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i8* @crypt(i8* %0, i8* %1)
%8 = tail call i64 @strcmp(i8* %7, i8* %1)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo() { puts("Hello, I'm a shared library 55\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Hello, I'm a shared library 55\0A\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Hello, I'm a shared library 55\0A\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
void L_guiclose() {}


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

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

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

LLVM IR (-O2):
define void @L_guiclose() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_height(void *_p) {
  return (int)((XWindowAttributes *)_p)->height;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowAttributes_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowAttributes_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
unsigned long SysCtlResetFlagGet(void) {
  return ((*((volatile unsigned long *)(0x40021024))) & 0xFC000000);
}


x86 assembly (clang, -O0):
<SysCtlResetFlagGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40021024,%eax
mov    (%rax),%rax
movabs $0xfc000000,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlResetFlagGet>:
mov    0x40021024,%rax
40
and    $0xfc000000,%eax
ret

LLVM IR (-O0):
define i64 @SysCtlResetFlagGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073877028 to i64*)
%2 = and i64 %1, 4227858432
ret i64 %2
}

LLVM IR (-O2):
define i64 @SysCtlResetFlagGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073877028 to i64*)
%2 = and i64 %1, 4227858432
ret i64 %2
}
/* Variables and functions */
int write(int, char *, int);
int ADXL345_writeTo(int file, char address, char val) {
  char _buff[2];
  _buff[0] = address;
  _buff[1] = val;
  if (write(file, _buff, 2) != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ADXL345_writeTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xc(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
cmp    $0x2,%eax
je     1158 <ADXL345_writeTo+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115f <ADXL345_writeTo+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADXL345_writeTo>:
push   %rax
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ADXL345_writeTo(i32 %0, i8 signext %1, i8 signext %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %2, i8* %6
%7 = call i32 @write(i32 %0, i8* %5, i32 2)
%8 = icmp ne i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}
int to_lower(int c) { return (c >= 'A' && c <= 'Z' ? c + ('a' - 'A') : c); }


x86 assembly (clang, -O0):
<to_lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <to_lower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <to_lower+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <to_lower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @to_lower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @to_lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int diag_l3_base_send(struct diag_l3_conn *d_l3_conn __attribute__((unused)),
                      struct diag_msg *msg __attribute__((unused))) {
  return (0);
}


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

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

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

LLVM IR (-O2):
%struct.diag_l3_conn = type opaque
%struct.diag_msg = type opaque
define i32 @diag_l3_base_send(%struct.diag_l3_conn* nocapture readnone %0, %struct.diag_msg* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR7C_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR7C_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR7C_swap(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 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR7C_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(long, int);
void ptrace_event_proot(int event) { syscall((long)313, event); }


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

x86 assembly (clang, -O2):
<ptrace_event_proot>:
mov    %edi,%esi
mov    $0x139,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define void @ptrace_event_proot(i32 %0) {
%2 = tail call i32 @syscall(i64 313, i32 %0)
ret void
}
unsigned int f9(unsigned int x, unsigned int y) {
  return (x << y) | (x >> (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %ecx,%esi
mov    $0x20,%ecx
sub    %rsi,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f9(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %8, %12
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f9(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
scalar_t__ strlen(char *);
int /*<<< orphan*/ trim(char *);
int isCommentLine(char *line) {
  trim(line);
  if (line == NULL || strlen(line) == 0 || line[0] == '#') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isCommentLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <trim@plt>
cmpq   $0x0,-0x10(%rbp)
je     1163 <isCommentLine+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     1163 <isCommentLine+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    116f <isCommentLine+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <isCommentLine+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCommentLine>:
push   %rbx
mov    %rdi,%rbx
call   1030 <trim@plt>
mov    $0x1,%eax
test   %rbx,%rbx
je     1131 <isCommentLine+0x21>
mov    (%rbx),%cl
test   %cl,%cl
je     1131 <isCommentLine+0x21>
xor    %eax,%eax
cmp    $0x23,%cl
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isCommentLine(i8* %0) {
%2 = tail call i32 @trim(i8* %0)
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = icmp eq i8 %5, 35
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %1, %4
%11 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long atoll(char *);
int /*<<< orphan*/ memset(char *, char, int);
void test3(char *array) {
  memset(array, ' ', 10);
  array[9] = '-';
  array[8] = '-';
  long long r = atoll(array);
  assert(r == 0);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movb   $0x2d,0x9(%rax)
mov    -0x8(%rbp),%rax
movb   $0x2d,0x8(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
movw   $0x2d2d,0x8(%rbx)
mov    %rbx,%rdi
call   1040 <atoll@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rbx
jmp    1050 <assert@plt>

LLVM IR (-O0):
define void @test3(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i8 signext 32, i32 10)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 9
store i8 45, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 8
store i8 45, i8* %9
%10 = load i8*, i8** %2
%11 = call i64 @atoll(i8* %10)
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
define void @test3(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i8 signext 32, i32 10)
%3 = getelementptr inbounds i8, i8* %0, i64 9
store i8 45, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 8
store i8 45, i8* %4
%5 = tail call i64 @atoll(i8* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}
unsigned long zipmapXRequiredLength(unsigned int klen, unsigned int vlen) {
  unsigned int l;
  l = klen + vlen + 3 + sizeof(unsigned int);
  if (klen >= 254)
    l += 4;
  if (vlen >= 254)
    l += 4;
  return l;
}


x86 assembly (clang, -O0):
<zipmapXRequiredLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,%eax
add    $0x4,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0xfe,-0x4(%rbp)
jb     1132 <zipmapXRequiredLength+0x32>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xfe,-0x8(%rbp)
jb     1148 <zipmapXRequiredLength+0x48>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipmapXRequiredLength>:
lea    (%rsi,%rdi,1),%eax
xor    %ecx,%ecx
cmp    $0xfe,%edi
setae  %cl
lea    (%rax,%rcx,4),%eax
xor    %ecx,%ecx
cmp    $0xfe,%esi
setae  %cl
lea    (%rax,%rcx,4),%eax
add    $0x7,%eax
ret

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

LLVM IR (-O2):
define i64 @zipmapXRequiredLength(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ugt i32 %0, 253
%5 = select i1 %4, i32 11, i32 7
%6 = add i32 %3, %5
%7 = icmp ugt i32 %1, 253
%8 = add i32 %6, 4
%9 = select i1 %7, i32 %8, i32 %6
%10 = zext i32 %9 to i64
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, int *, int);
int /*<<< orphan*/ write(int, int *, int);
int usleep(unsigned long usecs) {
  int fd;
  int t;
  t = usecs / 10000;
  fd = open("/dev/timer/0", 0);
  write(fd, &t, sizeof(t));
  read(fd, &t, sizeof(t));
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
xor    %esi,%esi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <read@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
mul    %rcx
shr    $0xb,%rdx
mov    %edx,0x4(%rsp)
lea    0xe9d(%rip),%rdi
xor    %esi,%esi
call   1060 <open@plt>
mov    %eax,%ebx
lea    0x4(%rsp),%r14
mov    %eax,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1050 <read@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/timer/0\00"
define i32 @usleep(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = udiv i64 %5, 10000
%7 = trunc i64 %6 to i32
store i32 %7, i32* %4
%8 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @write(i32 %9, i32* %4, i32 4)
%11 = load i32, i32* %3
%12 = call i32 @read(i32 %11, i32* %4, i32 4)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/timer/0\00"
define i32 @usleep(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = udiv i64 %0, 10000
%5 = trunc i64 %4 to i32
store i32 %5, i32* %2
%6 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%7 = call i32 @write(i32 %6, i32* %2, i32 4)
%8 = call i32 @read(i32 %6, i32* %2, i32 4)
%9 = tail call i32 @close(i32 %6)
ret i32 0
}
__attribute__((no, noclone)) long int fn4(long int x, long int y, int *ovf) {
  long int res;
  x &= 65535;
  y = (y & 65535) - 32768;
  *ovf = __builtin_mul_overflow(x, y, &res);
  return res;
}


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
sub    $0x8000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
seto   %al
mov    %rcx,-0x20(%rbp)
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
movzwl %di,%ecx
movzwl %si,%eax
add    $0xffffffffffff8000,%rax
imul   %rcx,%rax
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i64 @fn4(i64 %0, i64 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%8 = load i64, i64* %4
%9 = and i64 %8, 65535
store i64 %9, i64* %4
%10 = load i64, i64* %5
%11 = and i64 %10, 65535
%12 = sub nsw i64 %11, 32768
store i64 %12, i64* %5
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 %13, i64 %14)
%16 = extractvalue { i64, i1 } %15, 1
%17 = extractvalue { i64, i1 } %15, 0
store i64 %17, i64* %7
%18 = zext i1 %16 to i32
%19 = load i32*, i32** %6
store i32 %18, i32* %19
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @fn4(i64 %0, i64 %1, i32* nocapture writeonly %2) {
%4 = and i64 %0, 65535
%5 = and i64 %1, 65535
%6 = add nsw i64 %5, -32768
%7 = mul nsw i64 %6, %4
store i32 0, i32* %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rpi_car_deccelerate() { printf("### RPi Car Deccelerate ###\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"### RPi Car Deccelerate ###\0A\00"
define void @rpi_car_deccelerate() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"### RPi Car Deccelerate ###\00"
define void @rpi_car_deccelerate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void handler2(int signo) {
  printf("recieve signal : %d\n", signo);
  printf("end process\n");
  exit(0);
}


x86 assembly (clang, -O0):
<handler2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler2>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"recieve signal : %d\0A\00"
@.str.1 = [13 x i8] c"end process\0A\00"
define void @handler2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"recieve signal : %d\0A\00"
@str = [12 x i8] c"end process\00"
define void @handler2(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int ithread_initialize_thread(void) {
  int ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<ithread_initialize_thread>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ithread_initialize_thread() {
ret i32 0
}
void check_scroll() { return; }


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

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

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

LLVM IR (-O2):
define void @check_scroll() {
ret void
}
void av_write_frame() {}


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

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

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

LLVM IR (-O2):
define void @av_write_frame() {
ret void
}
/* Variables and functions */
int mktemp_internal(char *, int /*<<< orphan*/, int, int);
int mkostemp(char *path, int flags) {
  return (mktemp_internal(path, 0, 1, flags));
}


x86 assembly (clang, -O0):
<mkostemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <mktemp_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkostemp>:
mov    %esi,%ecx
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <mktemp_internal@plt>

LLVM IR (-O0):
define i32 @mkostemp(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 = call i32 @mktemp_internal(i8* %5, i32 0, i32 1, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = tail call i32 @mktemp_internal(i8* %0, i32 0, i32 1, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ perror(char *);
void *xcalloc(size_t nelem, size_t sz) {
  void *out;
  out = calloc(nelem, sz);
  if (!out) {
    perror("Failed xcalloc: ");
    abort();
  }
  return out;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <xcalloc+0x3f>
lea    0xe9d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Failed xcalloc: \00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [17 x i8] c"Failed xcalloc: \00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i8* %3
}
void msvcrt_onexit(void *arg) { ; }


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

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

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

LLVM IR (-O2):
define void @msvcrt_onexit(i8* nocapture %0) {
ret void
}
/* Variables and functions */
double sla_gmst_(double *);
double slaGmst(double ut1) {
  double UT1;
  double result;
  UT1 = ut1;
  result = sla_gmst_(&UT1);
  return result;
}


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

x86 assembly (clang, -O2):
<slaGmst>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_gmst_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @slaGmst(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double %0, double* %2
%4 = call double @sla_gmst_(double* %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ F2(int **);
void test2() {
  int *X;
  F2(&X);
  *X = 1;
}


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

x86 assembly (clang, -O2):
<test2>:
push   %rax
mov    %rsp,%rdi
call   1030 <F2@plt>
mov    (%rsp),%rax
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @test2() {
%1 = alloca i32*
%2 = call i32 @F2(i32** %1)
%3 = load i32*, i32** %1
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @test2() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @F2(i32** %1)
%4 = load i32*, i32** %1
store i32 1, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ balloc();
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ read_faces(int /*<<< orphan*/ *);
int /*<<< orphan*/ read_header(int /*<<< orphan*/ *);
int /*<<< orphan*/ read_vertices(int /*<<< orphan*/ *);
int /*<<< orphan*/ *safe_fopen(char const *, char *);
void read_fst(const char *fn) {
  FILE *fd;
  fd = safe_fopen(fn, "r");
  read_header(fd);
  balloc();
  read_vertices(fd);
  read_faces(fd);
  fclose(fd);
}


x86 assembly (clang, -O0):
<read_fst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1080 <safe_fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <read_header@plt>
mov    $0x0,%al
call   1040 <balloc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <read_vertices@plt>
mov    -0x10(%rbp),%rdi
call   1030 <read_faces@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_fst>:
push   %rbx
lea    0xe98(%rip),%rsi
call   1080 <safe_fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <read_header@plt>
xor    %eax,%eax
call   1040 <balloc@plt>
mov    %rbx,%rdi
call   1060 <read_vertices@plt>
mov    %rbx,%rdi
call   1030 <read_faces@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define void @read_fst(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @safe_fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @read_header(i32* %6)
%8 = call i32 (...) @balloc()
%9 = load i32*, i32** %3
%10 = call i32 @read_vertices(i32* %9)
%11 = load i32*, i32** %3
%12 = call i32 @read_faces(i32* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define void @read_fst(i8* %0) {
%2 = tail call i32* @safe_fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @read_header(i32* %2)
%4 = tail call i32 (...) @balloc()
%5 = tail call i32 @read_vertices(i32* %2)
%6 = tail call i32 @read_faces(i32* %2)
%7 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ts_get_scrambling(const uint8_t *p_ts) { return (p_ts[3] & 0xc0) >> 6; }


x86 assembly (clang, -O0):
<ts_get_scrambling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0xc0,%eax
sar    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_get_scrambling>:
mov    0xc(%rdi),%eax
shr    $0x6,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @ts_get_scrambling(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = ashr i32 %6, 6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ts_get_scrambling(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = and i32 %4, 3
ret i32 %5
}
/* Variables and functions */
unsigned char inb(unsigned int);
int /*<<< orphan*/ outb(unsigned char, unsigned int);
unsigned char b1outp(unsigned int base, unsigned short offset,
                     unsigned char value) {
  outb(value, base + offset);
  return inb(base + 0x04);
}


x86 assembly (clang, -O0):
<b1outp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %edi,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
mov    -0x4(%rbp),%esi
movzwl -0x6(%rbp),%ecx
add    %ecx,%esi
movzbl %al,%edi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
add    $0x4,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1outp>:
push   %rbx
mov    %edi,%ebx
add    %edi,%esi
mov    %edx,%edi
call   1030 <outb@plt>
add    $0x4,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @b1outp(i32 %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i32, i32* %4
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = add i32 %8, %10
%12 = call i32 @outb(i8 zeroext %7, i32 %11)
%13 = load i32, i32* %4
%14 = add i32 %13, 4
%15 = call zeroext i8 @inb(i32 %14)
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @b1outp(i32 %0, i16 zeroext %1, i8 zeroext %2) {
%4 = zext i16 %1 to i32
%5 = add i32 %4, %0
%6 = tail call i32 @outb(i8 zeroext %2, i32 %5)
%7 = add i32 %0, 4
%8 = tail call zeroext i8 @inb(i32 %7)
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage: eg decode [-r <infile>]\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"usage: eg decode [-r <infile>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"usage: eg decode [-r <infile>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ info(char *);
void MG_quitter(void) {
  info("Bye!\n\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<MG_quitter>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <info@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<MG_quitter>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <info@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Bye!\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define void @MG_quitter() {
%1 = call i32 @info(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"Bye!\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define void @MG_quitter() {
%1 = tail call i32 @info(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.usb_hcd = type opaque
define i32 @xhci_cdns3_suspend_quirk(%struct.usb_hcd* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *memptystr();
char *mprintf(char *, unsigned int);
char *buildstr(unsigned int b) {
  if (b > 99)
    return NULL;
  if (b == 99)
    return memptystr();
  return mprintf("%02d", b);
}


x86 assembly (clang, -O0):
<buildstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x63,-0xc(%rbp)
jbe    1142 <buildstr+0x22>
movq   $0x0,-0x8(%rbp)
jmp    116f <buildstr+0x4f>
cmpl   $0x63,-0xc(%rbp)
jne    115c <buildstr+0x3c>
mov    $0x0,%al
call   1040 <memptystr@plt>
mov    %rax,-0x8(%rbp)
jmp    116f <buildstr+0x4f>
mov    -0xc(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <mprintf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildstr>:
cmp    $0x63,%edi
jbe    1128 <buildstr+0x8>
xor    %eax,%eax
ret
jne    1131 <buildstr+0x11>
xor    %eax,%eax
jmp    1040 <memptystr@plt>
mov    %edi,%esi
lea    0xec6(%rip),%rdi
jmp    1030 <mprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%02d\00"
define i8* @buildstr(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ugt i32 %4, 99
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 99
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i8* (...) @memptystr()
store i8* %11, i8** %2
br label %15
12: ; preds = %7
%13 = load i32, i32* %3
%14 = call i8* @mprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %10, %6
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02d\00"
define i8* @buildstr(i32 %0) {
%2 = icmp ugt i32 %0, 99
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 99
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* (...) @memptystr()
br label %9
7: ; preds = %3
%8 = tail call i8* @mprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %1, %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ], [ null, %1 ]
ret i8* %10
}