xunge/DecIR huggingface dataset:
/* Variables and functions */
int maxProfit(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a[] = {3, 1, 2, 6, 5, 6};
  printf("%d\n", maxProfit(a, 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x6,%esi
call   1040 <maxProfit@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1040 <maxProfit@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 3, i32 1, i32 2, i32 6, i32 5, i32 6]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxProfit(i32* %5, i32 6)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int output_check_phase(double, int /*<<< orphan*/);
int output_check(double interval) { return output_check_phase(interval, 0); }


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

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

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

LLVM IR (-O2):
define i32 @output_check(double %0) {
%2 = tail call i32 @output_check_phase(double %0, i32 0)
ret i32 %2
}
extern long bug_2591(long a, long b, long c) { return a | b | c; }


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

x86 assembly (clang, -O2):
<bug_2591>:
mov    %rdi,%rax
or     %rsi,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @bug_2591(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = or i64 %7, %8
%10 = load i64, i64* %6
%11 = or i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @bug_2591(i64 %0, i64 %1, i64 %2) {
%4 = or i64 %1, %0
%5 = or i64 %4, %2
ret i64 %5
}
int cuadrado(int numero) {
  int cuad = numero * numero;
  return cuad;
}


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

x86 assembly (clang, -O2):
<cuadrado>:
mov    %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @cuadrado(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @cuadrado(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int func2(int a) {}


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

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

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

LLVM IR (-O2):
define i32 @func2(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int __syscall_chroot(char const *);
int chroot(const char *path) { return __syscall_chroot(path); }


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

x86 assembly (clang, -O2):
<chroot>:
jmp    1030 <__syscall_chroot@plt>

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

LLVM IR (-O2):
define i32 @chroot(i8* %0) {
%2 = tail call i32 @__syscall_chroot(i8* %0)
ret i32 %2
}
void ff_hevc_put_hevc_epel_h48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h48_10_sse4() {
ret void
}
int string_length(char *str) {
  int length = 0;
  while (*str != '\0') {
    length++;
    str++;
  }
  return length;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <string_length+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <string_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
cmpb   $0x0,(%rdi)
je     111c <string_length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <string_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_length(i8* nocapture %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 i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%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
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int ft_str_is_uppercase(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    if (str[i] < 'A' || str[i] > 'Z')
      return (0);
    i++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_str_is_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <ft_str_is_uppercase+0x68>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     114e <ft_str_is_uppercase+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jle    115a <ft_str_is_uppercase+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    116f <ft_str_is_uppercase+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <ft_str_is_uppercase+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_str_is_uppercase>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <ft_str_is_uppercase+0x23>
add    $0x1,%rdi
nop
add    $0xa5,%cl
cmp    $0xe5,%cl
jbe    1124 <ft_str_is_uppercase+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_str_is_uppercase+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ft_str_is_uppercase(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %30, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %33
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp slt i32 %19, 65
br i1 %20, label %29, label %21
21: ; preds = %13
%22 = load i8*, i8** %3
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp sgt i32 %27, 90
br i1 %28, label %29, label %30
29: ; preds = %21, %13
store i32 0, i32* %2
br label %34
30: ; preds = %21
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %5
33: ; preds = %5
store i32 1, i32* %2
br label %34
34: ; preds = %33, %29
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @ft_str_is_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -91
%12 = icmp ult i8 %11, -26
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
int do_something_again(int *values, int count, int (*funct)(int *, int)) {
  return funct(values, count);
}


x86 assembly (clang, -O0):
<do_something_again>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_something_again>:
jmp    *%rdx

LLVM IR (-O0):
define i32 @do_something_again(i32* %0, i32 %1, i32 (i32*, i32)* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32 (i32*, i32)*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 (i32*, i32)* %2, i32 (i32*, i32)** %6
%7 = load i32 (i32*, i32)*, i32 (i32*, i32)** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = call i32 %7(i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @do_something_again(i32* %0, i32 %1, i32 (i32*, i32)* nocapture %2) {
%4 = tail call i32 %2(i32* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dealloc(void **);
void freeTokens(char **tokenarray, int begin, int end) {
  int i;
  for (i = begin; i < end; i++) {
    dealloc((void **)(&tokenarray[i]));
  }
}


x86 assembly (clang, -O0):
<freeTokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1156 <freeTokens+0x46>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <dealloc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <freeTokens+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeTokens>:
push   %rbp
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1141 <freeTokens+0x31>
mov    %edx,%ebp
movslq %esi,%rax
lea    (%rdi,%rax,8),%rbx
sub    %esi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <dealloc@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
jne    1130 <freeTokens+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @freeTokens(i8** %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = sext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = tail call i32 @dealloc(i8** %9)
%11 = add nsw i64 %8, 1
%12 = trunc i64 %11 to i32
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void log_write_err(int fd) {
  fprintf(stderr, "Error: Could not write from parent to fd: %d, %s\n", fd,
          strerror(errno));
}


x86 assembly (clang, -O0):
<log_write_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    %rax,%rcx
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_write_err>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebd(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Error: Could not write from parent to fd: %d, %s\0A\00"
@errno = global i32 0
define void @log_write_err(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Error: Could not write from parent to fd: %d, %s\0A\00"
@errno = global i32 0
define void @log_write_err(i32 %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

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


x86 assembly (clang, -O0):
<test_mm_cmpeq_pi8>:
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_cmpeq_pi8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmpeq_pi8>:
jmp    1030 <_mm_cmpeq_pi8@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpeq_pi8(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_cmpeq_pi8(i32 %5, i32 %6)
ret i32 %7
}

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

/* Variables and functions */
int /*<<< orphan*/ wcsstr(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninivar_wcsstr(void) {
  wchar_t *cs;
  wchar_t *ct;
  (void)wcsstr(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninivar_wcsstr>:
jmp    1030 <wcsstr@plt>

LLVM IR (-O0):
define void @uninivar_wcsstr() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcsstr(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcsstr() {
%1 = tail call i32 @wcsstr(i32* undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int assert(const char *name, int retval) {
  if (retval == -1)
    perror(name);
  return retval;
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1132 <assert+0x22>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
push   %rbx
mov    %esi,%ebx
cmp    $0xffffffff,%esi
je     111c <assert+0xc>
mov    %ebx,%eax
pop    %rbx
ret
call   1030 <perror@plt>
jmp    1118 <assert+0x8>

LLVM IR (-O0):
define i32 @assert(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 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @assert(i8* nocapture %0, i32 returned %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
br label %6
6: ; preds = %4, %2
ret i32 %1
}
/* Variables and functions */
int round(double value) {
  int floor = (int)value;
  if (value - (double)floor < (double)(floor + 1) - value) {
    return value;
  }
  return value + 1;
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm0
subsd  %xmm0,%xmm1
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
subsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1145 <round+0x45>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <round+0x59>
movsd  0xeb3(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
cvttsd2si %xmm0,%ecx
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
movapd %xmm0,%xmm2
lea    0x1(%rcx),%eax
cvtsi2sd %eax,%xmm3
subsd  %xmm1,%xmm2
subsd  %xmm0,%xmm3
ucomisd %xmm2,%xmm3
addsd  0xed5(%rip),%xmm0
cvttsd2si %xmm0,%eax
cmova  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @round(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
%7 = load double, double* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fsub double %7, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = sitofp i32 %12 to double
%14 = load double, double* %3
%15 = fsub double %13, %14
%16 = fcmp olt double %10, %15
br i1 %16, label %17, label %20
17: ; preds = %1
%18 = load double, double* %3
%19 = fptosi double %18 to i32
store i32 %19, i32* %2
br label %24
20: ; preds = %1
%21 = load double, double* %3
%22 = fadd double %21, 1.000000e+00
%23 = fptosi double %22 to i32
store i32 %23, i32* %2
br label %24
24: ; preds = %20, %17
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @round(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = add nsw i32 %2, 1
%6 = sitofp i32 %5 to double
%7 = fsub double %6, %0
%8 = fcmp olt double %4, %7
%9 = fadd double %0, 1.000000e+00
%10 = fptosi double %9 to i32
%11 = select i1 %8, i32 %2, i32 %10
ret i32 %11
}
void _Z12_Jv_CondWaitP23_Jv_ConditionVariable_tP11_Jv_Mutex_txi(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z12_Jv_CondWaitP23_Jv_ConditionVariable_tP11_Jv_Mutex_txi() {
ret void
}
unsigned short VDP_getPaletteColor(unsigned short numpal,
                                   unsigned short numcol) {
  volatile unsigned short *pw;
  volatile unsigned long *pl;
  unsigned short addr;
  pw = (unsigned short *)0xC00000;
  pl = (unsigned long *)0xC00004;
  addr = (numpal * 32) + (numcol * 2);
  *pl = ((0x0000 + ((addr)&0x3FFF)) << 16) + (((addr) >> 14) | 0x20);
  return *pw;
}


x86 assembly (clang, -O0):
<VDP_getPaletteColor>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0xc00000,%eax
mov    %rax,-0x10(%rbp)
mov    $0xc00004,%eax
mov    %rax,-0x18(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x5,%eax
movzwl -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %ax,-0x1a(%rbp)
movzwl -0x1a(%rbp),%eax
and    $0x3fff,%eax
add    $0x0,%eax
shl    $0x10,%eax
movzwl -0x1a(%rbp),%ecx
sar    $0xe,%ecx
or     $0x20,%ecx
add    %ecx,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_getPaletteColor>:
shl    $0x5,%edi
lea    (%rdi,%rsi,2),%eax
movzwl %ax,%eax
mov    %eax,%ecx
shl    $0x10,%ecx
and    $0x3ffe0000,%ecx
shr    $0xe,%eax
add    %ecx,%eax
add    $0x20,%eax
mov    %rax,0xc00004
movzwl 0xc00000,%eax
ret

LLVM IR (-O0):
define zeroext i16 @VDP_getPaletteColor(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i64*
%7 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
store i16* inttoptr (i64 12582912 to i16*), i16** %5
store i64* inttoptr (i64 12582916 to i64*), i64** %6
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = mul nsw i32 %9, 32
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = mul nsw i32 %12, 2
%14 = add nsw i32 %10, %13
%15 = trunc i32 %14 to i16
store i16 %15, i16* %7
%16 = load i16, i16* %7
%17 = zext i16 %16 to i32
%18 = and i32 %17, 16383
%19 = add nsw i32 0, %18
%20 = shl i32 %19, 16
%21 = load i16, i16* %7
%22 = zext i16 %21 to i32
%23 = ashr i32 %22, 14
%24 = or i32 %23, 32
%25 = add nsw i32 %20, %24
%26 = sext i32 %25 to i64
%27 = load i64*, i64** %6
store volatile i64 %26, i64* %27
%28 = load i16*, i16** %5
%29 = load volatile i16, i16* %28
ret i16 %29
}

LLVM IR (-O2):
define zeroext i16 @VDP_getPaletteColor(i16 zeroext %0, i16 zeroext %1) {
%3 = shl i16 %0, 5
%4 = shl i16 %1, 1
%5 = add i16 %4, %3
%6 = zext i16 %5 to i32
%7 = shl nuw i32 %6, 16
%8 = and i32 %7, 1073610752
%9 = lshr i32 %6, 14
%10 = or i32 %9, %8
%11 = or i32 %10, 32
%12 = zext i32 %11 to i64
store volatile i64 %12, i64* inttoptr (i64 12582916 to i64*)
%13 = load volatile i16, i16* inttoptr (i64 12582912 to i16*)
ret i16 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_unblock_sigsv() {
  printf("NOT IMPLEMENTED:"
         "pa_unblock_sigsv"
         "\n");
}


x86 assembly (clang, -O0):
<pa_unblock_sigsv>:
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_unblock_sigsv>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_unblock_sigsv\0A\00"
define i32 @pa_unblock_sigsv() {
%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_unblock_sigsv\00"
define i32 @pa_unblock_sigsv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int symbolhash(char *s) {
  int hash, c, shift;
  hash = 0;
  while (*s != 0) {
    c = (*s) - 48;
    hash = (hash << 5) - hash + c;
    s += 1;
  }
  return hash & (0x20000 - 1);
}


x86 assembly (clang, -O0):
<symbolhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <symbolhash+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <symbolhash+0xf>
mov    -0xc(%rbp),%eax
and    $0x1ffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbolhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1131 <symbolhash+0x31>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
lea    (%rdx,%rcx,1),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <symbolhash+0x10>
and    $0x1ffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @symbolhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %12, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %7, 31
%10 = add i32 %9, -48
%11 = add i32 %10, %8
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = and i32 %11, 131071
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double x;
  int i;
  for (x = 900000, i = 1; x >= 0; x -= 100000, i++)
    x += (x * 0.08);
  printf("%d\n", i);
  printf("%g", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1188 <main+0x78>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <main+0x23>
cvtsi2sdl -0x14(%rbp),%xmm0
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%g\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double 9.000000e+05, double* %2
store i32 1, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load double, double* %2
%6 = fcmp oge double %5, 0.000000e+00
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load double, double* %2
%9 = load double, double* %2
%10 = call double @llvm.fmuladd.f64(double %8, double 8.000000e-02, double %9)
store double %10, double* %2
br label %11
11: ; preds = %7
%12 = load double, double* %2
%13 = fsub double %12, 1.000000e+05
store double %13, double* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to double
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %18)
%20 = load double, double* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%g\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.800000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double 0xC0E5F9CA36B99B54)
ret i32 0
}
/* Variables and functions */
double tanh(double);
float lmsPerceptronPhi(float v) { return 1.7159 * tanh(.666666 * v); }


x86 assembly (clang, -O0):
<lmsPerceptronPhi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <tanh@plt>
movaps %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmsPerceptronPhi>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <tanh@plt>
mulsd  0xede(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @lmsPerceptronPhi(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 0x3FE55553EF6B5D46, %4
%6 = call double @tanh(double %5)
%7 = fmul double 1.715900e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @lmsPerceptronPhi(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3FE55553EF6B5D46
%4 = tail call double @tanh(double %3)
%5 = fmul double %4, 1.715900e+00
%6 = fptrunc double %5 to float
ret float %6
}
void sched_rt_rq_enqueue(struct rt_rq *rt_rq) {}


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

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

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

LLVM IR (-O2):
%struct.rt_rq = type opaque
define void @sched_rt_rq_enqueue(%struct.rt_rq* nocapture %0) {
ret void
}
void show_struct_table() {}


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

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

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

LLVM IR (-O2):
define void @show_struct_table() {
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *bgbrpi_talloc(char *str, int sz) {
  void *ptr;
  ptr = malloc(sz);
  memset(ptr, 0, sz);
  return (ptr);
}


x86 assembly (clang, -O0):
<bgbrpi_talloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgbrpi_talloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @bgbrpi_talloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call i32 @memset(i8* %8, i32 0, i32 %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @bgbrpi_talloc(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @memset(i8* %3, i32 0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *);
char *getenv(char const *);
scalar_t__ strlen(char const *);
const char *getenv_string(const char *var_name) {
  const char *var_value = getenv(var_name);
  if (var_value == NULL || strlen(var_value) <= 0)
    errx(1, "Environment variable not set: %s", var_name);
  return var_value;
}


x86 assembly (clang, -O0):
<getenv_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1167 <getenv_string+0x37>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jg     117c <getenv_string+0x4c>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xe89(%rip),%rsi
call   1050 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1151 <getenv_string+0x21>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jg     1165 <getenv_string+0x35>
lea    0xea8(%rip),%rsi
mov    $0x1,%edi
mov    %r14,%rdx
call   1050 <errx@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Environment variable not set: %s\00"
define i8* @getenv_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = icmp sle i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8, %1
%13 = load i8*, i8** %2
%14 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %8
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [33 x i8] c"Environment variable not set: %s\00"
define i8* @getenv_string(i8* %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* %2)
%6 = icmp slt i64 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4, %1
%8 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %4
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t minipack_unpack_uint32(void *ptr, size_t *sz) {
  *sz = 5;
  uint32_t value = *((uint32_t *)(ptr + 1));
  return ntohl(value);
}


x86 assembly (clang, -O0):
<minipack_unpack_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <ntohl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_uint32>:
movq   $0x5,(%rsi)
mov    0x1(%rdi),%edi
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @minipack_unpack_uint32(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
store i64 5, i64* %6
%7 = load i8*, i8** %3
%8 = getelementptr i8, i8* %7, i64 1
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i32 @ntohl(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @minipack_unpack_uint32(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 5, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @ntohl(i32 %5)
ret i32 %6
}
/* Variables and functions */
void *ss_malloc(size_t);
void *ss_align(size_t size) {
  int err;
  void *tmp = NULL;
  err = -1;
  if (err) {
    return ss_malloc(size);
  } else {
    return tmp;
  }
}


x86 assembly (clang, -O0):
<ss_align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1147 <ss_align+0x37>
mov    -0x10(%rbp),%rdi
call   1030 <ss_malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    114f <ss_align+0x3f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_align>:
jmp    1030 <ss_malloc@plt>

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

LLVM IR (-O2):
define i8* @ss_align(i64 %0) {
%2 = tail call i8* @ss_malloc(i64 %0)
ret i8* %2
}
void busy_wait(void) {
  for (int i = 0; i < 1000000; i++)
    ;
}


x86 assembly (clang, -O0):
<busy_wait>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    112b <busy_wait+0x2b>
jmp    111d <busy_wait+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <busy_wait+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @busy_wait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readlink(char *, char *, unsigned int);
int get_executable_path(char *szStr, unsigned int uStrSize) {
  szStr[0] = '\0';
  readlink("/proc/self/exe", szStr, uStrSize);
  if (szStr[0] != '\0')
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<get_executable_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xecc(%rip),%rdi
call   1030 <readlink@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <get_executable_path+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115c <get_executable_path+0x4c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_executable_path>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
movb   $0x0,(%rdi)
lea    0xee0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <readlink@plt>
cmpb   $0x1,(%rbx)
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @get_executable_path(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 0, i32* %3
br label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i32 @get_executable_path(i8* nocapture %0, i32 %1) {
store i8 0, i8* %0
%3 = tail call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Drive(int, int /*<<< orphan*/);
int /*<<< orphan*/ Pickup();
int /*<<< orphan*/ wait10Msec(int);
void blueBack() {
  Drive(127, 0);
  wait10Msec(75);
  Drive(-127, 0);
  wait10Msec(50);
  Drive(127, 0);
  Pickup();
  wait10Msec(60);
  Drive(0, 0);
  Pickup();
  wait10Msec(25);
  Pickup();
  wait10Msec(35);
}


x86 assembly (clang, -O0):
<blueBack>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f,%edi
xor    %esi,%esi
call   1030 <Drive@plt>
mov    $0x4b,%edi
call   1040 <wait10Msec@plt>
mov    $0xffffff81,%edi
xor    %esi,%esi
call   1030 <Drive@plt>
mov    $0x32,%edi
call   1040 <wait10Msec@plt>
mov    $0x7f,%edi
xor    %esi,%esi
call   1030 <Drive@plt>
mov    $0x0,%al
call   1050 <Pickup@plt>
mov    $0x3c,%edi
call   1040 <wait10Msec@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <Drive@plt>
mov    $0x0,%al
call   1050 <Pickup@plt>
mov    $0x19,%edi
call   1040 <wait10Msec@plt>
mov    $0x0,%al
call   1050 <Pickup@plt>
mov    $0x23,%edi
call   1040 <wait10Msec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blueBack>:
push   %rax
mov    $0x7f,%edi
xor    %esi,%esi
call   1030 <Drive@plt>
mov    $0x4b,%edi
call   1040 <wait10Msec@plt>
mov    $0xffffff81,%edi
xor    %esi,%esi
call   1030 <Drive@plt>
mov    $0x32,%edi
call   1040 <wait10Msec@plt>
mov    $0x7f,%edi
xor    %esi,%esi
call   1030 <Drive@plt>
xor    %eax,%eax
call   1050 <Pickup@plt>
mov    $0x3c,%edi
call   1040 <wait10Msec@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <Drive@plt>
xor    %eax,%eax
call   1050 <Pickup@plt>
mov    $0x19,%edi
call   1040 <wait10Msec@plt>
xor    %eax,%eax
call   1050 <Pickup@plt>
mov    $0x23,%edi
pop    %rax
jmp    1040 <wait10Msec@plt>

LLVM IR (-O0):
define void @blueBack() {
%1 = call i32 @Drive(i32 127, i32 0)
%2 = call i32 @wait10Msec(i32 75)
%3 = call i32 @Drive(i32 -127, i32 0)
%4 = call i32 @wait10Msec(i32 50)
%5 = call i32 @Drive(i32 127, i32 0)
%6 = call i32 (...) @Pickup()
%7 = call i32 @wait10Msec(i32 60)
%8 = call i32 @Drive(i32 0, i32 0)
%9 = call i32 (...) @Pickup()
%10 = call i32 @wait10Msec(i32 25)
%11 = call i32 (...) @Pickup()
%12 = call i32 @wait10Msec(i32 35)
ret void
}

LLVM IR (-O2):
define void @blueBack() {
%1 = tail call i32 @Drive(i32 127, i32 0)
%2 = tail call i32 @wait10Msec(i32 75)
%3 = tail call i32 @Drive(i32 -127, i32 0)
%4 = tail call i32 @wait10Msec(i32 50)
%5 = tail call i32 @Drive(i32 127, i32 0)
%6 = tail call i32 (...) @Pickup()
%7 = tail call i32 @wait10Msec(i32 60)
%8 = tail call i32 @Drive(i32 0, i32 0)
%9 = tail call i32 (...) @Pickup()
%10 = tail call i32 @wait10Msec(i32 25)
%11 = tail call i32 (...) @Pickup()
%12 = tail call i32 @wait10Msec(i32 35)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_handler(const int sig) {
  printf("SIGINT handled.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [17 x i8] c"SIGINT handled.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [16 x i8] c"SIGINT handled.\00"
define void @sig_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void ltr(unsigned int segsel_tss) {}


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

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

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

LLVM IR (-O2):
define void @ltr(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
char *crypt(const char *key, const char *salt) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<crypt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @crypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @crypt(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}
void foo361(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo361(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data_set(int, int);
void usb_on() { data_set(2, 3); }


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

x86 assembly (clang, -O2):
<usb_on>:
mov    $0x2,%edi
mov    $0x3,%esi
jmp    1030 <data_set@plt>

LLVM IR (-O0):
define void @usb_on() {
%1 = call i32 @data_set(i32 2, i32 3)
ret void
}

LLVM IR (-O2):
define void @usb_on() {
%1 = tail call i32 @data_set(i32 2, i32 3)
ret void
}