xunge/DecIR huggingface dataset:
unsigned short clip(double x) {
  if (x < 0)
    return 0;
  if (x > 255)
    return 255;
  return x;
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1122 <clip+0x22>
movw   $0x0,-0x2(%rbp)
jmp    114d <clip+0x4d>
movsd  -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1144 <clip+0x44>
movw   $0xff,-0x2(%rbp)
jmp    114d <clip+0x4d>
cvttsd2si -0x10(%rbp),%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    110d <clip+0xd>
xor    %eax,%eax
ret
mov    $0xff,%ax
ucomisd 0xee7(%rip),%xmm0
ja     111f <clip+0x1f>
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define zeroext i16 @clip(double %0) {
%2 = alloca i16
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i16 0, i16* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 2.550000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store i16 255, i16* %2
br label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = fptoui double %12 to i16
store i16 %13, i16* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @clip(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 2.550000e+02
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fptoui double %0 to i16
br label %7
7: ; preds = %3, %1, %5
%8 = phi i16 [ %6, %5 ], [ 0, %1 ], [ 255, %3 ]
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ main_asm();
int main() {
  main_asm();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <main_asm@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <main_asm@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_asm()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int charToInt(char char_c) {
  if (char_c == '0')
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<charToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    1123 <charToInt+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112a <charToInt+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToInt>:
xor    %eax,%eax
cmp    $0x30,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @charToInt(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 48
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @charToInt(i8 signext %0) {
%2 = icmp ne i8 %0, 48
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int ENODEV;
int /*<<< orphan*/ gpio_is_valid_port(unsigned int const);
int /*<<< orphan*/ gpio_set_value(unsigned int const, int);
int __p2ioport_set_gpio(const unsigned int gpio, const int val) {
  int retval = 0;
  if (!gpio_is_valid_port(gpio)) {
    retval = -ENODEV;
    goto fail;
  }
  gpio_set_value(gpio, val ? 1 : 0);
fail:
  return retval;
}


x86 assembly (clang, -O0):
<__p2ioport_set_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <gpio_is_valid_port@plt>
cmp    $0x0,%eax
jne    1159 <__p2ioport_set_gpio+0x39>
xor    %eax,%eax
mov    0x2e91(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0xc(%rbp)
jmp    1171 <__p2ioport_set_gpio+0x51>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
call   1040 <gpio_set_value@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__p2ioport_set_gpio>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <gpio_is_valid_port@plt>
test   %eax,%eax
je     1143 <__p2ioport_set_gpio+0x23>
xor    %esi,%esi
test   %ebp,%ebp
setne  %sil
mov    %ebx,%edi
call   1040 <gpio_set_value@plt>
xor    %eax,%eax
jmp    114e <__p2ioport_set_gpio+0x2e>
mov    0x2e96(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @__p2ioport_set_gpio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = call i32 @gpio_is_valid_port(i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* @ENODEV
%11 = sub nsw i32 0, %10
store i32 %11, i32* %5
br label %19
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
%18 = call i32 @gpio_set_value(i32 %13, i32 %17)
br label %19
19: ; preds = %12, %9
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @__p2ioport_set_gpio(i32 %0, i32 %1) {
%3 = tail call i32 @gpio_is_valid_port(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @ENODEV
%7 = sub nsw i32 0, %6
br label %12
8: ; preds = %2
%9 = icmp ne i32 %1, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @gpio_set_value(i32 %0, i32 %10)
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %8 ], [ %7, %5 ]
ret i32 %13
}
/* Variables and functions */
unsigned char PC1Dec128Byte(unsigned char);
void DecryptBlock(unsigned char *buf, unsigned int nSize) {
  unsigned int n;
  for (n = nSize; n > 0; n--) {
    *buf = PC1Dec128Byte(*buf);
    buf++;
  }
}


x86 assembly (clang, -O0):
<DecryptBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jbe    115d <DecryptBlock+0x4d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <PC1Dec128Byte@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <DecryptBlock+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecryptBlock>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1147 <DecryptBlock+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%edi
call   1030 <PC1Dec128Byte@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1130 <DecryptBlock+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @DecryptBlock(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call zeroext i8 @PC1Dec128Byte(i8 zeroext %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add i32 %5, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int RSA_verify_PKCS1_PSS_mgf1(int /*<<< orphan*/ *, unsigned char const *,
                              int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                              unsigned char const *, int);
int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
                         const EVP_MD *Hash, const unsigned char *EM,
                         int sLen) {
  return RSA_verify_PKCS1_PSS_mgf1(rsa, mHash, Hash, NULL, EM, sLen);
}


x86 assembly (clang, -O0):
<RSA_verify_PKCS1_PSS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <RSA_verify_PKCS1_PSS_mgf1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_verify_PKCS1_PSS>:
mov    %r8d,%r9d
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <RSA_verify_PKCS1_PSS_mgf1@plt>

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

LLVM IR (-O2):
define i32 @RSA_verify_PKCS1_PSS(i32* %0, i8* %1, i32* %2, i8* %3, i32 %4) {
%6 = tail call i32 @RSA_verify_PKCS1_PSS_mgf1(i32* %0, i8* %1, i32* %2, i32* null, i8* %3, i32 %4)
ret i32 %6
}
void bar(int j, char *s) {
  unsigned char array[2];
  int i = 0;
  array[0] = 'c';
  array[1] = 'd';
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movb   $0x63,-0x12(%rbp)
movb   $0x64,-0x11(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [2 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 99, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 100, i8* %8
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
double cos(double);
double log(double);
double sin(double);
double f2a(double x) {
  return (
      (2.0 * x * cos(2.0) + 4.0 * log(sin(1.0 - x)) * sin(2.0) + sin(2.0 * x)) /
      4.0);
}


x86 assembly (clang, -O0):
<f2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xec3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb1(%rip),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xea7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe74(%rip),%xmm0
call   1030 <sin@plt>
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe44(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe1e(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2a>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
subsd  %xmm1,%xmm0
addsd  %xmm1,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <sin@plt>
call   1040 <log@plt>
movapd %xmm0,%xmm2
mulsd  0xeb4(%rip),%xmm2
mulsd  0xeb4(%rip),%xmm2
movsd  0xeb4(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
call   1030 <sin@plt>
addsd  0x8(%rsp),%xmm0
mulsd  0xe95(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f2a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 2.000000e+00, %3
%5 = call double @cos(double 2.000000e+00)
%6 = load double, double* %2
%7 = fsub double 1.000000e+00, %6
%8 = call double @sin(double %7)
%9 = call double @log(double %8)
%10 = fmul double 4.000000e+00, %9
%11 = call double @sin(double 2.000000e+00)
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %4, double %5, double %12)
%14 = load double, double* %2
%15 = fmul double 2.000000e+00, %14
%16 = call double @sin(double %15)
%17 = fadd double %13, %16
%18 = fdiv double %17, 4.000000e+00
ret double %18
}

LLVM IR (-O2):
define double @f2a(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = tail call double @sin(double %3)
%5 = tail call double @log(double %4)
%6 = fmul double %5, 4.000000e+00
%7 = fmul double %6, 0x3FED18F6EAD1B446
%8 = tail call double @llvm.fmuladd.f64(double %2, double 0xBFDAA22657537205, double %7)
%9 = tail call double @sin(double %2)
%10 = fadd double %9, %8
%11 = fmul double %10, 2.500000e-01
ret double %11
}
int is_arp_req(const unsigned char *buf) {
  return buf[12] == 0x08 && buf[13] == 0x06 && buf[21] == 0x01;
}


x86 assembly (clang, -O0):
<is_arp_req>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0xc(%rax),%ecx
xor    %eax,%eax
cmp    $0x8,%ecx
mov    %al,-0x9(%rbp)
jne    1145 <is_arp_req+0x45>
mov    -0x8(%rbp),%rax
movzbl 0xd(%rax),%ecx
xor    %eax,%eax
cmp    $0x6,%ecx
mov    %al,-0x9(%rbp)
jne    1145 <is_arp_req+0x45>
mov    -0x8(%rbp),%rax
movzbl 0x15(%rax),%eax
cmp    $0x1,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_arp_req>:
xor    %eax,%eax
cmpb   $0x8,0xc(%rdi)
jne    1117 <is_arp_req+0x17>
cmpb   $0x6,0xd(%rdi)
jne    1117 <is_arp_req+0x17>
xor    %eax,%eax
cmpb   $0x1,0x15(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_arp_req(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 8
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 6
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 21
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 1
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %9, %5, %1
%15 = phi i32 [ 0, %5 ], [ 0, %1 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void CompSystem_MoveMemory(void *dest, void *src, int elementSize) {
  if (dest != src) {
    memcpy(dest, src, elementSize);
  }
}


x86 assembly (clang, -O0):
<CompSystem_MoveMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1141 <CompSystem_MoveMemory+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompSystem_MoveMemory>:
cmp    %rsi,%rdi
je     111a <CompSystem_MoveMemory+0xa>
jmp    1030 <memcpy@plt>
ret

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

LLVM IR (-O2):
define void @CompSystem_MoveMemory(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
br label %7
7: ; preds = %5, %3
ret void
}
unsigned short(inw_local)(int port) {
  unsigned short value;
  {
    ;
    return (value);
  }
}


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

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

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

LLVM IR (-O2):
define zeroext i16 @inw_local(i32 %0) {
ret i16 undef
}
int test_imm_40int8_reg(signed char val) {
  return ((val) & (0x40 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_40int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x40,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_40int8_reg>:
test   $0x40,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_40int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 64
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_40int8_reg(i8 signext %0) {
%2 = and i8 %0, 64
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void transfer_RGB161616_to_RGB8(unsigned char *(*output), uint16_t *input) {
  *(*output) =
      (unsigned char)(((input[0] & 0xc000) >> 8) + ((input[1] & 0xe000) >> 10) +
                      ((input[2] & 0xe000) >> 13));
  (*output)++;
}


x86 assembly (clang, -O0):
<transfer_RGB161616_to_RGB8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0xc000,%eax
sar    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
and    $0xe000,%ecx
sar    $0xa,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
and    $0xe000,%ecx
sar    $0xd,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_RGB161616_to_RGB8>:
mov    (%rsi),%eax
mov    0x4(%rsi),%ecx
shr    $0x8,%eax
and    $0xc0,%eax
shr    $0xa,%ecx
and    $0x38,%ecx
or     %eax,%ecx
mov    0x8(%rsi),%eax
shr    $0xd,%eax
and    $0x7,%eax
or     %ecx,%eax
mov    (%rdi),%rcx
mov    %al,(%rcx)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @transfer_RGB161616_to_RGB8(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, 49152
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = and i32 %12, 57344
%14 = ashr i32 %13, 10
%15 = add nsw i32 %9, %14
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = and i32 %18, 57344
%20 = ashr i32 %19, 13
%21 = add nsw i32 %15, %20
%22 = trunc i32 %21 to i8
%23 = load i8**, i8*** %3
%24 = load i8*, i8** %23
store i8 %22, i8* %24
%25 = load i8**, i8*** %3
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %25
ret void
}

LLVM IR (-O2):
define void @transfer_RGB161616_to_RGB8(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = lshr i32 %3, 8
%5 = and i32 %4, 192
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = lshr i32 %7, 10
%9 = and i32 %8, 56
%10 = or i32 %9, %5
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = lshr i32 %12, 13
%14 = and i32 %13, 7
%15 = or i32 %10, %14
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %0
store i8 %16, i8* %17
%18 = load i8*, i8** %0
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8* %19, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t();
void q(void) { t(); }


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

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

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

LLVM IR (-O2):
define void @q() {
%1 = tail call i32 (...) @t()
ret void
}
int length(char *string) {
  int count = 0;
  while (string[count++] != '\0')
    ;
  return --count;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1133 <length+0x33>
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret

LLVM IR (-O0):
define i32 @length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %5, 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 %14
13: ; preds = %4
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((__weak__, __always___)) void __softboundcets_dummy() {
  printf("calling abort");
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"calling abort\00"
define weak void @__softboundcets_dummy() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long fta_log_message_pause_null(void) { return 0xFFFFFFFF; }


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

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

LLVM IR (-O0):
define i64 @fta_log_message_pause_null() {
ret i64 4294967295
}

LLVM IR (-O2):
define i64 @fta_log_message_pause_null() {
ret i64 4294967295
}
int STOP_FUNC() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @STOP_FUNC() {
ret i32 0
}
/* Variables and functions */
int yogrt_get_interval1();
int iyogrt_get_interval1_(void) { return yogrt_get_interval1(); }


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

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

LLVM IR (-O0):
define i32 @iyogrt_get_interval1_() {
%1 = call i32 (...) @yogrt_get_interval1()
ret i32 %1
}

LLVM IR (-O2):
define i32 @iyogrt_get_interval1_() {
%1 = tail call i32 (...) @yogrt_get_interval1()
ret i32 %1
}
int free_mem(int pid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @free_mem(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delete_ch();
void cmd_delete(const char *pf, char **args) { delete_ch(); }


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

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

LLVM IR (-O0):
define void @cmd_delete(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = call i32 (...) @delete_ch()
ret void
}

LLVM IR (-O2):
define void @cmd_delete(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @delete_ch()
ret void
}
int astGCap(int cap, int value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @astGCap(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_vertex();
int main() {
  test_vertex();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_vertex()
ret i32 0
}
/* Variables and functions */
double mt_rand_int32();
double mt_rand_real1(void) { return mt_rand_int32() * (1.0 / 4294967295.0); }


x86 assembly (clang, -O0):
<mt_rand_real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_rand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_real1>:
push   %rax
xor    %eax,%eax
call   1030 <mt_rand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_rand_real1() {
%1 = call double (...) @mt_rand_int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}

LLVM IR (-O2):
define double @mt_rand_real1() {
%1 = tail call double (...) @mt_rand_int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}
/* Type definitions */
typedef int ushort;

/* Variables and functions */
ushort Poids(ushort E) {
  ushort poids = 0;
  while (E > 0) {
    E &= E - 1;
    poids++;
  }
  return poids;
}


x86 assembly (clang, -O0):
<Poids>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <Poids+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Poids+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Poids>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <Poids+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <Poids+0x10>
ret

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

LLVM IR (-O2):
define i32 @Poids(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int getc(FILE *f) { return fgetc(f); }


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

x86 assembly (clang, -O2):
<getc>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @getc(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret i32 %2
}
/* Variables and functions */
int CyBtldr_ParseDefaultCmdResult(unsigned char *, unsigned long,
                                  unsigned char *);
int CyBtldr_ParseSetActiveAppCmdResult(unsigned char *cmdBuf,
                                       unsigned long cmdSize,
                                       unsigned char *status) {
  return CyBtldr_ParseDefaultCmdResult(cmdBuf, cmdSize, status);
}


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

x86 assembly (clang, -O2):
<CyBtldr_ParseSetActiveAppCmdResult>:
jmp    1030 <CyBtldr_ParseDefaultCmdResult@plt>

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

LLVM IR (-O2):
define i32 @CyBtldr_ParseSetActiveAppCmdResult(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @CyBtldr_ParseDefaultCmdResult(i8* %0, i64 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int /*<<< orphan*/);
int /*<<< orphan*/ prgm_get_unique_id();
char *new_register(void) {
  char *reg = NULL;
  asprintf(&reg, "%%t%u", prgm_get_unique_id());
  return reg;
}


x86 assembly (clang, -O0):
<new_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <prgm_get_unique_id@plt>
mov    %eax,%edx
lea    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <asprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_register>:
push   %rax
movq   $0x0,(%rsp)
xor    %eax,%eax
call   1040 <prgm_get_unique_id@plt>
lea    0xec9(%rip),%rsi
mov    %rsp,%rdi
mov    %eax,%edx
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%%t%u\00"
define i8* @new_register() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i32 (...) @prgm_get_unique_id()
%3 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"%%t%u\00"
define i8* @new_register() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = tail call i32 (...) @prgm_get_unique_id()
%4 = call i32 @asprintf(i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ gtk_test_init(int *, char ***);
void _gtk_test_init(int *argcp, char ***argvp) { gtk_test_init(argcp, argvp); }


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

x86 assembly (clang, -O2):
<_gtk_test_init>:
jmp    1030 <gtk_test_init@plt>

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

LLVM IR (-O2):
define void @_gtk_test_init(i32* %0, i8*** %1) {
%3 = tail call i32 @gtk_test_init(i32* %0, i8*** %1)
ret void
}
/* Type definitions */
struct _peer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CompleteState(struct _peer *);
void PEER_read(struct _peer *p) { CompleteState(p); }


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

x86 assembly (clang, -O2):
<PEER_read>:
jmp    1030 <CompleteState@plt>

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

LLVM IR (-O2):
%struct._peer = type { i32 }
define void @PEER_read(%struct._peer* %0) {
%2 = tail call i32 @CompleteState(%struct._peer* %0)
ret void
}
void yy_1_TableRowBody(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_TableRowBody(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct group {
  char *gr_name;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
struct group *getgrgid(int /*<<< orphan*/);
char *group_name(gid_t gid) {
  struct group *grp;
  grp = getgrgid(gid);
  if (grp == NULL)
    return NULL;
  return grp->gr_name;
}


x86 assembly (clang, -O0):
<group_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getgrgid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113f <group_name+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    114a <group_name+0x3a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<group_name>:
push   %rax
call   1030 <getgrgid@plt>
test   %rax,%rax
je     1120 <group_name+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type { i8* }
define i8* @group_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.group*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call %struct.group* @getgrgid(i32 %5)
store %struct.group* %6, %struct.group** %4
%7 = load %struct.group*, %struct.group** %4
%8 = icmp eq %struct.group* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %14
10: ; preds = %1
%11 = load %struct.group*, %struct.group** %4
%12 = getelementptr inbounds %struct.group, %struct.group* %11, i32 0, i32 0
%13 = load i8*, i8** %12
store i8* %13, i8** %2
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
%struct.group = type { i8* }
define i8* @group_name(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
void do_fldpi(void *p) {
  asm __volatile__("fninit");
  asm __volatile__("fldpi");
  asm __volatile__("fstpl (%0)" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<do_fldpi>:
fninit
fldpi
fstpl  (%rdi)
ret

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

LLVM IR (-O2):
define void @do_fldpi(i8* %0) {
tail call void asm sideeffect "fninit", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fldpi", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fstpl ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_absy();
int /*<<< orphan*/ e_eor();
void e_eor_absy() {
  e_absy();
  e_eor();
}


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

x86 assembly (clang, -O2):
<e_eor_absy>:
push   %rax
xor    %eax,%eax
call   1030 <e_absy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_eor@plt>

LLVM IR (-O0):
define void @e_eor_absy() {
%1 = call i32 (...) @e_absy()
%2 = call i32 (...) @e_eor()
ret void
}

LLVM IR (-O2):
define void @e_eor_absy() {
%1 = tail call i32 (...) @e_absy()
%2 = tail call i32 (...) @e_eor()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double calcForce(int m, double a) {
  double f;
  f = m * a;
  printf("\nForce experienced during acceleration: %.2lf N", f);
  return f;
}


x86 assembly (clang, -O0):
<calcForce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcForce>:
push   %rax
cvtsi2sd %edi,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [48 x i8] c"\0AForce experienced during acceleration: %.2lf N\00"
define double @calcForce(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load double, double* %4
%9 = fmul double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
@.str = [48 x i8] c"\0AForce experienced during acceleration: %.2lf N\00"
define double @calcForce(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %4)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printdir(char *, int /*<<< orphan*/);
int main() {
  printdir(".", 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32 @printdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, unsigned int);
void do_print_num(unsigned num, unsigned def, const char *name, int all) {
  char line[20];
  if (!all && num == def)
    return;
  sprintf(line, "%s = %u", name, num);
  output(line);
}


x86 assembly (clang, -O0):
<do_print_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1150 <do_print_num+0x30>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1150 <do_print_num+0x30>
jmp    1170 <do_print_num+0x50>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xe9e(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <output@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_print_num>:
mov    %edi,%eax
cmp    %esi,%edi
jne    112b <do_print_num+0xb>
test   %ecx,%ecx
jne    112b <do_print_num+0xb>
ret
push   %rbx
sub    $0x20,%rsp
lea    0xec9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <output@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s = %u\00"
define void @do_print_num(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [20 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
br label %24
17: ; preds = %12, %4
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%19 = load i8*, i8** %7
%20 = load i32, i32* %5
%21 = call i32 @sprintf(i8* %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20)
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%23 = call i32 @output(i8* %22)
br label %24
24: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s = %u\00"
define void @do_print_num(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca [20 x i8]
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = icmp eq i32 %3, 0
%8 = icmp eq i32 %0, %1
%9 = and i1 %8, %7
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %0)
%12 = call i32 @output(i8* %6)
br label %13
13: ; preds = %4, %10
ret void
}
double getclock() {
  double time;
  double omp_get_wtime(void);
  time = omp_get_wtime();
  return time;
}


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

x86 assembly (clang, -O2):
<getclock>:
jmp    1030 <omp_get_wtime@plt>

LLVM IR (-O0):
define double @getclock() {
%1 = alloca double
%2 = call double @omp_get_wtime()
store double %2, double* %1
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @getclock() {
%1 = tail call double @omp_get_wtime()
ret double %1
}
void VID_StartupOpenGL(void) {}


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

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

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

LLVM IR (-O2):
define void @VID_StartupOpenGL() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_retrieve_dobldobl_term(int i, int j, int n, int *exp, double *c) {
  int a[3], fail;
  a[0] = n;
  a[1] = i;
  a[2] = j;
  fail = _ada_use_c2phc4c(335, a, exp, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_retrieve_dobldobl_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x14f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_retrieve_dobldobl_term>:
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %esi,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x14f,%edi
mov    %rcx,%rdx
mov    %r8,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_retrieve_dobldobl_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca double*
%11 = alloca [3 x i32]
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store double* %4, double** %10
%13 = load i32, i32* %8
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
store i32 %15, i32* %16
%17 = load i32, i32* %7
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%20 = load i32*, i32** %9
%21 = load double*, double** %10
%22 = call i32 @_ada_use_c2phc4c(i32 335, i32* %19, i32* %20, double* %21, i32 0)
store i32 %22, i32* %12
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
define i32 @syscon_retrieve_dobldobl_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca [3 x i32]
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %2, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %0, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %1, i32* %10
%11 = call i32 @_ada_use_c2phc4c(i32 335, i32* %8, i32* %3, double* %4, i32 0)
ret i32 %11
}