xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void phex(int v) {
  int t = v / 16;
  if (t != 0)
    phex(t);
  printf("%c", "0123456789ABCDEF"[v % 16]);
}


x86 assembly (clang, -O0):
<phex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114b <phex+0x2b>
mov    -0x8(%rbp),%edi
call   1040 <phex@plt>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0xea0(%rip),%rdi
lea    0xe9c(%rip),%rax
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phex>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xf(%rbx),%ebp
cmp    $0x1f,%ebp
jb     113c <phex+0x1c>
test   %ebx,%ebx
mov    %ebx,%edi
cmovs  %ebp,%edi
sar    $0x4,%edi
call   1040 <phex@plt>
test   %ebx,%ebx
cmovns %ebx,%ebp
and    $0xfffffff0,%ebp
sub    %ebp,%ebx
movslq %ebx,%rax
lea    0xeb3(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xea5(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [17 x i8] c"0123456789ABCDEF\00"
define void @phex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 16
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
%12 = srem i32 %11, 16
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [17 x i8], [17 x i8]* @.str.1, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %15)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [17 x i8] c"0123456789ABCDEF\00"
define void @phex(i32 %0) {
%2 = add i32 %0, 15
%3 = icmp ult i32 %2, 31
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = sdiv i32 %0, 16
tail call void @phex(i32 %5)
br label %6
6: ; preds = %4, %1
%7 = srem i32 %0, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [17 x i8], [17 x i8]* @.str.1, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpgt_sd(__m128d __a, __m128d __b) {
  return _mm_cmpgt_sd(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpgt_sd>:
jmp    1030 <_mm_cmpgt_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpgt_sd(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 = call i32 @_mm_cmpgt_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpgt_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_sd(i32 %0, i32 %1)
ret i32 %3
}
int swallow_redpill() {
  unsigned char m[2 + 4], rpill[] = "\x0f\x01\x0d\x00\x00\x00\x00\xc3";
  *((unsigned *)&rpill[3]) = (unsigned long int)m;
  ((void (*)()) & rpill)();
  return (m[5] > 0xd0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<swallow_redpill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xef1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xeef(%rip),%al
mov    %al,-0x7(%rbp)
lea    -0x6(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xf(%rbp),%rcx
mov    $0x0,%al
call   *%rcx
movzbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xd0,%edx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swallow_redpill>:
sub    $0x18,%rsp
lea    0xf(%rsp),%rcx
xor    %eax,%eax
call   *%rcx
xor    %eax,%eax
cmpb   $0xd1,0xe(%rsp)
setae  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.swallow_redpill.rpill = [9 x i8] c"\0F\01\0D\00\00\00\00\C3\00"
define i32 @swallow_redpill() {
%1 = alloca [6 x i8]
%2 = alloca [9 x i8]
%3 = bitcast [9 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 3
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = bitcast [9 x i8]* %2 to void (...)*
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 5
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp sgt i32 %12, 208
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @swallow_redpill() {
%1 = alloca [6 x i8]
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = bitcast [9 x i8]* %2 to void (...)*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 5
%7 = load i8, i8* %6
%8 = icmp ugt i8 %7, -48
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void WatchdogUnlock(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000C00))) = 0x1ACCE551;
}


x86 assembly (clang, -O0):
<WatchdogUnlock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc00,%eax
cltq
movl   $0x1acce551,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogUnlock>:
movslq %edi,%rax
movl   $0x1acce551,0xc00(%rax)
e5 cc 1a
ret

LLVM IR (-O0):
define void @WatchdogUnlock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3072
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 449635665, i32* %6
ret void
}

LLVM IR (-O2):
define void @WatchdogUnlock(i32 %0) {
%2 = add nsw i32 %0, 3072
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 449635665, i32* %4
ret void
}
void ft_strclr(char *s) {
  int i;
  i = 0;
  if (s) {
    while (s[i])
      s[i++] = '\0';
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <ft_strclr+0x51>
jmp    111f <ft_strclr+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114c <ft_strclr+0x4c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    111f <ft_strclr+0x1f>
jmp    1151 <ft_strclr+0x51>
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*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %21
6: ; preds = %1
br label %7
7: ; preds = %14, %6
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %7
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
br label %7
20: ; preds = %7
br label %21
21: ; preds = %20, %1
ret void
}

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = add nuw nsw i64 %7, 1
store i8 0, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
int abs_int(int i) {
  if (i < 0) {
    return -i;
  } else
    return +i;
}


x86 assembly (clang, -O0):
<abs_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs_int+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs_int+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_int>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs_int(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void closelog(void) { ; }


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

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

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

LLVM IR (-O2):
define void @closelog() {
ret void
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
int paramcmp(const char *value, const char *x) {
  size_t len = strlen(value);
  if ((strncmp(value, x, len) == 0) && (*(x + len) == '='))
    return (int)(len + 1);
  return 0;
}


x86 assembly (clang, -O0):
<paramcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    117d <paramcmp+0x5d>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    117d <paramcmp+0x5d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x4(%rbp)
jmp    1184 <paramcmp+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paramcmp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1159 <paramcmp+0x39>
cmpb   $0x3d,(%r14,%r15,1)
jne    1159 <paramcmp+0x39>
add    $0x1,%r15d
mov    %r15d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @paramcmp(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %1, i64 %3
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 61
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = trunc i64 %3 to i32
%12 = add i32 %11, 1
br label %13
13: ; preds = %2, %6, %10
%14 = phi i32 [ %12, %10 ], [ 0, %6 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("sizeof(int *) is %zu\n", sizeof(int *));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"sizeof(int *) is %zu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"sizeof(int *) is %zu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
void print_usage_err(char *prog_name, char *err_msg) {
  fprintf(stderr, "%s: %s\n", prog_name, err_msg);
  printf("Try '%s -h' for more information.\n", prog_name);
}


x86 assembly (clang, -O0):
<print_usage_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage_err>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [35 x i8] c"Try '%s -h' for more information.\0A\00"
define void @print_usage_err(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [35 x i8] c"Try '%s -h' for more information.\0A\00"
define void @print_usage_err(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void put_2_be(unsigned char *ptr, unsigned int data) {
  ptr[1] = data & 0xff;
  ptr[0] = (data >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<put_2_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @put_2_be(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int main(void) {
  initscr();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initscr()
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int safe_strcmp(const char *a, const char *b) {
  if (a == NULL)
    return b != NULL;
  if (b == NULL)
    return 1;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<safe_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <safe_strcmp+0x30>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <safe_strcmp+0x57>
cmpq   $0x0,-0x18(%rbp)
jne    1157 <safe_strcmp+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1167 <safe_strcmp+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strcmp>:
test   %rdi,%rdi
je     111f <safe_strcmp+0xf>
test   %rsi,%rsi
je     1128 <safe_strcmp+0x18>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
test   %rsi,%rsi
setne  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @safe_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp ne i8* %1, null
%6 = zext i1 %5 to i32
br label %11
7: ; preds = %2
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %11
11: ; preds = %7, %9, %4
%12 = phi i32 [ %6, %4 ], [ %10, %9 ], [ 1, %7 ]
ret i32 %12
}
int anx7418_debugfs_init(struct anx7418 *anx) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.anx7418 = type opaque
define i32 @anx7418_debugfs_init(%struct.anx7418* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int anetGenericAccept(char *, int, struct sockaddr *, int *);
int anetUnixAccept(char *err, int s) {
  int fd;
  struct sockaddr_un sa;
  socklen_t salen = sizeof(sa);
  if ((fd = anetGenericAccept(err, s, (struct sockaddr *)&sa, &salen)) == -1)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<anetUnixAccept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <anetGenericAccept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1152 <anetUnixAccept+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <anetUnixAccept+0x48>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetUnixAccept>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <anetGenericAccept@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @anetUnixAccept(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.sockaddr_un
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 4, i32* %8
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = bitcast %struct.sockaddr_un* %7 to %struct.sockaddr*
%12 = call i32 @anetGenericAccept(i8* %9, i32 %10, %struct.sockaddr* %11, i32* %8)
store i32 %12, i32* %6
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @anetUnixAccept(i8* %0, i32 %1) {
%3 = alloca %struct.sockaddr_un
%4 = alloca i32
%5 = bitcast %struct.sockaddr_un* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%7 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%8 = call i32 @anetGenericAccept(i8* %0, i32 %1, %struct.sockaddr* %7, i32* %4)
ret i32 %8
}
void reverseBytes(char *bytes, long length) {
  long halfLen = (length >> 1);
  char *end = bytes + length;
  char c;
  while (--halfLen >= 0) {
    c = *bytes;
    *bytes++ = *--end;
    *end = c;
  }
}


x86 assembly (clang, -O0):
<reverseBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jl     1174 <reverseBytes+0x74>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
mov    -0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
jmp    1124 <reverseBytes+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBytes>:
cmp    $0x2,%rsi
jl     113c <reverseBytes+0x3c>
lea    (%rsi,%rdi,1),%rax
add    $0xffffffffffffffff,%rax
shr    %rsi
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
movzbl (%rax),%edx
mov    %dl,(%rdi)
add    $0x1,%rdi
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
ja     1120 <reverseBytes+0x20>
ret

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

LLVM IR (-O2):
define void @reverseBytes(i8* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %0, i64 %1
%6 = lshr i64 %1, 1
br label %7
7: ; preds = %4, %7
%8 = phi i8* [ %15, %7 ], [ %0, %4 ]
%9 = phi i8* [ %13, %7 ], [ %5, %4 ]
%10 = phi i64 [ %11, %7 ], [ %6, %4 ]
%11 = add nsw i64 %10, -1
%12 = load i8, i8* %8
%13 = getelementptr inbounds i8, i8* %9, i64 -1
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %14, i8* %8
store i8 %12, i8* %13
%16 = icmp ugt i64 %10, 1
br i1 %16, label %7, label %17
17: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sigfft_setup();
int /*<<< orphan*/ sigframp_setup();
int /*<<< orphan*/ sigrfft_setup();
int /*<<< orphan*/ sigrifft_setup();
void d_fft_setup(void) {
  sigfft_setup();
  sigrfft_setup();
  sigrifft_setup();
  sigframp_setup();
}


x86 assembly (clang, -O0):
<d_fft_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sigfft_setup@plt>
mov    $0x0,%al
call   1060 <sigrfft_setup@plt>
mov    $0x0,%al
call   1050 <sigrifft_setup@plt>
mov    $0x0,%al
call   1030 <sigframp_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fft_setup>:
push   %rax
xor    %eax,%eax
call   1040 <sigfft_setup@plt>
xor    %eax,%eax
call   1060 <sigrfft_setup@plt>
xor    %eax,%eax
call   1050 <sigrifft_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <sigframp_setup@plt>

LLVM IR (-O0):
define void @d_fft_setup() {
%1 = call i32 (...) @sigfft_setup()
%2 = call i32 (...) @sigrfft_setup()
%3 = call i32 (...) @sigrifft_setup()
%4 = call i32 (...) @sigframp_setup()
ret void
}

LLVM IR (-O2):
define void @d_fft_setup() {
%1 = tail call i32 (...) @sigfft_setup()
%2 = tail call i32 (...) @sigrfft_setup()
%3 = tail call i32 (...) @sigrifft_setup()
%4 = tail call i32 (...) @sigframp_setup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ goto_node(char *);
int /*<<< orphan*/ start_loop();
void HelpGotoIndex() {
  goto_node("OMEXCH");
  start_loop();
}


x86 assembly (clang, -O0):
<HelpGotoIndex>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <goto_node@plt>
mov    $0x0,%al
call   1030 <start_loop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HelpGotoIndex>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <goto_node@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <start_loop@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"OMEXCH\00"
define void @HelpGotoIndex() {
%1 = call i32 @goto_node(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @start_loop()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"OMEXCH\00"
define void @HelpGotoIndex() {
%1 = tail call i32 @goto_node(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @start_loop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int);
void wait_nframe(int n) {
  double msec = (double)n * (1.0 / 60) * 1000;
  printf("wait_nframe:%lf (%d frame)\n", msec, n);
}


x86 assembly (clang, -O0):
<wait_nframe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_nframe>:
mov    %edi,%esi
cvtsi2sd %edi,%xmm0
mulsd  0xee2(%rip),%xmm0
mulsd  0xee2(%rip),%xmm0
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"wait_nframe:%lf (%d frame)\0A\00"
define void @wait_nframe(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 0x3F91111111111111
%7 = fmul double %6, 1.000000e+03
store double %7, double* %3
%8 = load double, double* %3
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"wait_nframe:%lf (%d frame)\0A\00"
define void @wait_nframe(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3F91111111111111
%4 = fmul double %3, 1.000000e+03
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %4, i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ getpid();
long GetProcessId() { return (long)getpid(); }


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

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

LLVM IR (-O0):
define i64 @GetProcessId() {
%1 = call i64 (...) @getpid()
ret i64 %1
}

LLVM IR (-O2):
define i64 @GetProcessId() {
%1 = tail call i64 (...) @getpid()
ret i64 %1
}
/* Variables and functions */
char _irc_tolower(char);
char *irc_strlwr(char *str) {
  char *c;
  c = str;
  while (*c) {
    *c = _irc_tolower(*c);
    c++;
  }
  return str;
}


x86 assembly (clang, -O0):
<irc_strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <irc_strlwr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <_irc_tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <irc_strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <irc_strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <_irc_tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <irc_strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @irc_strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @_irc_tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ prtime();
main() { prtime(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <prtime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @prtime()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prtime()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int /*<<< orphan*/ fatal(char *, ...);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr;
  if (!size)
    fatal("xmalloc: zero size");
  ptr = malloc(size);
  if (!ptr)
    fatal("xmalloc: out of memory (allocating %lu bytes)", (u_long)size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <xmalloc+0x25>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <xmalloc+0x51>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
jne    113a <xmalloc+0x1a>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %r14,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115b <xmalloc+0x3b>
lea    0xec2(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"xmalloc: zero size\00"
@.str.1 = [46 x i8] c"xmalloc: out of memory (allocating %lu bytes)\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = load i64, i64* %2
%15 = trunc i64 %14 to i32
%16 = call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %8
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [19 x i8] c"xmalloc: zero size\00"
@.str.1 = [46 x i8] c"xmalloc: out of memory (allocating %lu bytes)\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = trunc i64 %0 to i32
%10 = tail call i32 (i8*, ...) @fatal(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %5
ret i8* %6
}
float test_00(float q[4], float m[9]) {
  float s0 = m[0] + m[1];
  float s1 = m[0] - m[1];
  return q[s0 > s1 ? 0 : 1];
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mov    $0x1,%ecx
xor    %edx,%edx
ucomiss %xmm1,%xmm0
cmova  %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
subss  %xmm1,%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm2
setbe  %al
movss  (%rdi,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @test_00(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = fadd float %9, %12
store float %13, float* %5
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fsub float %16, %19
store float %20, float* %6
%21 = load float*, float** %3
%22 = load float, float* %5
%23 = load float, float* %6
%24 = fcmp ogt float %22, %23
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 0, i32 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds float, float* %21, i64 %27
%29 = load float, float* %28
ret float %29
}

LLVM IR (-O2):
define float @test_00(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = fadd float %3, %5
%7 = fsub float %3, %5
%8 = fcmp ule float %6, %7
%9 = zext i1 %8 to i64
%10 = getelementptr inbounds float, float* %0, i64 %9
%11 = load float, float* %10
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void x0(void) {
  extern char z0;
  fprintf(0, "a");
}


x86 assembly (clang, -O0):
<x0>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<x0>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define void @x0() {
%1 = call i32 @fprintf(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @x0() {
%1 = tail call i32 @fprintf(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test33(__m64 a, __m64 b) { return _mm_add_pi8(a, b); }


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

x86 assembly (clang, -O2):
<test33>:
jmp    1030 <_mm_add_pi8@plt>

LLVM IR (-O0):
define i32 @test33(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 = call i32 @_mm_add_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test33(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void mk_indent(FILE *fp, int lev) {
  int i;
  for (i = 0; i < lev * 2; i++)
    fputc(' ', fp);
}


x86 assembly (clang, -O0):
<mk_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1153 <mk_indent+0x43>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <mk_indent+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_indent>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1142 <mk_indent+0x32>
mov    %rdi,%rbx
add    %esi,%esi
cmp    $0x2,%esi
mov    $0x1,%ebp
cmovge %esi,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <mk_indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @mk_indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = shl nuw i32 %1, 1
%6 = call i32 @llvm.smax.i32(i32 %5, i32 1)
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ 0, %4 ]
%9 = tail call i32 @fputc(i8 signext 32, i32* %0)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %6
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
void tcm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @tcm_init() {
ret void
}
/* Variables and functions */
unsigned long generic_fls(unsigned long);
__attribute__((always_)) unsigned long __attribute__((__const__))
roundup_pow_of_two(unsigned long x) {
  return (1UL << generic_fls(x - 1));
}


x86 assembly (clang, -O0):
<roundup_pow_of_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <generic_fls@plt>
mov    %rax,%rcx
mov    $0x1,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_pow_of_two>:
push   %rax
add    $0xffffffffffffffff,%rdi
call   1030 <generic_fls@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%rdx
mov    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @roundup_pow_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = call i64 @generic_fls(i64 %4)
%6 = shl i64 1, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @roundup_pow_of_two(i64 %0) {
%2 = add i64 %0, -1
%3 = tail call i64 @generic_fls(i64 %2)
%4 = shl nuw i64 1, %3
ret i64 %4
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int fstat(int file, struct stat *st) { svcPanic(); }


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
%6 = call i32 (...) @svcPanic()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int getnextline(FILE *f, char *l) {
  if (fgets(l, 128, f) == NULL)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<getnextline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x80,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1148 <getnextline+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <getnextline+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnextline>:
push   %rax
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    $0x80,%esi
call   1030 <fgets@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getnextline(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i32*, i32** %4
%8 = call i32* @fgets(i8* %6, i32 128, i32* %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @getnextline(i32* nocapture %0, i8* %1) {
%3 = tail call i32* @fgets(i8* %1, i32 128, i32* %0)
%4 = icmp eq i32* %3, null
%5 = sext i1 %4 to i32
ret i32 %5
}
int stderr_open(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @stderr_open() {
ret i32 0
}

LLVM IR (-O2):
define i32 @stderr_open() {
ret i32 0
}
void exception_irq(int id) {}


x86 assembly (clang, -O0):
<exception_irq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @exception_irq(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ pause();
void f(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  g(1);
  pause();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <g@plt>
mov    $0x0,%al
call   1030 <pause@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x1,%edi
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pause@plt>

LLVM IR (-O0):
define void @f(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 = load i8**, i8*** %4
%7 = call i32 @g(i32 1)
%8 = call i32 (...) @pause()
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @g(i32 1)
%4 = tail call i32 (...) @pause()
ret void
}
yyerror() {}


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

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

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

LLVM IR (-O2):
define i32 @yyerror() {
ret i32 undef
}
/* Variables and functions */
int fb_CrtFileCopy(char const *, char const *);
int fb_FileCopy(const char *source, const char *destination) {
  return fb_CrtFileCopy(source, destination);
}


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

x86 assembly (clang, -O2):
<fb_FileCopy>:
jmp    1030 <fb_CrtFileCopy@plt>

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

LLVM IR (-O2):
define i32 @fb_FileCopy(i8* %0, i8* %1) {
%3 = tail call i32 @fb_CrtFileCopy(i8* %0, i8* %1)
ret i32 %3
}