xunge/DecIR huggingface dataset:
const char *ZSTD_versionString(void) { return "1.4.5"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.4.5\00"
define i8* @ZSTD_versionString() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.4.5\00"
define i8* @ZSTD_versionString() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq(int, unsigned char *, long long);
void vt100_CUB(int n) { vt100_EscSeq(n, (unsigned char *)"D", (long long)2); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x2,%edx
call   1030 <vt100_EscSeq@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"D\00"
define void @vt100_CUB(i32 %0) {
%2 = tail call i32 @vt100_EscSeq(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mark(int, int);
int /*<<< orphan*/ printf(char *, ...);
void handler(int sig) {
  printf("User signal handler: got signal %d\n", sig);
  mark(sig, 2);
  printf("Leaving user signal handler\n");
}


x86 assembly (clang, -O0):
<handler>:
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>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1040 <mark@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1050 <mark@plt>
lea    0xece(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"User signal handler: got signal %d\0A\00"
@.str.1 = [29 x i8] c"Leaving user signal handler\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @mark(i32 %5, i32 2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"User signal handler: got signal %d\0A\00"
@str = [28 x i8] c"Leaving user signal handler\00"
define void @handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @mark(i32 %0, i32 2)
%4 = 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 */
double fabs(double);
double distCityBlock(double a, double b) { return fabs(a - b); }


x86 assembly (clang, -O0):
<distCityBlock>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distCityBlock>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @distCityBlock(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
ret double %8
}

LLVM IR (-O2):
define double @distCityBlock(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
ret double %4
}
/* Variables and functions */
scalar_t__ isspace(char);
int strlen(char *);
void rstrip(char *s) {
  int i;
  i = strlen(s);
  while (--i > 0 && isspace(s[i])) {
    s[i] = 0;
  }
}


x86 assembly (clang, -O0):
<rstrip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jle    116a <rstrip+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    117a <rstrip+0x5a>
jmp    118b <rstrip+0x6b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1138 <rstrip+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rstrip>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1162 <rstrip+0x42>
mov    %eax,%ebx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%r15d
movsbl (%r14,%r15,1),%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     1162 <rstrip+0x42>
movb   $0x0,(%r14,%r15,1)
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1140 <rstrip+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @rstrip(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %14
%7 = phi i64 [ %5, %4 ], [ %8, %14 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %6
store i8 0, i8* %10
%15 = icmp ugt i64 %7, 2
br i1 %15, label %6, label %16
16: ; preds = %6, %14, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int pgdn_handler(char **save) {
  write_instr(0x00);
  write_imm(0x4E);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<pgdn_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4e,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgdn_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x4e,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pgdn_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 78)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @pgdn_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 78)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_hashmap_first() {
  printf("NOT IMPLEMENTED:"
         "pa_hashmap_first"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_hashmap_first\00"
define i32 @pa_hashmap_first() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PF_INET6;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct sockaddr_in6 sin6;
  if (socket(PF_INET6, SOCK_STREAM, 0) != -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
cmp    $0xffffffff,%eax
je     1154 <main+0x44>
movl   $0x0,-0x4(%rbp)
jmp    115b <main+0x4b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
@PF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sockaddr_in6
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @PF_INET6
%8 = load i32, i32* @SOCK_STREAM
%9 = call i32 @socket(i32 %7, i32 %8, i32 0)
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %13
12: ; preds = %2
store i32 1, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@PF_INET6 = global i32 0
@SOCK_STREAM = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @PF_INET6
%4 = load i32, i32* @SOCK_STREAM
%5 = tail call i32 @socket(i32 %3, i32 %4, i32 0)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}
int main() {
  int vbnm[] = {1, 2, 3};
  int *ptr = vbnm;
  return ptr[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.vbnm = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
int bitInvertOrInvertwith(int sourceWord, int destinationWord) {
  return (~sourceWord) | (~destinationWord);
}


x86 assembly (clang, -O0):
<bitInvertOrInvertwith>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitInvertOrInvertwith>:
mov    %edi,%eax
and    %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @bitInvertOrInvertwith(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bitInvertOrInvertwith(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
void *i(size_t);
void *p(size_t n) { return i(n); }


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

x86 assembly (clang, -O2):
<p>:
jmp    1030 <i@plt>

LLVM IR (-O0):
define i8* @p(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @i(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @p(i64 %0) {
%2 = tail call i8* @i(i64 %0)
ret i8* %2
}
int prev_number(int n) { return n == 0 ? 2 : n - 1; }


x86 assembly (clang, -O0):
<prev_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111e <prev_number+0x1e>
mov    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <prev_number+0x27>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prev_number>:
sub    $0x1,%edi
mov    $0x2,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @prev_number(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 2, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @prev_number(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = select i1 %2, i32 2, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strncasecmp(char *, char *, int);
int is4map6addr(char *s) { return !strncasecmp(s, "::ffff:", 7); }


x86 assembly (clang, -O0):
<is4map6addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is4map6addr>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"::ffff:\00"
define i32 @is4map6addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncasecmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"::ffff:\00"
define i32 @is4map6addr(i8* nocapture %0) {
%2 = tail call i32 @strncasecmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *const);
int /*<<< orphan*/ pm_error(char *);
void abortWithReadError(FILE *const ifP) {
  if (feof(ifP))
    pm_error("Unexpected end of input file");
  else
    pm_error("Error (not EOF) reading file.");
}


x86 assembly (clang, -O0):
<abortWithReadError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     1150 <abortWithReadError+0x30>
lea    0xeba(%rip),%rdi
call   1040 <pm_error@plt>
jmp    115c <abortWithReadError+0x3c>
lea    0xec6(%rip),%rdi
call   1040 <pm_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abortWithReadError>:
push   %rax
call   1030 <feof@plt>
test   %rax,%rax
lea    0xeed(%rip),%rax
lea    0xec9(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1040 <pm_error@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Unexpected end of input file\00"
@.str.1 = [30 x i8] c"Error (not EOF) reading file.\00"
define void @abortWithReadError(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @feof(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @pm_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @pm_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Unexpected end of input file\00"
@.str.1 = [30 x i8] c"Error (not EOF) reading file.\00"
define void @abortWithReadError(i32* nocapture %0) {
%2 = tail call i64 @feof(i32* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @pm_error(i8* %4)
ret void
}
int toupper(int c) { return (c >= 'a' && c <= 'z') ? (c - 0x20) : c; }


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

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

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub 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 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int Headers();
int video_sequence(int *);
signed int Decode_Bitstream(void) {
  signed int ret;
  signed int Bitstream_Framenum = 0;
  do {
    ret = Headers();
    if (ret == 1)
      ret = video_sequence(&Bitstream_Framenum);
    else
      return ret;
  } while ((_Bool)1);
}


x86 assembly (clang, -O0):
<Decode_Bitstream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <Headers@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1154 <Decode_Bitstream+0x34>
lea    -0xc(%rbp),%rdi
call   1030 <video_sequence@plt>
mov    %eax,-0x8(%rbp)
jmp    115f <Decode_Bitstream+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <Decode_Bitstream+0x53>
jmp    1164 <Decode_Bitstream+0x44>
mov    $0x1,%al
test   $0x1,%al
jne    112f <Decode_Bitstream+0xf>
jmp    1173 <Decode_Bitstream+0x53>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decode_Bitstream>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
call   1040 <Headers@plt>
cmp    $0x1,%eax
jne    1154 <Decode_Bitstream+0x34>
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <video_sequence@plt>
xor    %eax,%eax
call   1040 <Headers@plt>
cmp    $0x1,%eax
je     1140 <Decode_Bitstream+0x20>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Decode_Bitstream() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 (...) @Headers()
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @video_sequence(i32* %1)
%7 = call i32 (...) @Headers()
%8 = icmp eq i32 %7, 1
br i1 %8, label %5, label %9
9: ; preds = %5, %0
%10 = phi i32 [ %3, %0 ], [ %7, %5 ]
ret i32 %10
}
/* Variables and functions */
int __map2check_main__();
int main() { return __map2check_main__(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__map2check_main__()
ret i32 %1
}
/* Variables and functions */
float fabs(float);
float chaine_rayon_min(float l1, float l2) { return fabs(l1 - l2); }


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

x86 assembly (clang, -O2):
<chaine_rayon_min>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @chaine_rayon_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call float @fabs(float %7)
ret float %8
}

LLVM IR (-O2):
define float @chaine_rayon_min(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
ret float %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ partab_init();
int parityb(unsigned char x) {
  extern uint8_t partab[256];
  extern bool p_init;
  if (!p_init)
    partab_init();
  return partab[x];
}


x86 assembly (clang, -O0):
<parityb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2ec3(%rip),%rax
cmpl   $0x0,(%rax)
jne    1135 <parityb+0x25>
mov    $0x0,%al
call   1030 <partab_init@plt>
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    0x2e96(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parityb>:
push   %rbx
mov    %edi,%ebx
mov    0x2ece(%rip),%rax
cmpl   $0x0,(%rax)
jne    1126 <parityb+0x16>
xor    %eax,%eax
call   1030 <partab_init@plt>
movzbl %bl,%eax
mov    0x2ea8(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
@p_init = external global i32
@partab = external global [256 x i32]
define i32 @parityb(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @p_init
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @partab_init()
br label %7
7: ; preds = %5, %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i64
%10 = getelementptr inbounds [256 x i32], [256 x i32]* @partab, i64 0, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
@p_init = external global i32
@partab = external global [256 x i32]
define i32 @parityb(i8 zeroext %0) {
%2 = load i32, i32* @p_init
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @partab_init()
br label %6
6: ; preds = %4, %1
%7 = zext i8 %0 to i64
%8 = getelementptr inbounds [256 x i32], [256 x i32]* @partab, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  struct base {
    int basic;
  };
  struct derived {
    struct base common;
    char extra;
  };
  struct base *bp;
  bp = (struct base *)malloc(sizeof(struct base));
  ;
  bp->basic = 10;
  ((struct derived *)bp)->extra = 'x';
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0xa,(%rax)
movb   $0x78,0x4(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.base = type { i32 }
%struct.derived = type { %struct.base, i8 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.base*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to %struct.base*
store %struct.base* %4, %struct.base** %2
%5 = load %struct.base*, %struct.base** %2
%6 = getelementptr inbounds %struct.base, %struct.base* %5, i32 0, i32 0
store i32 10, i32* %6
%7 = load %struct.base*, %struct.base** %2
%8 = bitcast %struct.base* %7 to %struct.derived*
%9 = getelementptr inbounds %struct.derived, %struct.derived* %8, i32 0, i32 1
store i8 120, i8* %9
ret i32 0
}

LLVM IR (-O2):
%struct.base = type { i32 }
%struct.derived = type { %struct.base, i8 }
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to %struct.base*
%3 = getelementptr inbounds %struct.base, %struct.base* %2, i64 0, i32 0
store i32 10, i32* %3
%4 = inttoptr i64 %1 to %struct.derived*
%5 = getelementptr inbounds %struct.derived, %struct.derived* %4, i64 0, i32 1
store i8 120, i8* %5
ret i32 0
}
int clamp(int amount, int low, int high) {
  return amount < low ? low : (amount > high ? high : amount);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ malloc(size_t);
long *lvector(long nl, long nh) {
  long *v = (long *)malloc((size_t)((nh - nl + 2) * sizeof(long)));
  if (v == NULL)
    error("allocation failure in lvector()");
  return (v - nl + 1);
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x2,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <lvector+0x40>
lea    0xea5(%rip),%rdi
call   1040 <error@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <error@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 2
%10 = mul i64 %9, 8
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i64*
store i64* %12, i64** %5
%13 = load i64*, i64** %5
%14 = icmp eq i64* %13, null
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i64*, i64** %5
%19 = load i64, i64* %3
%20 = sub i64 0, %19
%21 = getelementptr inbounds i64, i64* %18, i64 %20
%22 = getelementptr inbounds i64, i64* %21, i64 1
ret i64* %22
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = getelementptr inbounds i64, i64* %13, i64 1
ret i64* %14
}
void ft_strclr(char *s) {
  if (!s)
    return;
  if (*s) {
    *s = '\0';
    ft_strclr(s + 1);
  }
  return;
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_strclr+0x1c>
jmp    1152 <ft_strclr+0x42>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <ft_strclr+0x3d>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <ft_strclr@plt>
jmp    1152 <ft_strclr+0x42>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
store i8 0, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
int security_msg_msg_alloc(struct msg_msg *msg) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.msg_msg = type opaque
define i32 @security_msg_msg_alloc(%struct.msg_msg* nocapture readnone %0) {
ret i32 0
}
double f_2(double a, double b, double c, double d) {
  if (a > b)
    return c;
  else
    return d;
}


x86 assembly (clang, -O0):
<f_2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1137 <f_2+0x37>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1141 <f_2+0x41>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_2>:
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm3,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f_2(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %6
%11 = load double, double* %7
%12 = fcmp ogt double %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load double, double* %8
store double %14, double* %5
br label %17
15: ; preds = %4
%16 = load double, double* %9
store double %16, double* %5
br label %17
17: ; preds = %15, %13
%18 = load double, double* %5
ret double %18
}

LLVM IR (-O2):
define double @f_2(double %0, double %1, double %2, double %3) {
%5 = fcmp ogt double %0, %1
%6 = select i1 %5, double %2, double %3
ret double %6
}
int write_UInt32Number(unsigned int d, char *p) {
  ((unsigned char *)p)[0] = (unsigned char)(d >> 24);
  ((unsigned char *)p)[1] = (unsigned char)(d >> 16);
  ((unsigned char *)p)[2] = (unsigned char)(d >> 8);
  ((unsigned char *)p)[3] = (unsigned char)(d);
  return 0;
}


x86 assembly (clang, -O0):
<write_UInt32Number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_UInt32Number>:
bswap  %edi
mov    %edi,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @write_UInt32Number(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i32, i32* %3
%16 = lshr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i32, i32* %3
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret i32 0
}

LLVM IR (-O2):
define i32 @write_UInt32Number(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret i32 0
}
signed int cylinder_bbox(void *obj, struct anon$0 *min, struct anon$0 *max) {
  return 0;
}


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

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

LLVM IR (-O0):
%"struct.anon$0" = type opaque
define i32 @cylinder_bbox(i8* %0, %"struct.anon$0"* %1, %"struct.anon$0"* %2) {
%4 = alloca i8*
%5 = alloca %"struct.anon$0"*
%6 = alloca %"struct.anon$0"*
store i8* %0, i8** %4
store %"struct.anon$0"* %1, %"struct.anon$0"** %5
store %"struct.anon$0"* %2, %"struct.anon$0"** %6
ret i32 0
}

LLVM IR (-O2):
%"struct.anon$0" = type opaque
define i32 @cylinder_bbox(i8* nocapture readnone %0, %"struct.anon$0"* nocapture readnone %1, %"struct.anon$0"* nocapture readnone %2) {
ret i32 0
}
char *strchr(const char *string, int c) {
  for (const char *s = string; *s; s++)
    if (*s == c)
      return (char *)s;
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <strchr+0x53>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113d <strchr+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <strchr+0x5b>
jmp    1142 <strchr+0x42>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %5, %2
%15 = phi i8* [ null, %2 ], [ %7, %5 ], [ null, %10 ]
ret i8* %15
}
int add360(int x, int toRotate) {
  x += toRotate;
  while (x > 360)
    x -= 360;
  while (x < 0)
    x = 360 + x;
  return x;
}


x86 assembly (clang, -O0):
<add360>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x168,-0x4(%rbp)
jle    1130 <add360+0x30>
mov    -0x4(%rbp),%eax
sub    $0x168,%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <add360+0x13>
jmp    1135 <add360+0x35>
cmpl   $0x0,-0x4(%rbp)
jge    114f <add360+0x4f>
mov    -0x4(%rbp),%eax
add    $0x168,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <add360+0x35>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add360>:
lea    (%rdi,%rsi,1),%ecx
cmp    $0x168,%ecx
mov    $0x168,%eax
cmovl  %ecx,%eax
mov    %ecx,%edx
sub    %eax,%edx
add    $0x167,%edx
shr    $0x3,%edx
imul   $0x16c16c17,%rdx,%rax
shr    $0x22,%rax
imul   $0x168,%eax,%edx
mov    %ecx,%eax
sub    %edx,%eax
xor    %esi,%esi
test   %eax,%eax
cmovg  %eax,%esi
mov    %eax,%edi
shr    $0x1f,%edi
add    %edi,%eax
sub    %eax,%esi
shr    $0x3,%esi
imul   $0x16c16c17,%rsi,%rax
shr    $0x22,%rax
add    %edi,%eax
imul   $0x168,%eax,%eax
add    %ecx,%eax
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @add360(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = add i32 %3, 359
%5 = call i32 @llvm.smin.i32(i32 %3, i32 360)
%6 = sub i32 %4, %5
%7 = urem i32 %6, 360
%8 = sub i32 %6, %7
%9 = sub i32 %3, %8
%10 = call i32 @llvm.smax.i32(i32 %9, i32 0)
%11 = lshr i32 %9, 31
%12 = add i32 %11, %9
%13 = sub i32 %10, %12
%14 = udiv i32 %13, 360
%15 = add nuw nsw i32 %11, %14
%16 = mul i32 %15, 360
%17 = add i32 %3, %16
%18 = sub i32 %17, %8
ret i32 %18
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
int yaffs_unmount2_reldev(struct yaffs_dev *, int /*<<< orphan*/);
int yaffs_unmount_reldev(struct yaffs_dev *dev) {
  return yaffs_unmount2_reldev(dev, 0);
}


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

x86 assembly (clang, -O2):
<yaffs_unmount_reldev>:
xor    %esi,%esi
jmp    1030 <yaffs_unmount2_reldev@plt>

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_unmount_reldev(%struct.yaffs_dev* %0) {
%2 = alloca %struct.yaffs_dev*
store %struct.yaffs_dev* %0, %struct.yaffs_dev** %2
%3 = load %struct.yaffs_dev*, %struct.yaffs_dev** %2
%4 = call i32 @yaffs_unmount2_reldev(%struct.yaffs_dev* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_unmount_reldev(%struct.yaffs_dev* %0) {
%2 = tail call i32 @yaffs_unmount2_reldev(%struct.yaffs_dev* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int syscall(int, unsigned long);
int personality(unsigned long persona) { return syscall(136, persona); }


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

x86 assembly (clang, -O2):
<personality>:
mov    %rdi,%rsi
mov    $0x88,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @personality(i64 %0) {
%2 = tail call i32 @syscall(i32 136, i64 %0)
ret i32 %2
}
unsigned int vpx_mem_get_version() {
  unsigned int ver =
      ((unsigned int)(unsigned char)2 << 24 |
       (unsigned int)(unsigned char)2 << 16 |
       (unsigned int)(unsigned char)1 << 8 | (unsigned int)(unsigned char)5);
  return ver;
}


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

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

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

LLVM IR (-O2):
define i32 @vpx_mem_get_version() {
ret i32 33685765
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int soma_digitos(int);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d\n", soma_digitos(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <soma_digitos@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <soma_digitos@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @soma_digitos(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
int main() {
  execl("/bin/ps", "ps", "-ef", NULL);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ps\00"
@.str.1 = [3 x i8] c"ps\00"
@.str.2 = [4 x i8] c"-ef\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ps\00"
@.str.1 = [3 x i8] c"ps\00"
@.str.2 = [4 x i8] c"-ef\00"
define i32 @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sa_family_t;

/* Variables and functions */
int if_setsockopt_mcast_all(sa_family_t family, int *sd) { return -1; }


x86 assembly (clang, -O0):
<if_setsockopt_mcast_all>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @if_setsockopt_mcast_all(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @if_setsockopt_mcast_all(i32 %0, i32* nocapture readnone %1) {
ret i32 -1
}