xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int fstatat(int /*<<< orphan*/, char const *, struct stat *,
            int /*<<< orphan*/);
int stat(const char *restrict path, struct stat *restrict result) {
  return fstatat(AT_FDCWD, path, result, 0);
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <fstatat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
jmp    1030 <fstatat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@AT_FDCWD = global i32 0
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @fstatat(i32 %3, i8* %0, %struct.stat* %1, i32 0)
ret i32 %4
}
int main() {
  struct a {
    int x;
    int y;
    char z;
  };
  struct a k;
  k.z = 'q';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x71,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int afunc(int x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i32 @afunc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void XkbIgnoreExtension() {}


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

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

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

LLVM IR (-O2):
define void @XkbIgnoreExtension() {
ret void
}
/* Variables and functions */
bool dmc_unrar_bs_is_little_endian(void) {
  int n = 1;
  return (*(char *)&n) == 1;
}


x86 assembly (clang, -O0):
<dmc_unrar_bs_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dmc_unrar_bs_is_little_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @dmc_unrar_bs_is_little_endian() {
ret i32 1
}
/* Variables and functions */
int abs(int);
int ValuesShouldBeCollapsedToStrideAverage(int a, int b) {
  return abs(a - b) < 4;
}


x86 assembly (clang, -O0):
<ValuesShouldBeCollapsedToStrideAverage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x4,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValuesShouldBeCollapsedToStrideAverage>:
sub    %esi,%edi
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @ValuesShouldBeCollapsedToStrideAverage(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 = sub nsw i32 %5, %6
%8 = call i32 @abs(i32 %7)
%9 = icmp slt i32 %8, 4
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ValuesShouldBeCollapsedToStrideAverage(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @llvm.abs.i32(i32 %3, i1 true)
%5 = icmp ult i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int comparef2(long const, long const);
int __gesf2(float a, float b) {
  return comparef2((*(const long *)&a), (*(const long *)&b));
}


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

x86 assembly (clang, -O2):
<__gesf2>:
movss  %xmm0,-0x8(%rsp)
movss  %xmm1,-0x10(%rsp)
mov    -0x8(%rsp),%rdi
mov    -0x10(%rsp),%rsi
jmp    1030 <comparef2@plt>

LLVM IR (-O0):
define i32 @__gesf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = call i32 @comparef2(i64 %6, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__gesf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = tail call i32 @comparef2(i64 %6, i64 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char *);
char *xstrdup(char *str) {
  char *buf;
  buf = strdup(str);
  if (buf == NULL) {
    fprintf(stderr, "It is not enough memory\n");
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xstrdup+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <xstrdup+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"It is not enough memory\0A\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"It is not enough memory\0A\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int ib_dereg_mr(struct ib_mr *mr) {
  struct ib_pd *pd;
  int ret;
  unsigned int __cil_tmp4;
  unsigned int __cil_tmp5;
  struct ib_pd **mem_6;
  {
    ret = 0;
    __cil_tmp4 = (unsigned int)mr;
    __cil_tmp5 = __cil_tmp4 + 4;
    mem_6 = (struct ib_pd **)__cil_tmp5;
    pd = *mem_6;
    return (ret);
  }
}


x86 assembly (clang, -O0):
<ib_dereg_mr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ib_mr = type opaque
%struct.ib_pd = type opaque
define i32 @ib_dereg_mr(%struct.ib_mr* %0) {
%2 = alloca %struct.ib_mr*
%3 = alloca %struct.ib_pd*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.ib_pd**
store %struct.ib_mr* %0, %struct.ib_mr** %2
store i32 0, i32* %4
%8 = load %struct.ib_mr*, %struct.ib_mr** %2
%9 = ptrtoint %struct.ib_mr* %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = add i32 %10, 4
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to %struct.ib_pd**
store %struct.ib_pd** %14, %struct.ib_pd*** %7
%15 = load %struct.ib_pd**, %struct.ib_pd*** %7
%16 = load %struct.ib_pd*, %struct.ib_pd** %15
store %struct.ib_pd* %16, %struct.ib_pd** %3
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
%struct.ib_mr = type opaque
%struct.ib_pd = type opaque
define i32 @ib_dereg_mr(%struct.ib_mr* nocapture readnone %0) {
ret i32 0
}
void main(void) {
  ser_print("hello from C kernel\n\0");
  do {
    asm("hlt");
  } while (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <ser_print@plt>
hlt
mov    $0x1,%al
test   $0x1,%al
jne    1122 <main+0x12>
jmp    1132 <main+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <ser_print@plt>
nop
hlt
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [22 x i8] c"hello from C kernel\0A\00\00"
define void @main() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @ser_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %3, %0
br label %3
3: ; preds = %2
br i1 true, label %2, label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"hello from C kernel\0A\00\00"
define void @main() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ser_print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %2
}
char *f2(int x) {
  char *p = (char *)__builtin_calloc(64, 1);
  p[x] = 3;
  return p;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x40,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x3,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %edi,%ebx
mov    $0x40,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
movslq %ebx,%rcx
movb   $0x3,(%rax,%rcx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @f2(i32 %0) {
%2 = tail call dereferenceable_or_null(64) i8* @calloc(i64 64, i64 1)
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i8, i8* %2, i64 %3
store i8 3, i8* %4
ret i8* %2
}
/* Variables and functions */
scalar_t__ is_transmit_empty();
int /*<<< orphan*/ outb(int, char);
void serial_writechar(char a) {
  while (is_transmit_empty() == 0)
    ;
  outb(0x3f8, a);
}


x86 assembly (clang, -O0):
<serial_writechar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <is_transmit_empty@plt>
cmp    $0x0,%rax
jne    1144 <serial_writechar+0x24>
jmp    112e <serial_writechar+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_writechar>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <is_transmit_empty@plt>
test   %rax,%rax
je     1130 <serial_writechar+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_writechar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 (...) @is_transmit_empty()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outb(i32 1016, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @serial_writechar(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @is_transmit_empty()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outb(i32 1016, i8 signext %0)
ret void
}
long double __attribute__((no)) fcmovnbe(long flags) {
  long double out;
  asm("\n"
      "	push	%1"
      "\n"
      "	popf"
      "\n"
      "	fldpi"
      "\n"
      "	fld1"
      "\n"
      "	"
      "fcmovnbe"
      " %%st(1), %%st"
      "\n"
      "	ffree	%%st(1)"
      "\n"
      : "=t"(out)
      : "r"(flags));
  return out;
}


x86 assembly (clang, -O0):
<fcmovnbe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
push   %rax
popf
fldpi
fld1
fcmovnbe %st(1),%st
ffree  %st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmovnbe>:
push   %rdi
popf
fldpi
fld1
fcmovnbe %st(1),%st
ffree  %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fcmovnbe(i64 %0) {
%2 = alloca i64
%3 = alloca x86_fp80
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovnbe %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @fcmovnbe(i64 %0) {
%2 = tail call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovnbe %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret x86_fp80 %2
}
void glTexParameteriv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexParameteriv() {
ret void
}
char *lisys_utf8_get_next(const char *self) {
  for (self++; (*self & 0xC0) == 0x80; self++)
    ;
  return (char *)self;
}


x86 assembly (clang, -O0):
<lisys_utf8_get_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    1141 <lisys_utf8_get_next+0x41>
jmp    1130 <lisys_utf8_get_next+0x30>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <lisys_utf8_get_next+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lisys_utf8_get_next>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
and    $0xc0,%cl
cmp    $0x80,%cl
je     1110 <lisys_utf8_get_next+0x10>
ret

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

LLVM IR (-O2):
define i8* @lisys_utf8_get_next(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = and i8 %5, -64
%7 = icmp eq i8 %6, -128
br i1 %7, label %2, label %8
8: ; preds = %2
ret i8* %4
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ select_cmos_register(char);
unsigned char get_cmos_register(char no) {
  select_cmos_register(no);
  return inb(0x71);
}


x86 assembly (clang, -O0):
<get_cmos_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <select_cmos_register@plt>
mov    $0x71,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cmos_register>:
push   %rax
call   1030 <select_cmos_register@plt>
mov    $0x71,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @get_cmos_register(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @select_cmos_register(i8 signext %3)
%5 = call zeroext i8 @inb(i32 113)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @get_cmos_register(i8 signext %0) {
%2 = tail call i32 @select_cmos_register(i8 signext %0)
%3 = tail call zeroext i8 @inb(i32 113)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void FanChannelEnable(unsigned long ulBase, unsigned long ulChannel) {
  DEBUG_ASSERT(ulBase == 0x40084000);
  DEBUG_ASSERT(ulChannel < 6);
  (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 1 << ulChannel;
}


x86 assembly (clang, -O0):
<FanChannelEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40084000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x6,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40084000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x6,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
or     %rax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @FanChannelEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074282496
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = shl i32 1, %14
%16 = sext i32 %15 to i64
%17 = load i64, i64* %3
%18 = add i64 %17, 4
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = or i64 %20, %16
store volatile i64 %21, i64* %19
ret void
}

LLVM IR (-O2):
define void @FanChannelEnable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074282496
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 6
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = trunc i64 %1 to i32
%10 = shl nuw i32 1, %9
%11 = sext i32 %10 to i64
%12 = add i64 %0, 4
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, %11
store volatile i64 %15, i64* %13
ret void
}
void img_ir_remove_raw(struct img_ir_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.img_ir_priv = type opaque
define void @img_ir_remove_raw(%struct.img_ir_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char *);
char *conf_get_str(char *, char *);
int conf_get_num(char *section, char *tag, int def) {
  char *value = conf_get_str(section, tag);
  if (value)
    return atoi(value);
  return def;
}


x86 assembly (clang, -O0):
<conf_get_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <conf_get_str@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <conf_get_num+0x40>
mov    -0x28(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <conf_get_num+0x46>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_get_num>:
push   %rbx
mov    %edx,%ebx
call   1030 <conf_get_str@plt>
test   %rax,%rax
je     1136 <conf_get_num+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @conf_get_num(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @conf_get_str(i8* %0, i8* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %2, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char *);
int is_test_dev(const char *dev) { return (!strcasecmp(dev, "test:")); }


x86 assembly (clang, -O0):
<is_test_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_test_dev>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"test:\00"
define i32 @is_test_dev(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"test:\00"
define i32 @is_test_dev(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GetLastSystemError();
char const *GetSystemErrorDescription(int /*<<< orphan*/);
const char *GetLastSystemErrorDescription() {
  return GetSystemErrorDescription(GetLastSystemError());
}


x86 assembly (clang, -O0):
<GetLastSystemErrorDescription>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GetLastSystemError@plt>
mov    %eax,%edi
call   1030 <GetSystemErrorDescription@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLastSystemErrorDescription>:
push   %rax
xor    %eax,%eax
call   1040 <GetLastSystemError@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <GetSystemErrorDescription@plt>

LLVM IR (-O0):
define i8* @GetLastSystemErrorDescription() {
%1 = call i32 (...) @GetLastSystemError()
%2 = call i8* @GetSystemErrorDescription(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
define i8* @GetLastSystemErrorDescription() {
%1 = tail call i32 (...) @GetLastSystemError()
%2 = tail call i8* @GetSystemErrorDescription(i32 %1)
ret i8* %2
}
/* Variables and functions */
int __builtin_arm_crc32ch(int, short);
int crc32ch(int a, short b) { return __builtin_arm_crc32ch(a, b); }


x86 assembly (clang, -O0):
<crc32ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
movswl -0x6(%rbp),%esi
call   1030 <__builtin_arm_crc32ch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32ch>:
jmp    1030 <__builtin_arm_crc32ch@plt>

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

LLVM IR (-O2):
define i32 @crc32ch(i32 %0, i16 signext %1) {
%3 = tail call i32 @__builtin_arm_crc32ch(i32 %0, i16 signext %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int link(char *, char *);
int /*<<< orphan*/ report_test(int, int /*<<< orphan*/, int /*<<< orphan*/,
                               char *);
void link_empty1(void) {
  int rv;
  rv = link("", "badcalldir");
  report_test(rv, errno, EINVAL, "hard link of empty string");
}


x86 assembly (clang, -O0):
<link_empty1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xef5(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <link@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rcx
call   1030 <report_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link_empty1>:
push   %rax
lea    0xefc(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <link@plt>
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    0x2e94(%rip),%rcx
mov    (%rcx),%edx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
pop    %rax
jmp    1030 <report_test@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [11 x i8] c"badcalldir\00"
@errno = global i32 0
@EINVAL = global i32 0
@.str.2 = [26 x i8] c"hard link of empty string\00"
define void @link_empty1() {
%1 = alloca i32
%2 = call i32 @link(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @errno
%5 = load i32, i32* @EINVAL
%6 = call i32 @report_test(i32 %3, i32 %4, i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [11 x i8] c"badcalldir\00"
@errno = global i32 0
@EINVAL = global i32 0
@.str.2 = [26 x i8] c"hard link of empty string\00"
define void @link_empty1() {
%1 = tail call i32 @link(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = load i32, i32* @EINVAL
%4 = tail call i32 @report_test(i32 %1, i32 %2, i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void bar(unsigned long *r) {
  unsigned long t;
  __asm__("movq $42, %[t]\n\t"
          "movq %[t], %[r]\n\t"
          : [t] "=&r"(t), [r] "=r"(*r));
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2a,%rdx
mov    %rdx,%rcx
mov    %rdx,-0x10(%rbp)
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x2a,%rax
mov    %rax,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define void @bar(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = call { i64, i64 } asm "movq $$42, $0\0A\09movq $0, $1\0A\09", "=&r,=r,~{dirflag},~{fpsr},~{flags}"()
%6 = extractvalue { i64, i64 } %5, 0
%7 = extractvalue { i64, i64 } %5, 1
store i64 %6, i64* %3
store i64 %7, i64* %4
ret void
}

LLVM IR (-O2):
define void @bar(i64* nocapture writeonly %0) {
%2 = tail call { i64, i64 } asm "movq $$42, $0\0A\09movq $0, $1\0A\09", "=&r,=r,~{dirflag},~{fpsr},~{flags}"()
%3 = extractvalue { i64, i64 } %2, 1
store i64 %3, i64* %0
ret void
}
int do_nothing3(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @do_nothing3(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ enable_exceptions_();
void enable_exceptions__() { enable_exceptions_(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ doubletimeval(double, struct timeval *);
double stddev(int /*<<< orphan*/, double, int);
int /*<<< orphan*/ timevaldouble(struct timeval *);
void stddevtime(struct timeval *SumTime, double SumSquareTime, int NumTimes,
                struct timeval *StdDevTime) {
  double result;
  result = stddev(timevaldouble(SumTime), SumSquareTime, NumTimes);
  doubletimeval(result, StdDevTime);
}


x86 assembly (clang, -O0):
<stddevtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <timevaldouble@plt>
mov    %eax,%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%esi
call   1050 <stddev@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1040 <doubletimeval@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stddevtime>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
movsd  %xmm0,(%rsp)
call   1030 <timevaldouble@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
mov    %ebp,%esi
call   1050 <stddev@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <doubletimeval@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @stddevtime(%struct.timeval* %0, double %1, i32 %2, %struct.timeval* %3) {
%5 = alloca %struct.timeval*
%6 = alloca double
%7 = alloca i32
%8 = alloca %struct.timeval*
%9 = alloca double
store %struct.timeval* %0, %struct.timeval** %5
store double %1, double* %6
store i32 %2, i32* %7
store %struct.timeval* %3, %struct.timeval** %8
%10 = load %struct.timeval*, %struct.timeval** %5
%11 = call i32 @timevaldouble(%struct.timeval* %10)
%12 = load double, double* %6
%13 = load i32, i32* %7
%14 = call double @stddev(i32 %11, double %12, i32 %13)
store double %14, double* %9
%15 = load double, double* %9
%16 = load %struct.timeval*, %struct.timeval** %8
%17 = call i32 @doubletimeval(double %15, %struct.timeval* %16)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @stddevtime(%struct.timeval* %0, double %1, i32 %2, %struct.timeval* %3) {
%5 = tail call i32 @timevaldouble(%struct.timeval* %0)
%6 = tail call double @stddev(i32 %5, double %1, i32 %2)
%7 = tail call i32 @doubletimeval(double %6, %struct.timeval* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void wait_forever(void) {
  do {
    sleep(100);
  } while (1);
}


x86 assembly (clang, -O0):
<wait_forever>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_forever+0x9>
mov    $0x64,%edi
call   1030 <sleep@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1119 <wait_forever+0x9>
jmp    1132 <wait_forever+0x22>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_forever>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <sleep@plt>
jmp    1120 <wait_forever+0x10>

LLVM IR (-O0):
define void @wait_forever() {
br label %1
1: ; preds = %3, %0
%2 = call i32 @sleep(i32 100)
br label %3
3: ; preds = %1
br i1 true, label %1, label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @wait_forever() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sleep(i32 100)
br label %1
}
double calc_bar(double const x) { return x * 47; }


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

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

LLVM IR (-O0):
define double @calc_bar(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 4.700000e+01
ret double %4
}

LLVM IR (-O2):
define double @calc_bar(double %0) {
%2 = fmul double %0, 4.700000e+01
ret double %2
}
/* Variables and functions */
scalar_t__ scalbn(double, int);
long double scalbnl(long double x, int exp) {
  return (long double)scalbn((double)x, exp);
}


x86 assembly (clang, -O0):
<scalbnl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %edi,-0x14(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <scalbn@plt>
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalbnl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <scalbn@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @scalbnl(x86_fp80 %0, i32 %1) {
%3 = alloca x86_fp80
%4 = alloca i32
store x86_fp80 %0, x86_fp80* %3
store i32 %1, i32* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load i32, i32* %4
%8 = call i64 @scalbn(double %6, i32 %7)
%9 = sitofp i64 %8 to x86_fp80
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @scalbnl(x86_fp80 %0, i32 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = tail call i64 @scalbn(double %3, i32 %1)
%5 = sitofp i64 %4 to x86_fp80
ret x86_fp80 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
unsigned int UCHAR_MAX;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
unsigned time_seed(void) {
  time_t timeval;
  unsigned char *ptr;
  unsigned seed;
  size_t i;
  timeval = time(NULL);
  ptr = (unsigned char *)&timeval;
  seed = 0;
  for (i = 0; i < sizeof timeval; i++)
    seed = seed * (UCHAR_MAX + 2u) + ptr[i];
  return seed;
}


x86 assembly (clang, -O0):
<time_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x4,-0x20(%rbp)
jae    117a <time_seed+0x6a>
mov    -0x14(%rbp),%eax
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113b <time_seed+0x2b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_seed>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ecx
movzbl %al,%edx
movzbl %ah,%esi
shr    $0x10,%eax
shr    $0x18,%ecx
mov    0x2ec3(%rip),%rdi
mov    (%rdi),%edi
add    $0x2,%edi
imul   %edi,%edx
add    %edx,%esi
imul   %edi,%esi
movzbl %al,%eax
add    %esi,%eax
imul   %edi,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UCHAR_MAX = global i32 0
define i32 @time_seed() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = bitcast i32* %1 to i8*
store i8* %6, i8** %2
store i32 0, i32* %3
store i64 0, i64* %4
br label %7
7: ; preds = %21, %0
%8 = load i64, i64* %4
%9 = icmp ult i64 %8, 4
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* @UCHAR_MAX
%13 = add i32 %12, 2
%14 = mul i32 %11, %13
%15 = load i8*, i8** %2
%16 = load i64, i64* %4
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = add i32 %14, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %10
%22 = load i64, i64* %4
%23 = add i64 %22, 1
store i64 %23, i64* %4
br label %7
24: ; preds = %7
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@UCHAR_MAX = global i32 0
define i32 @time_seed() {
%1 = tail call i32 @time(i32* null)
%2 = lshr i32 %1, 8
%3 = lshr i32 %1, 16
%4 = lshr i32 %1, 24
%5 = load i32, i32* @UCHAR_MAX
%6 = add i32 %5, 2
%7 = and i32 %1, 255
%8 = mul i32 %6, %7
%9 = and i32 %2, 255
%10 = add i32 %8, %9
%11 = mul i32 %6, %10
%12 = and i32 %3, 255
%13 = add i32 %11, %12
%14 = mul i32 %6, %13
%15 = add i32 %14, %4
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ wctrans_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int /*<<< orphan*/ wctrans(char const *);
wctrans_t __wctrans_l(const char *s, locale_t l) { return wctrans(s); }


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

x86 assembly (clang, -O2):
<__wctrans_l>:
jmp    1030 <wctrans@plt>

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

LLVM IR (-O2):
define i32 @__wctrans_l(i8* %0, i32 %1) {
%3 = tail call i32 @wctrans(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cubeByReference(int *);
int /*<<< orphan*/ cubeByValue(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 10;
  printf("The original value of n is %d\n", n);
  cubeByValue(n);
  printf("The value of n after call-by-value is %d\n\n", n);
  cubeByReference(&n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <cubeByValue@plt>
mov    -0x4(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <cubeByReference@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xec0(%rip),%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <cubeByValue@plt>
lea    0xec4(%rip),%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <cubeByReference@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"The original value of n is %d\0A\00"
@.str.1 = [43 x i8] c"The value of n after call-by-value is %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @cubeByValue(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @cubeByReference(i32* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"The original value of n is %d\0A\00"
@.str.1 = [43 x i8] c"The value of n after call-by-value is %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 @cubeByValue(i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 10)
%6 = call i32 @cubeByReference(i32* %1)
ret i32 0
}
void ztrace_flush() {}


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

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

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

LLVM IR (-O2):
define void @ztrace_flush() {
ret void
}
/* Variables and functions */
double cos(double);
double calc_cos_TrueAnom(double EccAnom, double ecc) {
  return (cos(EccAnom) - ecc) / (1. - ecc * cos(EccAnom));
}


x86 assembly (clang, -O0):
<calc_cos_TrueAnom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe86(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_cos_TrueAnom>:
sub    $0x18,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <cos@plt>
subsd  (%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  0xeb9(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calc_cos_TrueAnom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @cos(double %5)
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = load double, double* %4
%10 = load double, double* %3
%11 = call double @cos(double %10)
%12 = fneg double %9
%13 = call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = fdiv double %8, %13
ret double %14
}

LLVM IR (-O2):
define double @calc_cos_TrueAnom(double %0, double %1) {
%3 = tail call double @cos(double %0)
%4 = fsub double %3, %1
%5 = tail call double @cos(double %0)
%6 = fneg double %1
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = fdiv double %4, %7
ret double %8
}
int main() {
  int offset, length, nlen;
  int i, j;
  for (i = 0; i < nlen; i++) {
    for (j = 0; j < 8; j++) {
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1155 <main+0x55>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    1142 <main+0x42>
jmp    1134 <main+0x34>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1125 <main+0x25>
jmp    1147 <main+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double strtod(char *, int /*<<< orphan*/ *);
double nan() { return strtod("nan", NULL); }


x86 assembly (clang, -O0):
<nan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nan>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"nan\00"
define double @nan(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call double @strtod(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null)
ret double %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"nan\00"
define double @nan(i8* nocapture readnone %0) {
%2 = tail call double @strtod(i8* nocapture getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* null)
ret double %2
}
int heap_maximum(int a[]) { return a[0]; }


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

x86 assembly (clang, -O2):
<heap_maximum>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @heap_maximum(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void modifystr(char *s) {
  int i = 0;
  printf("Modify String and Send back to caller\n ");
  printf("String passed --- %s \n", s);
  while (*s) {
    s++;
  }
}


x86 assembly (clang, -O0):
<modifystr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <modifystr+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <modifystr+0x33>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modifystr>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Modify String and Send back to caller\0A \00"
@.str.1 = [23 x i8] c"String passed --- %s \0A\00"
define void @modifystr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %11, %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Modify String and Send back to caller\0A \00"
@.str.1 = [23 x i8] c"String passed --- %s \0A\00"
define void @modifystr(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}