xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x0c() {
  Assert_real((isascii(12)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              65, ("isascii should be 1 for 0x0c"));
}


x86 assembly (clang, -O0):
<t_isascii_0x0c>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x41,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x0c>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x41,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0c\00"
define void @t_isascii_0x0c() {
%1 = call i32 @isascii(i32 12)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0c\00"
define void @t_isascii_0x0c() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float futrts_mad32(float a, float b, float c) { return a * b + c; }


x86 assembly (clang, -O0):
<futrts_mad32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<futrts_mad32>:
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @futrts_mad32(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 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fmuladd.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @futrts_mad32(float %0, float %1, float %2) {
%4 = tail call float @llvm.fmuladd.f32(float %0, float %1, float %2)
ret float %4
}
char divides(int a, int b) { return (a / b > 0) ? 1 : 0; }


x86 assembly (clang, -O0):
<divides>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divides>:
mov    %edi,%eax
cltd
idiv   %esi
test   %eax,%eax
setg   %al
ret

LLVM IR (-O0):
define signext i8 @divides(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 = sdiv i32 %5, %6
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @divides(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
void ar2315_time_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ar2315_time_init() {
ret void
}
unsigned int strihash(const char *str) {
  unsigned int c, hash = ((unsigned int)0x811c9dc5);
  while ((c = (unsigned char)*str++)) {
    if (c >= 'a' && c <= 'z')
      c -= 'a' - 'A';
    hash = (hash * ((unsigned int)0x01000193)) ^ c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<strihash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x811c9dc5,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     115c <strihash+0x5c>
cmpl   $0x61,-0xc(%rbp)
jb     114a <strihash+0x4a>
cmpl   $0x7a,-0xc(%rbp)
ja     114a <strihash+0x4a>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
imul   $0x1000193,-0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    110f <strihash+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strihash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1133 <strihash+0x33>
add    $0x1,%rdi
mov    $0x811c9dc5,%eax
nop
movzbl %cl,%ecx
lea    -0x61(%rcx),%edx
lea    -0x20(%rcx),%esi
cmp    $0x1a,%dl
cmovae %ecx,%esi
imul   $0x1000193,%eax,%eax
xor    %esi,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strihash+0x10>
ret
mov    $0x811c9dc5,%eax
ret

LLVM IR (-O0):
define i32 @strihash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 -2128831035, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
store i32 %9, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %5
%12 = load i32, i32* %3
%13 = icmp uge i32 %12, 97
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp ule i32 %15, 122
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %3
%19 = sub i32 %18, 32
store i32 %19, i32* %3
br label %20
20: ; preds = %17, %14, %11
%21 = load i32, i32* %4
%22 = mul i32 %21, 16777619
%23 = load i32, i32* %3
%24 = xor i32 %22, %23
store i32 %24, i32* %4
br label %5
25: ; preds = %5
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @strihash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %16, %4 ], [ %2, %1 ]
%6 = phi i32 [ %15, %4 ], [ -2128831035, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add i8 %5, -97
%11 = icmp ult i8 %10, 26
%12 = add nsw i32 %8, -32
%13 = select i1 %11, i32 %12, i32 %8
%14 = mul i32 %6, 16777619
%15 = xor i32 %13, %14
%16 = load i8, i8* %9
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %4, %1
%19 = phi i32 [ -2128831035, %1 ], [ %15, %4 ]
ret i32 %19
}
/* Variables and functions */
int strtoul(char const *, char **, int);
int strtotod(const char *str) {
  char *endp;
  int result = 0;
  result = strtoul(str, &endp, 10) * 60;
  if (*endp)
    result += strtoul(endp + 1, NULL, 10);
  return result;
}


x86 assembly (clang, -O0):
<strtotod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
imul   $0x3c,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <strtotod+0x54>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtoul@plt>
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtotod>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
imul   $0x3c,%eax,%ebx
mov    0x8(%rsp),%rdi
cmpb   $0x0,(%rdi)
je     1143 <strtotod+0x33>
add    $0x1,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoul@plt>
add    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strtotod(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtoul(i8* %0, i8** %2, i32 10)
%5 = mul nsw i32 %4, 60
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = tail call i32 @strtoul(i8* nocapture %10, i8** null, i32 10)
%12 = add nsw i32 %11, %5
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ %12, %9 ], [ %5, %1 ]
ret i32 %14
}
/* Type definitions */
struct shminfo {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct shminfo info = {};
  (void)info;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.shminfo = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.shminfo
store i32 0, i32* %1
%3 = bitcast %struct.shminfo* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmgr_final();
void malloc_final(void) {
  memmgr_final();
  ;
}


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

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

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

LLVM IR (-O2):
define void @malloc_final() {
%1 = tail call i32 (...) @memmgr_final()
ret void
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONCovErrBits(const struct feature_pair *pair,
                         const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

LLVM IR (-O0):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovErrBits(%struct.feature_pair* %0, %struct.CovariateAnalysis* %1, i32* %2) {
%4 = alloca %struct.feature_pair*
%5 = alloca %struct.CovariateAnalysis*
%6 = alloca i32*
store %struct.feature_pair* %0, %struct.feature_pair** %4
store %struct.CovariateAnalysis* %1, %struct.CovariateAnalysis** %5
store i32* %2, i32** %6
ret void
}

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONCovErrBits(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xa1();
int /*<<< orphan*/ xa2();
int /*<<< orphan*/ xa3();
int xa() {
  xa1();
  xa2();
  xa3();
}


x86 assembly (clang, -O0):
<xa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <xa1@plt>
mov    $0x0,%al
call   1050 <xa2@plt>
mov    $0x0,%al
call   1040 <xa3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xa>:
push   %rax
xor    %eax,%eax
call   1030 <xa1@plt>
xor    %eax,%eax
call   1050 <xa2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <xa3@plt>

LLVM IR (-O0):
define i32 @xa() {
%1 = alloca i32
%2 = call i32 (...) @xa1()
%3 = call i32 (...) @xa2()
%4 = call i32 (...) @xa3()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @xa() {
%1 = tail call i32 (...) @xa1()
%2 = tail call i32 (...) @xa2()
%3 = tail call i32 (...) @xa3()
ret i32 undef
}
/* Variables and functions */
scalar_t__ RdRand_cpuid();
int RdRand_isSupported() {
  static int supported = -4;
  if (supported == -4) {
    if (RdRand_cpuid())
      supported = -2;
    else
      supported = -3;
  }
  return (supported == -2) ? 1 : 0;
}


x86 assembly (clang, -O0):
<RdRand_isSupported>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0xfffffffc,0x2f0d(%rip)
jne    1150 <RdRand_isSupported+0x40>
mov    $0x0,%al
call   1030 <RdRand_cpuid@plt>
cmp    $0x0,%rax
je     1141 <RdRand_isSupported+0x31>
movl   $0xfffffffe,0x2eec(%rip)
ff ff ff
jmp    114b <RdRand_isSupported+0x3b>
movl   $0xfffffffd,0x2edd(%rip)
ff ff ff
jmp    1150 <RdRand_isSupported+0x40>
mov    0x2ed2(%rip),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xfffffffe,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RdRand_isSupported>:
push   %rax
mov    0x2f11(%rip),%ecx
cmp    $0xfffffffc,%ecx
jne    1135 <RdRand_isSupported+0x25>
xor    %eax,%eax
call   1030 <RdRand_cpuid@plt>
cmp    $0x1,%rax
mov    $0xfffffffe,%ecx
sbb    $0x0,%ecx
mov    %ecx,0x2ef3(%rip)
xor    %eax,%eax
cmp    $0xfffffffe,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@RdRand_isSupported.supported = internal global i32 -4
define i32 @RdRand_isSupported() {
%1 = load i32, i32* @RdRand_isSupported.supported
%2 = icmp eq i32 %1, -4
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i64 (...) @RdRand_cpuid()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 -2, i32* @RdRand_isSupported.supported
br label %8
7: ; preds = %3
store i32 -3, i32* @RdRand_isSupported.supported
br label %8
8: ; preds = %7, %6
br label %9
9: ; preds = %8, %0
%10 = load i32, i32* @RdRand_isSupported.supported
%11 = icmp eq i32 %10, -2
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
@RdRand_isSupported.supported = internal unnamed_addr global i32 -4
define i32 @RdRand_isSupported() {
%1 = load i32, i32* @RdRand_isSupported.supported
%2 = icmp eq i32 %1, -4
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @RdRand_cpuid()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 -3, i32 -2
store i32 %6, i32* @RdRand_isSupported.supported
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ %1, %0 ], [ %6, %3 ]
%9 = icmp eq i32 %8, -2
%10 = zext i1 %9 to i32
ret i32 %10
}
int numdigit(long a) {
  int res = 1;
  while ((a /= 10) != 0)
    ++res;
  return res;
}


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

x86 assembly (clang, -O2):
<numdigit>:
lea    0x9(%rdi),%rdx
mov    $0x1,%ecx
cmp    $0x13,%rdx
jb     1152 <numdigit+0x52>
mov    %rdi,%rax
mov    $0x1,%ecx
movabs $0x6666666666666667,%rsi
66 66 66
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rsi
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x2,%rdx
lea    (%rdx,%rdi,1),%rax
add    $0x1,%ecx
add    %rdi,%rdx
add    $0x9,%rdx
cmp    $0x12,%rdx
ja     1130 <numdigit+0x30>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numdigit(i64 %0) {
%2 = add i64 %0, 9
%3 = icmp ult i64 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i64 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i64 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i64 %7, 9
%10 = icmp ult i64 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
int test_08(int a) { return (a << 1) + 1; }


x86 assembly (clang, -O0):
<test_08>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_08>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_08(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_08(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void initialize_fold(int length) {}


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

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

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

LLVM IR (-O2):
define void @initialize_fold(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ lapic_read(int);
int /*<<< orphan*/ lapic_write(int, int /*<<< orphan*/);
uint32_t lapic_errstatus(void) {
  lapic_write((0xFEE00000 + 0x280), 0);
  return lapic_read((0xFEE00000 + 0x280));
}


x86 assembly (clang, -O0):
<lapic_errstatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfee00280,%edi
xor    %esi,%esi
call   1030 <lapic_write@plt>
mov    $0xfee00280,%edi
call   1040 <lapic_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lapic_errstatus>:
push   %rax
mov    $0xfee00280,%edi
xor    %esi,%esi
call   1030 <lapic_write@plt>
mov    $0xfee00280,%edi
pop    %rax
jmp    1040 <lapic_read@plt>

LLVM IR (-O0):
define i32 @lapic_errstatus() {
%1 = call i32 @lapic_write(i32 -18873728, i32 0)
%2 = call i32 @lapic_read(i32 -18873728)
ret i32 %2
}

LLVM IR (-O2):
define i32 @lapic_errstatus() {
%1 = tail call i32 @lapic_write(i32 -18873728, i32 0)
%2 = tail call i32 @lapic_read(i32 -18873728)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int help_shut(int argc, char **argv) {
  printf("\n\033[1m%s\033[0m, shutdown the process (only in daemon mode)\n",
         argv[0]);
  return 1;
}


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

x86 assembly (clang, -O2):
<help_shut>:
push   %rax
mov    (%rsi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"\0A\1B[1m%s\1B[0m, shutdown the process (only in daemon mode)\0A\00"
define i32 @help_shut(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 1
}

LLVM IR (-O2):
@.str = [57 x i8] c"\0A\1B[1m%s\1B[0m, shutdown the process (only in daemon mode)\0A\00"
define i32 @help_shut(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < 100; i++)
    f(7, 8, argc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1157 <main+0x47>
mov    -0x8(%rbp),%edx
mov    $0x7,%edi
mov    $0x8,%esi
call   1030 <f@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x64,%ebp
nopw   0x0(%rax,%rax,1)
mov    $0x7,%edi
mov    $0x8,%esi
mov    %ebx,%edx
call   1030 <f@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @f(i32 7, i32 8, i32 %0)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 100
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
void RTSgBufInit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSgBufInit() {
ret void
}
int x34_process_request(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x34_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("cd /mnt/user/code/Buttons/bin && /mnt/user/jvm/java Main");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"cd /mnt/user/code/Buttons/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"cd /mnt/user/code/Buttons/bin && /mnt/user/jvm/java Main\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int calYear(int year1) { return (year1 + 88); }


x86 assembly (clang, -O0):
<calYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x58,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calYear>:
lea    0x58(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @calYear(i32 %0) {
%2 = add nsw i32 %0, 88
ret i32 %2
}
/* Variables and functions */
int __builtin_mips_extr_w(long long, int);
long long __builtin_mips_mult(int, int);
int silk_SMLAWW(int a, int b, int c) {
  long long ac;
  int res;
  ac = __builtin_mips_mult(b, c);
  res = __builtin_mips_extr_w(ac, 16);
  res += a;
  return res;
}


x86 assembly (clang, -O0):
<silk_SMLAWW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <__builtin_mips_mult@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x10,%esi
call   1040 <__builtin_mips_extr_w@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silk_SMLAWW>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <__builtin_mips_mult@plt>
mov    %rax,%rdi
mov    $0x10,%esi
call   1040 <__builtin_mips_extr_w@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @silk_SMLAWW(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i64 @__builtin_mips_mult(i32 %9, i32 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = call i32 @__builtin_mips_extr_w(i64 %12, i32 16)
store i32 %13, i32* %8
%14 = load i32, i32* %4
%15 = load i32, i32* %8
%16 = add nsw i32 %15, %14
store i32 %16, i32* %8
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
define i32 @silk_SMLAWW(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @__builtin_mips_mult(i32 %1, i32 %2)
%5 = tail call i32 @__builtin_mips_extr_w(i64 %4, i32 16)
%6 = add nsw i32 %5, %0
ret i32 %6
}
int test_020(int a, int b, int c, int d) { return b + b + (a & 1); }


x86 assembly (clang, -O0):
<test_020>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_020>:
and    $0x1,%edi
lea    (%rdi,%rsi,2),%eax
ret

LLVM IR (-O0):
define i32 @test_020(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = and i32 %12, 1
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_020(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %1, 1
%6 = and i32 %0, 1
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_CMPEQSP(int s1, int s2, int dst) {
  C67_asm("CMPEQSP.S1", s1, s2, dst);
}


x86 assembly (clang, -O0):
<C67_CMPEQSP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_CMPEQSP>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMPEQSP.S1\00"
define void @C67_CMPEQSP(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @C67_asm(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMPEQSP.S1\00"
define void @C67_CMPEQSP(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ kbhit();
int getnum(void) {
  while (!kbhit()) {
  }
  return getchar() - 48;
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <getnum+0x9>
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <getnum+0x25>
jmp    114a <getnum+0x2a>
jmp    1129 <getnum+0x9>
mov    $0x0,%al
call   1040 <getchar@plt>
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <kbhit@plt>
test   %eax,%eax
je     1130 <getnum+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0xffffffd0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getnum() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @kbhit()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 (...) @getchar()
%8 = sub nsw i32 %7, 48
ret i32 %8
}

LLVM IR (-O2):
define i32 @getnum() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @kbhit()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @getchar()
%6 = add nsw i32 %5, -48
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(float, float, float);
void graphic_set_color3f(float r, float g, float b) { glColor3f(r, g, b); }


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

x86 assembly (clang, -O2):
<graphic_set_color3f>:
jmp    1030 <glColor3f@plt>

LLVM IR (-O0):
define void @graphic_set_color3f(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 = load float, float* %5
%9 = load float, float* %6
%10 = call i32 @glColor3f(float %7, float %8, float %9)
ret void
}

LLVM IR (-O2):
define void @graphic_set_color3f(float %0, float %1, float %2) {
%4 = tail call i32 @glColor3f(float %0, float %1, float %2)
ret void
}
int ft_strlen(char *str) {
  int count;
  count = 0;
  while (*(str + count) != '\0') {
    count++;
  }
  return (count);
}


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

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

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
char *_my_strdup(const char *string) {
  char *temp;
  if (((void *)0) == string)
    return ((void *)0);
  temp = (char *)_my_malloc(strlen(string) + 1);
  if (((void *)0) == temp)
    return ((void *)0);
  strcpy(temp, string);
  return temp;
}


x86 assembly (clang, -O0):
<_my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1155 <_my_strdup+0x25>
movq   $0x0,-0x8(%rbp)
jmp    11a0 <_my_strdup+0x70>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <_my_malloc@plt>
cltq
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    118b <_my_strdup+0x5b>
movq   $0x0,-0x8(%rbp)
jmp    11a0 <_my_strdup+0x70>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_my_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1163 <_my_strdup+0x33>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <_my_malloc@plt>
test   %eax,%eax
je     1166 <_my_strdup+0x36>
movslq %eax,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    1166 <_my_strdup+0x36>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %23
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add i64 %10, 1
%12 = call i32 (i64, ...) bitcast (i32 (...)* @_my_malloc to i32 (i64, ...)*)(i64 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = icmp eq i8* null, %15
br i1 %16, label %17, label %18
17: ; preds = %8
store i8* null, i8** %2
br label %23
18: ; preds = %8
%19 = load i8*, i8** %4
%20 = load i8*, i8** %3
%21 = call i8* @strcpy(i8* %19, i8* %20)
%22 = load i8*, i8** %4
store i8* %22, i8** %2
br label %23
23: ; preds = %18, %17, %7
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @_my_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i32 (i64, ...) bitcast (i32 (...)* @_my_malloc to i32 (i64, ...)*)(i64 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = icmp eq i32 %6, 0
br i1 %9, label %12, label %10
10: ; preds = %3
%11 = tail call i8* @strcpy(i8* %8, i8* %0)
br label %12
12: ; preds = %3, %1, %10
%13 = phi i8* [ %8, %10 ], [ null, %1 ], [ null, %3 ]
ret i8* %13
}
/* Variables and functions */
int get_elf_class();
bool host_is_lp64(void) { return get_elf_class() == 2; }


x86 assembly (clang, -O0):
<host_is_lp64>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_elf_class@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_is_lp64>:
push   %rax
xor    %eax,%eax
call   1030 <get_elf_class@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @host_is_lp64() {
%1 = call i32 (...) @get_elf_class()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @host_is_lp64() {
%1 = tail call i32 (...) @get_elf_class()
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smeanors(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smeanors(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1030 <stdlib_strided_smeanors@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_smeanors@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smeanors(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smeanors(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int i8k_get_fan_speed(int);
int /*<<< orphan*/ printf(char *, int, int);
int fan_speed(int argc, char **argv) {
  int left, right;
  left = i8k_get_fan_speed(1);
  right = i8k_get_fan_speed(0);
  printf("%d %d\n", left, right);
  return 0;
}


x86 assembly (clang, -O0):
<fan_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <i8k_get_fan_speed@plt>
mov    %eax,-0x14(%rbp)
xor    %edi,%edi
call   1040 <i8k_get_fan_speed@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fan_speed>:
push   %rbx
mov    $0x1,%edi
call   1040 <i8k_get_fan_speed@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <i8k_get_fan_speed@plt>
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @fan_speed(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @i8k_get_fan_speed(i32 1)
%4 = tail call i32 @i8k_get_fan_speed(i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vprintf(const char *fmt, va_list ap) { return vfprintf(stdout, fmt, ap); }


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @vprintf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
bool wtrie_valid_char(unsigned char c) { return (32 <= c && c <= 127); }


x86 assembly (clang, -O0):
<wtrie_valid_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x20,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <wtrie_valid_char+0x2d>
movzbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtrie_valid_char>:
xor    %eax,%eax
cmp    $0x20,%dil
setge  %al
ret

LLVM IR (-O0):
define i32 @wtrie_valid_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 32, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 127
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @wtrie_valid_char(i8 zeroext %0) {
%2 = icmp sgt i8 %0, 31
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
size_t write(int /*<<< orphan*/, char *, int);
void CON_Back(void) {
  char key;
  size_t __attribute__((unused)) size;
  key = '\b';
  size = write(STDOUT_FILENO, &key, 1);
  key = ' ';
  size = write(STDOUT_FILENO, &key, 1);
  key = '\b';
  size = write(STDOUT_FILENO, &key, 1);
}


x86 assembly (clang, -O0):
<CON_Back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x8,-0x1(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rax,-0x10(%rbp)
movb   $0x20,-0x1(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rax,-0x10(%rbp)
movb   $0x8,-0x1(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CON_Back>:
push   %r14
push   %rbx
push   %rax
movb   $0x8,0x7(%rsp)
mov    0x2ed0(%rip),%r14
mov    (%r14),%edi
lea    0x7(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movb   $0x20,0x7(%rsp)
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movb   $0x8,0x7(%rsp)
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @CON_Back() {
%1 = alloca i8
%2 = alloca i64
store i8 8, i8* %1
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i64 @write(i32 %3, i8* %1, i32 1)
store i64 %4, i64* %2
store i8 32, i8* %1
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i64 @write(i32 %5, i8* %1, i32 1)
store i64 %6, i64* %2
store i8 8, i8* %1
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i64 @write(i32 %7, i8* %1, i32 1)
store i64 %8, i64* %2
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @CON_Back() {
%1 = alloca i8
store i8 8, i8* %1
%2 = load i32, i32* @STDOUT_FILENO
%3 = call i64 @write(i32 %2, i8* %1, i32 1)
store i8 32, i8* %1
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i64 @write(i32 %4, i8* %1, i32 1)
store i8 8, i8* %1
%6 = load i32, i32* @STDOUT_FILENO
%7 = call i64 @write(i32 %6, i8* %1, i32 1)
ret void
}
/* Type definitions */
struct string {
  int dummy;
};
struct dict {
  int dummy;
};

/* Variables and functions */
int expand_macros_impl(struct string const *, struct dict *, struct string *,
                       int /*<<< orphan*/);
int expand_macros(const struct string *line, struct dict *macros,
                  struct string *output) {
  return (expand_macros_impl(line, macros, output, 0));
}


x86 assembly (clang, -O0):
<expand_macros>:
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
xor    %ecx,%ecx
call   1030 <expand_macros_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_macros>:
xor    %ecx,%ecx
jmp    1030 <expand_macros_impl@plt>

LLVM IR (-O0):
%struct.dict = type { i32 }
%struct.string = type { i32 }
define i32 @expand_macros(%struct.string* %0, %struct.dict* %1, %struct.string* %2) {
%4 = alloca %struct.string*
%5 = alloca %struct.dict*
%6 = alloca %struct.string*
store %struct.string* %0, %struct.string** %4
store %struct.dict* %1, %struct.dict** %5
store %struct.string* %2, %struct.string** %6
%7 = load %struct.string*, %struct.string** %4
%8 = load %struct.dict*, %struct.dict** %5
%9 = load %struct.string*, %struct.string** %6
%10 = call i32 @expand_macros_impl(%struct.string* %7, %struct.dict* %8, %struct.string* %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.dict = type { i32 }
%struct.string = type { i32 }
define i32 @expand_macros(%struct.string* %0, %struct.dict* %1, %struct.string* %2) {
%4 = tail call i32 @expand_macros_impl(%struct.string* %0, %struct.dict* %1, %struct.string* %2, i32 0)
ret i32 %4
}
void kvm_pmu_sync_hwstate(struct kvm_vcpu *vcpu) {}


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

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

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

LLVM IR (-O2):
%struct.kvm_vcpu = type opaque
define void @kvm_pmu_sync_hwstate(%struct.kvm_vcpu* nocapture %0) {
ret void
}
void exchange(int i, int j, int index[]) {
  int tmpi;
  tmpi = index[i];
  index[i] = index[j];
  index[j] = tmpi;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
movslq %edi,%rax
mov    (%rdx,%rax,4),%ecx
movslq %esi,%rsi
mov    (%rdx,%rsi,4),%edi
mov    %edi,(%rdx,%rax,4)
mov    %ecx,(%rdx,%rsi,4)
ret

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

LLVM IR (-O2):
define void @exchange(i32 %0, i32 %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}