xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void abort() {
  fprintf(stderr, "abort");
  raise(SIGABRT);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"abort\00"
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SIGABRT
%4 = call i32 @raise(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"abort\00"
@SIGABRT = global i32 0
define void @abort() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SIGABRT
%4 = tail call i32 @raise(i32 %3)
unreachable
}
int UTF8toANSI(char *src) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @UTF8toANSI(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void new_line() { printf("\n"); }


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

x86 assembly (clang, -O2):
<new_line>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @new_line() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
short somatoria(semente)
unsigned char *semente;
{
  short soma = 0;
  while (*semente)
    soma += *semente++;
  return soma;
}


x86 assembly (clang, -O0):
<somatoria>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <somatoria+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%ecx
movswl -0xa(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
jmp    110e <somatoria+0xe>
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<somatoria>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <somatoria+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <somatoria+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i16 @somatoria(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i16 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i16
%10 = add i16 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i16 [ 0, %1 ], [ %10, %4 ]
ret i16 %14
}
void g_hook_ref() {}


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

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

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

LLVM IR (-O2):
define void @g_hook_ref() {
ret void
}
void pattern2newlinespec_inslash() {}


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

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

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

LLVM IR (-O2):
define void @pattern2newlinespec_inslash() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ keyb_in_buff(int, char);
void zpracuj_kod_PC(char c, char minuly_kod) {
  if (minuly_kod == 0) {
    keyb_in_buff(1, c);
  } else {
    switch (c) {
    case (0x5a):
      break;
    }
  }
}


x86 assembly (clang, -O0):
<zpracuj_kod_PC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1144 <zpracuj_kod_PC+0x34>
mov    $0x1,%edi
movsbl -0x1(%rbp),%esi
call   1030 <keyb_in_buff@plt>
jmp    115e <zpracuj_kod_PC+0x4e>
mov    -0x1(%rbp),%al
sub    $0x5a,%al
jne    1159 <zpracuj_kod_PC+0x49>
jmp    1154 <zpracuj_kod_PC+0x44>
jmp    1159 <zpracuj_kod_PC+0x49>
jmp    115e <zpracuj_kod_PC+0x4e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zpracuj_kod_PC>:
test   %sil,%sil
je     1116 <zpracuj_kod_PC+0x6>
ret
movsbl %dil,%esi
mov    $0x1,%edi
jmp    1030 <keyb_in_buff@plt>

LLVM IR (-O0):
define void @zpracuj_kod_PC(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8, i8* %3
%10 = call i32 @keyb_in_buff(i32 1, i8 signext %9)
br label %16
11: ; preds = %2
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
switch i32 %13, label %15 [
i32 90, label %14
]
14: ; preds = %11
br label %15
15: ; preds = %11, %14
br label %16
16: ; preds = %15, %8
ret void
}

LLVM IR (-O2):
define void @zpracuj_kod_PC(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @keyb_in_buff(i32 1, i8 signext %0)
br label %6
6: ; preds = %2, %4
ret void
}
void logLabjack() { return; }


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

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

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

LLVM IR (-O2):
define void @logLabjack() {
ret void
}
char *lcdhw_ident() { return "$Id: lcd_reciva.c 230 2007-10-23 17:42:49Z  $"; }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"$Id: lcd_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @lcdhw_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [46 x i8] c"$Id: lcd_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @lcdhw_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}
double g(double costh) { return 1; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @g(double %0) {
ret double 1.000000e+00
}
/* Variables and functions */
int fabs(scalar_t__);
scalar_t__ invers(int);
int sub(int n) {
  int sub;
  sub = fabs(n - invers(n));
  return sub;
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <invers@plt>
mov    -0x10(%rbp),%rdi
sub    %rax,%rdi
call   1030 <fabs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
push   %rbx
movslq %edi,%rbx
mov    %ebx,%edi
call   1040 <invers@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fabs@plt>

LLVM IR (-O0):
define i32 @sub(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = load i32, i32* %2
%7 = call i64 @invers(i32 %6)
%8 = sub nsw i64 %5, %7
%9 = call i32 @fabs(i64 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @sub(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 @invers(i32 %0)
%4 = sub nsw i64 %2, %3
%5 = tail call i32 @fabs(i64 %4)
ret i32 %5
}
int security_reboot(unsigned int cmd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @security_reboot(i32 %0) {
ret i32 0
}
int isCharWhitespace(char c) {
  return (c == ' ' || c == '\n' || c == '\r' || c == '\t');
}


x86 assembly (clang, -O0):
<isCharWhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <isCharWhitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <isCharWhitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     114d <isCharWhitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCharWhitespace>:
cmp    $0x20,%dil
ja     1120 <isCharWhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    1120 <isCharWhitespace+0x20>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isCharWhitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isCharWhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ MultM(double **, double **, double **);
int /*<<< orphan*/ genScaleMatrix(double, double **);
void ScaleM(double factor, double m[3][3]) {
  double a[3][3];
  genScaleMatrix(factor, a);
  MultM(m, a, m);
}


x86 assembly (clang, -O0):
<ScaleM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x60(%rbp),%rdi
call   1030 <genScaleMatrix@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <MultM@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleM>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <genScaleMatrix@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <MultM@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ScaleM(double %0, [3 x double]* %1) {
%3 = alloca double
%4 = alloca [3 x double]*
%5 = alloca [3 x [3 x double]]
store double %0, double* %3
store [3 x double]* %1, [3 x double]** %4
%6 = load double, double* %3
%7 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%8 = bitcast [3 x double]* %7 to double**
%9 = call i32 @genScaleMatrix(double %6, double** %8)
%10 = load [3 x double]*, [3 x double]** %4
%11 = bitcast [3 x double]* %10 to double**
%12 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%13 = bitcast [3 x double]* %12 to double**
%14 = load [3 x double]*, [3 x double]** %4
%15 = bitcast [3 x double]* %14 to double**
%16 = call i32 @MultM(double** %11, double** %13, double** %15)
ret void
}

LLVM IR (-O2):
define void @ScaleM(double %0, [3 x double]* %1) {
%3 = alloca [3 x [3 x double]]
%4 = bitcast [3 x [3 x double]]* %3 to i8*
%5 = bitcast [3 x [3 x double]]* %3 to double**
%6 = call i32 @genScaleMatrix(double %0, double** %5)
%7 = bitcast [3 x double]* %1 to double**
%8 = call i32 @MultM(double** %7, double** %5, double** %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int dopr(char *, size_t, char const *, int /*<<< orphan*/);
int smb_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
  return dopr(str, count, fmt, args);
}


x86 assembly (clang, -O0):
<smb_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <dopr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smb_vsnprintf>:
jmp    1030 <dopr@plt>

LLVM IR (-O0):
define i32 @smb_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @dopr(i8* %9, i64 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @smb_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @dopr(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
void ME_fd_set(int fd, fd_set *fds) { FD_SET(fd, fds); }


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

x86 assembly (clang, -O2):
<ME_fd_set>:
jmp    1030 <FD_SET@plt>

LLVM IR (-O0):
define void @ME_fd_set(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 @FD_SET(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @ME_fd_set(i32 %0, i32* %1) {
%3 = tail call i32 @FD_SET(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
char const *ip(char const *, int /*<<< orphan*/);
const char *ipv4(const char *interface) { return ip(interface, AF_INET); }


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

x86 assembly (clang, -O2):
<ipv4>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ip@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
define i8* @ipv4(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @AF_INET
%5 = call i8* @ip(i8* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i8* @ipv4(i8* %0) {
%2 = load i32, i32* @AF_INET
%3 = tail call i8* @ip(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void display_calories(float weight, float distance, float coeff) {
  printf("Weight: %3.2f lbs\n", weight);
  printf("Distance: %3.2f miles\n", distance);
  printf("Calories burned: %4.2f cal\n", coeff * weight * distance);
}


x86 assembly (clang, -O0):
<display_calories>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_calories>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x10(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
movss  0xc(%rsp),%xmm0
call   1030 <printf@plt>
movss  0x14(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
lea    0xecd(%rip),%rdi
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Weight: %3.2f lbs\0A\00"
@.str.1 = [23 x i8] c"Distance: %3.2f miles\0A\00"
@.str.2 = [28 x i8] c"Calories burned: %4.2f cal\0A\00"
define void @display_calories(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load float, float* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), float %9)
%11 = load float, float* %6
%12 = load float, float* %4
%13 = fmul float %11, %12
%14 = load float, float* %5
%15 = fmul float %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), float %15)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Weight: %3.2f lbs\0A\00"
@.str.1 = [23 x i8] c"Distance: %3.2f miles\0A\00"
@.str.2 = [28 x i8] c"Calories burned: %4.2f cal\0A\00"
define void @display_calories(float %0, float %1, float %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), float %1)
%6 = fmul float %0, %2
%7 = fmul float %6, %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), float %7)
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void spawnhandler(int signumber) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0) {
    printf("circle of life completed for %i\n", pid);
  }
}


x86 assembly (clang, -O0):
<spawnhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <spawnhandler+0x42>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <spawnhandler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawnhandler>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117e <spawnhandler+0x5e>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <spawnhandler+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [33 x i8] c"circle of life completed for %i\0A\00"
define void @spawnhandler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [33 x i8] c"circle of life completed for %i\0A\00"
define void @spawnhandler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
__typeof__(vfscanf(1, (void *)1)) test_vfscanf_231(void) {
  return vfscanf(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_vfscanf_231>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <vfscanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vfscanf_231>:
mov    $0x1,%esi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <vfscanf@plt>

LLVM IR (-O0):
define i32 @test_vfscanf_231() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfscanf to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_vfscanf_231() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @vfscanf to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
int Int_neg(int x) { return -x; }


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

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

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

LLVM IR (-O2):
define i32 @Int_neg(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __NR_fsconfig;
int syscall(int /*<<< orphan*/, int, unsigned int, char const *, void const *,
            int);
int fsconfig(int fd, unsigned int cmd, const char *key, const void *val,
             int aux) {
  return syscall(__NR_fsconfig, fd, cmd, key, val, aux);
}


x86 assembly (clang, -O0):
<fsconfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsconfig>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_fsconfig = global i32 0
define i32 @fsconfig(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* @__NR_fsconfig
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i32 @syscall(i32 %11, i32 %12, i32 %13, i8* %14, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@__NR_fsconfig = global i32 0
define i32 @fsconfig(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = load i32, i32* @__NR_fsconfig
%7 = tail call i32 @syscall(i32 %6, i32 %0, i32 %1, i8* %2, i8* %3, i32 %4)
ret i32 %7
}
int err_compare_descending(const void *_a, const void *_b) {
  const double *a = _a;
  const double *b = _b;
  return ((*a) < (*b)) ? 1 : -1;
}


x86 assembly (clang, -O0):
<err_compare_descending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_compare_descending>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
seta   %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @err_compare_descending(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
store double* %8, double** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
store double* %10, double** %6
%11 = load double*, double** %5
%12 = load double, double* %11
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fcmp olt double %12, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 -1
ret i32 %17
}

LLVM IR (-O2):
define i32 @err_compare_descending(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
long long gcd2(long long a, long long b) {
  while (b != 0) {
    long long t = b;
    b = a % b;
    a = t;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <gcd2+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <gcd2+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd2>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd2+0x35>
mov    %rsi,%rdx
jmp    111d <gcd2+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd2+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd2+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd2+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd2(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = srem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Variables and functions */
char *_addBinary(char *, char *, int, int);
int strlen(char *);
char *addBinary(char *a, char *b) {
  int al = strlen(a);
  int bl = strlen(b);
  return al > bl ? _addBinary(a, b, al, bl) : _addBinary(b, a, bl, al);
}


x86 assembly (clang, -O0):
<addBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1170 <addBinary+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <_addBinary@plt>
mov    %rax,-0x20(%rbp)
jmp    1187 <addBinary+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <_addBinary@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addBinary>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %eax,%ebp
jle    1149 <addBinary+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
jmp    1153 <addBinary+0x33>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_addBinary@plt>

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

LLVM IR (-O2):
define i8* @addBinary(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i8* @_addBinary(i8* %0, i8* %1, i32 %3, i32 %4)
br label %10
8: ; preds = %2
%9 = tail call i8* @_addBinary(i8* %1, i8* %0, i32 %4, i32 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int closedir(int /*<<< orphan*/ *);
int zfs_closedir(DIR *dirp) { return closedir(dirp); }


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

x86 assembly (clang, -O2):
<zfs_closedir>:
jmp    1030 <closedir@plt>

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

LLVM IR (-O2):
define i32 @zfs_closedir(i32* nocapture %0) {
%2 = tail call i32 @closedir(i32* %0)
ret i32 %2
}
void disable_cci(int cluster) {}


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

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

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

LLVM IR (-O2):
define void @disable_cci(i32 %0) {
ret void
}
float input_null_get_sensor_input(void *data, unsigned port, unsigned id) {
  return 0.0;
}


x86 assembly (clang, -O0):
<input_null_get_sensor_input>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_null_get_sensor_input>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @input_null_get_sensor_input(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @input_null_get_sensor_input(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  short int x = 10;
  short y = 10;
  printf("%zu\n", sizeof x);
  printf("%zu\n", sizeof y);
  long int lx = 10;
  long ly = 10;
  printf("%zu\n", sizeof lx);
  printf("%zu\n", sizeof ly);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xa,-0x6(%rbp)
movw   $0xa,-0x8(%rbp)
lea    0xece(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movq   $0xa,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Type definitions */
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_addr;
};

/* Variables and functions */
int memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int sacmp6(struct sockaddr_in6 *a, struct sockaddr_in6 *b) {
  return memcmp(&a->sin6_addr, &b->sin6_addr, sizeof(a->sin6_addr));
}


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

x86 assembly (clang, -O2):
<sacmp6>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
define i32 @sacmp6(%struct.sockaddr_in6* %0, %struct.sockaddr_in6* %1) {
%3 = alloca %struct.sockaddr_in6*
%4 = alloca %struct.sockaddr_in6*
store %struct.sockaddr_in6* %0, %struct.sockaddr_in6** %3
store %struct.sockaddr_in6* %1, %struct.sockaddr_in6** %4
%5 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %3
%6 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %5, i32 0, i32 0
%7 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %4
%8 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %7, i32 0, i32 0
%9 = call i32 @memcmp(i32* %6, i32* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32 }
define i32 @sacmp6(%struct.sockaddr_in6* %0, %struct.sockaddr_in6* %1) {
%3 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %0, i64 0, i32 0
%4 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %1, i64 0, i32 0
%5 = tail call i32 @memcmp(i32* %3, i32* %4, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ReloadGame(int);
void LoadNextGameProc() { ReloadGame(1); }


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

x86 assembly (clang, -O2):
<LoadNextGameProc>:
mov    $0x1,%edi
jmp    1030 <ReloadGame@plt>

LLVM IR (-O0):
define void @LoadNextGameProc() {
%1 = call i32 @ReloadGame(i32 1)
ret void
}

LLVM IR (-O2):
define void @LoadNextGameProc() {
%1 = tail call i32 @ReloadGame(i32 1)
ret void
}
void func9(i, IDENT) {}


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

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

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

LLVM IR (-O2):
define void @func9(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f(void *);
main() {
  if (f((void *)0) != sizeof(void *))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <f@plt>
cltq
cmp    $0x8,%rax
je     114b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <f@plt>
cmp    $0x8,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i8* null)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 8
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i8* null)
%2 = icmp eq i32 %1, 8
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gc();
void primitive_gc_impl(void) { gc(); }


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

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

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

LLVM IR (-O2):
define void @primitive_gc_impl() {
%1 = tail call i32 (...) @gc()
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct node *);
void node_free(struct node *N) {
  if (N == NULL)
    return;
  free(N);
}


x86 assembly (clang, -O0):
<node_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <node_free+0x1c>
jmp    1135 <node_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_free>:
test   %rdi,%rdi
je     111a <node_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @node_free(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = icmp eq %struct.node* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.node*, %struct.node** %2
%8 = call i32 @free(%struct.node* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @node_free(%struct.node* %0) {
%2 = icmp eq %struct.node* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.node* %0)
br label %5
5: ; preds = %1, %3
ret void
}
void k_cli() { asm("cli"); }


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

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

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

LLVM IR (-O2):
define void @k_cli() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pound(int n) {
  while (n-- > 0) {
    printf("#");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<pound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <pound+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <pound+0xb>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pound>:
push   %rbx
test   %edi,%edi
jle    1132 <pound+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x23,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <pound+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @pound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @pound(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i32 35)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret void
}
short loadPointShortAtfrom(int index, int shortArray) {
  return (((short *)shortArray))[index];
}


x86 assembly (clang, -O0):
<loadPointShortAtfrom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movslq -0x4(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadPointShortAtfrom>:
movslq %esi,%rax
movslq %edi,%rcx
movzwl (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define signext i16 @loadPointShortAtfrom(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i16*
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i16, i16* %7, i64 %9
%11 = load i16, i16* %10
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @loadPointShortAtfrom(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = inttoptr i64 %3 to i16*
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i16, i16* %4, i64 %5
%7 = load i16, i16* %6
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ enprintf(int, char *);
void *malloc(size_t);
void *enmalloc(int status, size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    enprintf(status, "malloc: out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<enmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <enmalloc+0x36>
mov    -0x4(%rbp),%edi
lea    0xeaf(%rip),%rsi
call   1040 <enprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enmalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <enmalloc+0x23>
lea    0xec4(%rip),%rsi
mov    %ebp,%edi
call   1040 <enprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"malloc: out of memory\0A\00"
define i8* @enmalloc(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 @enprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"malloc: out of memory\0A\00"
define noalias i8* @enmalloc(i32 %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @enprintf(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int base64_encode_block(char *, int *, void const *, int);
int encode_block(char *dst, int *dstlen, const void *src, int srclen) {
  return (base64_encode_block(dst, dstlen, src, srclen));
}


x86 assembly (clang, -O0):
<encode_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <base64_encode_block@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_block>:
jmp    1030 <base64_encode_block@plt>

LLVM IR (-O0):
define i32 @encode_block(i8* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @base64_encode_block(i8* %9, i32* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @encode_block(i8* %0, i32* %1, i8* %2, i32 %3) {
%5 = tail call i32 @base64_encode_block(i8* %0, i32* %1, i8* %2, i32 %3)
ret i32 %5
}
double foo(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
char *String_addtoaddr(char *str, int add) { return str + add; }


x86 assembly (clang, -O0):
<String_addtoaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<String_addtoaddr>:
movslq %esi,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @String_addtoaddr(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}