xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
scalar_t__ O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int const);
void make_blocking(int fd) {
  const int old = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, old & ~(int)O_NONBLOCK);
}


x86 assembly (clang, -O0):
<make_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
xor    $0xffffffff,%eax
and    %eax,%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%edx
not    %edx
and    %eax,%edx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i64 0
define void @make_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i64, i64* @O_NONBLOCK
%11 = trunc i64 %10 to i32
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
%14 = call i32 @fcntl(i32 %7, i32 %8, i32 %13)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i64 0
define void @make_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i64, i64* @O_NONBLOCK
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, -1
%8 = and i32 %3, %7
%9 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eset(int);
int tcFgets(char *, int, int);
int Mfgets(int nargs, int *args) {
  if (nargs < 3) {
    eset(21);
    return -1;
  }
  char *buff = (char *)args[0];
  int len = args[1];
  int unit = args[2];
  return tcFgets(buff, len, unit);
}


x86 assembly (clang, -O0):
<Mfgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114f <Mfgets+0x2f>
mov    $0x15,%edi
call   1030 <eset@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <Mfgets+0x60>
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <tcFgets@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mfgets>:
push   %rax
cmp    $0x2,%edi
jg     1137 <Mfgets+0x17>
mov    $0x15,%edi
call   1030 <eset@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
movslq (%rsi),%rdi
mov    0x4(%rsi),%eax
mov    0x8(%rsi),%edx
mov    %eax,%esi
pop    %rax
jmp    1040 <tcFgets@plt>

LLVM IR (-O0):
define i32 @Mfgets(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @eset(i32 21)
store i32 -1, i32* %3
br label %29
13: ; preds = %2
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %6
%19 = load i32*, i32** %5
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = load i32, i32* %20
store i32 %21, i32* %7
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i64 2
%24 = load i32, i32* %23
store i32 %24, i32* %8
%25 = load i8*, i8** %6
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = call i32 @tcFgets(i8* %25, i32 %26, i32 %27)
store i32 %28, i32* %3
br label %29
29: ; preds = %13, %11
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @Mfgets(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @eset(i32 21)
br label %15
6: ; preds = %2
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %1, i64 2
%13 = load i32, i32* %12
%14 = tail call i32 @tcFgets(i8* %9, i32 %11, i32 %13)
br label %15
15: ; preds = %6, %4
%16 = phi i32 [ -1, %4 ], [ %14, %6 ]
ret i32 %16
}
void g() {
  static char a[10];
  static char *b = a;
}


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

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

LLVM IR (-O0):
@g.a = internal global [10 x i8] zeroinitializer
@g.b = internal global i8* getelementptr inbounds ([10 x i8], [10 x i8]* @g.a, i32 0, i32 0)
define void @g() {
ret void
}

LLVM IR (-O2):
define void @g() {
ret void
}
void change_bit(int nr, unsigned long *addr) { *addr ^= (1 << (nr)); }


x86 assembly (clang, -O0):
<change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
xor    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = shl i32 1, %5
%7 = sext i32 %6 to i64
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = xor i64 %9, %7
store i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @change_bit(i32 %0, i64* nocapture %1) {
%3 = shl nuw i32 1, %0
%4 = sext i32 %3 to i64
%5 = load i64, i64* %1
%6 = xor i64 %5, %4
store i64 %6, i64* %1
ret void
}
int main(int argc, char *argv[]) {
  long max = atoi(argv[1]);
  int number;
  unsigned position;
  volatile unsigned result;
  for (number = 1; number <= max; number++) {
    __asm__("bsrl %1, %0" : "=r"(position) : "r"(number));
    result = position;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <atoi@plt>
cltq
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     116d <main+0x5d>
mov    -0x1c(%rbp),%eax
bsr    %eax,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <main+0x32>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1030 <atoi@plt>
test   %eax,%eax
jle    1140 <main+0x30>
mov    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rcx
bsr    %ecx,%edx
mov    %edx,0x4(%rsp)
cmp    %rcx,%rax
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %12)
%14 = sext i32 %13 to i64
store i64 %14, i64* %6
store i32 1, i32* %7
br label %15
15: ; preds = %24, %2
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = load i64, i64* %6
%19 = icmp sle i64 %17, %18
br i1 %19, label %20, label %27
20: ; preds = %15
%21 = load i32, i32* %7
%22 = call i32 asm "bsrl $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %21)
store i32 %22, i32* %8
%23 = load i32, i32* %8
store volatile i32 %23, i32* %9
br label %24
24: ; preds = %20
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %15
27: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %5)
%7 = bitcast i32* %3 to i8*
%8 = icmp slt i32 %6, 1
br i1 %8, label %17, label %9
9: ; preds = %2
%10 = zext i32 %6 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 1, %9 ], [ %15, %11 ]
%13 = trunc i64 %12 to i32
%14 = tail call i32 asm "bsrl $1, $0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %13)
store volatile i32 %14, i32* %3
%15 = add nuw nsw i64 %12, 1
%16 = icmp eq i64 %12, %10
br i1 %16, label %17, label %11
17: ; preds = %11, %2
ret i32 0
}
int test_imm_B1int16_mem(short *val) {
  return ((*val) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B1int16_mem>:
testb  $0xb1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 177
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *utoa2(unsigned long i, char *buf) {
  if (i < 10)
    *buf = i + '0';
  else {
    buf = utoa2(i / 10, buf);
    *buf = (i % 10) + '0';
  }
  *++buf = 0;
  return buf;
}


x86 assembly (clang, -O0):
<utoa2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xa,-0x8(%rbp)
jae    1140 <utoa2+0x30>
mov    -0x8(%rbp),%rax
add    $0x30,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1178 <utoa2+0x68>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <utoa2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
add    $0x30,%rdx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utoa2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmp    $0x9,%rdi
ja     1122 <utoa2+0x12>
add    $0x30,%bl
jmp    1150 <utoa2+0x40>
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rbx,%rax
mul    %rcx
mov    %rdx,%r14
shr    $0x3,%r14
mov    %r14,%rdi
call   1030 <utoa2@plt>
mov    %rax,%rsi
add    %r14d,%r14d
lea    (%r14,%r14,4),%eax
sub    %eax,%ebx
or     $0x30,%bl
mov    %bl,(%rsi)
movb   $0x0,0x1(%rsi)
add    $0x1,%rsi
mov    %rsi,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @utoa2(i64 %0, i8* %1) {
%3 = icmp ult i64 %0, 10
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = trunc i64 %0 to i8
%6 = add nuw nsw i8 %5, 48
store i8 %6, i8* %1
br label %13
7: ; preds = %2
%8 = udiv i64 %0, 10
%9 = tail call i8* @utoa2(i64 %8, i8* %1)
%10 = urem i64 %0, 10
%11 = trunc i64 %10 to i8
%12 = or i8 %11, 48
store i8 %12, i8* %9
br label %13
13: ; preds = %7, %4
%14 = phi i8* [ %1, %4 ], [ %9, %7 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 0, i8* %15
ret i8* %15
}
int id2(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<id2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @id2(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @id2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double nondet_double();
int main() {
  int a;
  double b = nondet_double();
  a = (int)b;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = call double (...) @nondet_double()
store double %3, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @nondet_double()
ret i32 0
}
int is_comment_start(char c) { return (c == ';') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_comment_start>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x3b,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_comment_start>:
xor    %eax,%eax
cmp    $0x3b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_comment_start(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 59
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_comment_start(i8 signext %0) {
%2 = icmp eq i8 %0, 59
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printTriangle(int);
int main() {
  printTriangle(6);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
call   1030 <printTriangle@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printTriangle(i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void invalid_conf_data(char *op) {
  fprintf(stderr, "Invalid config data for option: %s\n", op);
}


x86 assembly (clang, -O0):
<invalid_conf_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_conf_data>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Invalid config data for option: %s\0A\00"
define void @invalid_conf_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Invalid config data for option: %s\0A\00"
define void @invalid_conf_data(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double pow(double, double);
double xypow(double x) { return pow(x, x); }


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

x86 assembly (clang, -O2):
<xypow>:
movaps %xmm0,%xmm1
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @xypow(double %0) {
%2 = tail call double @pow(double %0, double %0)
ret double %2
}
int MemoryAddressComparator(void *pLhs, void *pRhs, void *pUserData) {
  return ((char *)pLhs) - ((char *)pRhs);
}


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

x86 assembly (clang, -O2):
<MemoryAddressComparator>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @MemoryAddressComparator(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @MemoryAddressComparator(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = ptrtoint i8* %0 to i64
%5 = ptrtoint i8* %1 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ printf(char *, char *);
void echo(char *text, int c) {
  color(c);
  printf("%s", text);
  color(0);
}


x86 assembly (clang, -O0):
<echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <color@plt>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <color@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <color@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @echo(i8* %0, i32 %1) {
%3 = tail call i32 @color(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @color(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ testall();
int main(int argc, char **argv) {
  int count = 1;
  while (1) {
    printf("Beginning iteration: %d\n\n", count++);
    if (testall() != 0) {
      printf("test failed\n");
      return -1;
    }
  }
  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   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <testall@plt>
cmp    $0x0,%rax
je     1180 <main+0x60>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%esi
lea    0xec1(%rip),%rbx
nop
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <testall@plt>
mov    %ebp,%esi
test   %rax,%rax
je     1140 <main+0x10>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Beginning iteration: %d\0A\0A\00"
@.str.1 = [13 x i8] c"test failed\0A\00"
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 1, i32* %6
br label %7
7: ; preds = %2, %15
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %8)
%11 = call i64 (...) @testall()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
15: ; preds = %7
br label %7
}

LLVM IR (-O2):
@.str = [26 x i8] c"Beginning iteration: %d\0A\0A\00"
@str = [12 x i8] c"test failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 1, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
%7 = tail call i64 (...) @testall()
%8 = icmp eq i64 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int chooseReg();
void chooseRegs(int *r1, int *r2) {
  *r1 = chooseReg();
  do {
    *r2 = chooseReg();
  } while (*r2 == *r1);
}


x86 assembly (clang, -O0):
<chooseRegs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <chooseReg@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <chooseReg@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
je     112f <chooseRegs+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chooseRegs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <chooseReg@plt>
mov    %eax,(%rbx)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <chooseReg@plt>
mov    %eax,(%r14)
cmp    (%rbx),%eax
je     1130 <chooseRegs+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @chooseRegs(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i32 (...) @chooseReg()
store i32 %3, i32* %0
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @chooseReg()
store i32 %5, i32* %1
%6 = load i32, i32* %0
%7 = icmp eq i32 %5, %6
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Variables and functions */
bool PRCMLoadGet(void) {
  return (
      ((*((volatile unsigned long *)(0x40082000 + 0x00000028))) & 0x00000002)
          ? true
          : false);
}


x86 assembly (clang, -O0):
<PRCMLoadGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40082028,%eax
mov    (%rax),%rdx
and    $0x2,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMLoadGet>:
mov    0x40082028,%rax
40
shr    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @PRCMLoadGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074274344 to i64*)
%2 = and i64 %1, 2
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @PRCMLoadGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074274344 to i64*)
%2 = trunc i64 %1 to i32
%3 = lshr i32 %2, 1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
char *trim(char *);
int main(int argc, char **argv) {
  char s[100];
  while (1) {
    bzero(s, 100);
    fgets(s, 100, stdin);
    printf("after trimed: %s", trim(s));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1060 <bzero@plt>
lea    -0x80(%rbp),%rdi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
lea    -0x80(%rbp),%rdi
call   1040 <trim@plt>
mov    %rax,%rsi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
jmp    1159 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    0x2e95(%rip),%r15
lea    0xea6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x64,%esi
call   1060 <bzero@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1040 <trim@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [17 x i8] c"after trimed: %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %2, %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%9 = call i32 @bzero(i8* %8, i32 100)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 100, i32 %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i8* @trim(i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %7
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [17 x i8] c"after trimed: %s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %5, %2
%6 = call i32 @bzero(i8* %4, i32 100)
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %4, i32 100, i32 %7)
%9 = call i8* @trim(i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %5
}
/* Type definitions */
struct FormatType {
  int dummy;
};

/* Variables and functions */
scalar_t__ dirfile_read_channel(float, struct FormatType const *, char const *,
                                int *);
float *dirfile_read_float_channel(const struct FormatType *F,
                                  const char *channelname, int *nsamples) {
  return (float *)dirfile_read_channel('f', F, channelname, nsamples);
}


x86 assembly (clang, -O0):
<dirfile_read_float_channel>:
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
movss  0xec8(%rip),%xmm0
call   1030 <dirfile_read_channel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirfile_read_float_channel>:
movss  0xee8(%rip),%xmm0
jmp    1030 <dirfile_read_channel@plt>

LLVM IR (-O0):
%struct.FormatType = type { i32 }
define float* @dirfile_read_float_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = alloca %struct.FormatType*
%5 = alloca i8*
%6 = alloca i32*
store %struct.FormatType* %0, %struct.FormatType** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load %struct.FormatType*, %struct.FormatType** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i64 @dirfile_read_channel(float 1.020000e+02, %struct.FormatType* %7, i8* %8, i32* %9)
%11 = inttoptr i64 %10 to float*
ret float* %11
}

LLVM IR (-O2):
%struct.FormatType = type { i32 }
define float* @dirfile_read_float_channel(%struct.FormatType* %0, i8* %1, i32* %2) {
%4 = tail call i64 @dirfile_read_channel(float 1.020000e+02, %struct.FormatType* %0, i8* %1, i32* %2)
%5 = inttoptr i64 %4 to float*
ret float* %5
}
int test_imm_2Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x2F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Fuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x2f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Fuint8_mem>:
testb  $0x2f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 47
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(int argc, char *argv[]) {
  unsigned int i = 0x12345678;
  unsigned short int *q = NULL;
  unsigned char *p = (unsigned char *)&i;
  *p = 0x00;
  q = (unsigned short int *)(p + 1);
  *q = 0x0000;
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x12345678,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movw   $0x0,(%rax)
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i16*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 305419896, i32* %6
store i16* null, i16** %7
%9 = bitcast i32* %6 to i8*
store i8* %9, i8** %8
%10 = load i8*, i8** %8
store i8 0, i8* %10
%11 = load i8*, i8** %8
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = bitcast i8* %12 to i16*
store i16* %13, i16** %7
%14 = load i16*, i16** %7
store i16 0, i16* %14
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
Sgn_TYPE_dummy__() {}


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

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

LLVM IR (-O0):
define i32 @Sgn_TYPE_dummy__() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @Sgn_TYPE_dummy__() {
ret i32 undef
}
/* Variables and functions */
int getuid();
int getuser() { return getuid(); }


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

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

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

LLVM IR (-O2):
define i32 @getuser() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
/* Variables and functions */
float cosh(float);
float Float_cosh(float x) { return cosh(x); }


x86 assembly (clang, -O0):
<Float_cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cosh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float_cosh>:
jmp    1030 <cosh@plt>

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

LLVM IR (-O2):
define float @Float_cosh(float %0) {
%2 = tail call float @cosh(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ xcb_atom_t;

/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ XCB_ATOM_ATOM;
int /*<<< orphan*/ xcb_get_property(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
xcb_get_property_cookie_t
xcb_icccm_get_wm_protocols(xcb_connection_t *c, xcb_window_t window,
                           xcb_atom_t wm_protocol_atom) {
  return xcb_get_property(c, 0, window, wm_protocol_atom, XCB_ATOM_ATOM, 0,
                          UINT_MAX);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_protocols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2eb5(%rip),%rax
mov    (%rax),%r8d
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %eax,(%rsp)
call   1030 <xcb_get_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_protocols>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2ecc(%rip),%rax
mov    (%rax),%r8d
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_ATOM = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_protocols(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 = load i32, i32* @XCB_ATOM_ATOM
%11 = load i32, i32* @UINT_MAX
%12 = call i32 @xcb_get_property(i32* %7, i32 0, i32 %8, i32 %9, i32 %10, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@XCB_ATOM_ATOM = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_protocols(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @XCB_ATOM_ATOM
%5 = load i32, i32* @UINT_MAX
%6 = tail call i32 @xcb_get_property(i32* %0, i32 0, i32 %1, i32 %2, i32 %4, i32 0, i32 %5)
ret i32 %6
}
/* Variables and functions */
double pow(double, double);
double outermost_planet(double stellar_mass_ratio) {
  return (50.0 * pow(stellar_mass_ratio, (1.0 / 3.0)));
}


x86 assembly (clang, -O0):
<outermost_planet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outermost_planet>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @outermost_planet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FD5555555555555)
%5 = fmul double 5.000000e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @outermost_planet(double %0) {
%2 = tail call double @pow(double %0, double 0x3FD5555555555555)
%3 = fmul double %2, 5.000000e+01
ret double %3
}
long int longint_ignoring_signedlong(long int x, signed long y) { return x; }


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

x86 assembly (clang, -O2):
<longint_ignoring_signedlong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @longint_ignoring_signedlong(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @longint_ignoring_signedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
struct yamc_pub_cmd_parser_params {
  int dummy;
};
struct yamc_pub_args_info {
  int dummy;
};

/* Variables and functions */
int yamc_pub_cmd_parser_internal(int, char **, struct yamc_pub_args_info *,
                                 struct yamc_pub_cmd_parser_params *,
                                 int /*<<< orphan*/);
int yamc_pub_cmd_parser_ext(int argc, char **argv,
                            struct yamc_pub_args_info *args_info,
                            struct yamc_pub_cmd_parser_params *params) {
  int result;
  result = yamc_pub_cmd_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<yamc_pub_cmd_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <yamc_pub_cmd_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yamc_pub_cmd_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <yamc_pub_cmd_parser_internal@plt>

LLVM IR (-O0):
%struct.yamc_pub_args_info = type { i32 }
%struct.yamc_pub_cmd_parser_params = type { i32 }
define i32 @yamc_pub_cmd_parser_ext(i32 %0, i8** %1, %struct.yamc_pub_args_info* %2, %struct.yamc_pub_cmd_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.yamc_pub_args_info*
%8 = alloca %struct.yamc_pub_cmd_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.yamc_pub_args_info* %2, %struct.yamc_pub_args_info** %7
store %struct.yamc_pub_cmd_parser_params* %3, %struct.yamc_pub_cmd_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.yamc_pub_args_info*, %struct.yamc_pub_args_info** %7
%13 = load %struct.yamc_pub_cmd_parser_params*, %struct.yamc_pub_cmd_parser_params** %8
%14 = call i32 @yamc_pub_cmd_parser_internal(i32 %10, i8** %11, %struct.yamc_pub_args_info* %12, %struct.yamc_pub_cmd_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.yamc_pub_args_info = type { i32 }
%struct.yamc_pub_cmd_parser_params = type { i32 }
define i32 @yamc_pub_cmd_parser_ext(i32 %0, i8** %1, %struct.yamc_pub_args_info* %2, %struct.yamc_pub_cmd_parser_params* %3) {
%5 = tail call i32 @yamc_pub_cmd_parser_internal(i32 %0, i8** %1, %struct.yamc_pub_args_info* %2, %struct.yamc_pub_cmd_parser_params* %3, i32 0)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int8_t stdlib_ndarray_set_ptr_int32(uint8_t *idx, const int32_t v) {
  *(int32_t *)idx = v;
  return 0;
}


x86 assembly (clang, -O0):
<stdlib_ndarray_set_ptr_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @stdlib_ndarray_set_ptr_int32(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void portable_aligned_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<portable_aligned_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @portable_aligned_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, int /*<<< orphan*/ *, int);
void wrmsr(u_int32_t msr, u_int64_t value) {
  int fd;
  fd = open("/dev/cpu/0/msr", O_WRONLY);
  lseek(fd, msr, SEEK_SET);
  write(fd, &value, 8);
  close(fd);
}


x86 assembly (clang, -O0):
<wrmsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <lseek@plt>
mov    -0xc(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrmsr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %esi,0x4(%rsp)
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebp
mov    0x2e79(%rip),%rax
mov    (%rax),%edx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <lseek@plt>
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
mov    $0x8,%edx
call   1030 <write@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <close@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/dev/cpu/0/msr\00"
@O_WRONLY = global i32 0
@SEEK_SET = global i32 0
define void @wrmsr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* @O_WRONLY
%7 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @lseek(i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* %5
%13 = call i32 @write(i32 %12, i32* %4, i32 8)
%14 = load i32, i32* %5
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/dev/cpu/0/msr\00"
@O_WRONLY = global i32 0
@SEEK_SET = global i32 0
define void @wrmsr(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @O_WRONLY
%5 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @lseek(i32 %5, i32 %0, i32 %6)
%8 = call i32 @write(i32 %5, i32* %3, i32 8)
%9 = tail call i32 @close(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NDELAY;
int fcntl(int /*<<< orphan*/, int /*<<< orphan*/, ...);
void set_nodelay_mode(void) {
  int flags;
  flags = fcntl(0, F_GETFL);
  flags |= O_NDELAY;
  fcntl(0, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<set_nodelay_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nodelay_mode>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
or     (%rcx),%eax
mov    0x2ead(%rip),%rcx
mov    (%rcx),%esi
xor    %edi,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NDELAY = global i32 0
@F_SETFL = global i32 0
define void @set_nodelay_mode() {
%1 = alloca i32
%2 = load i32, i32* @F_GETFL
%3 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* @O_NDELAY
%5 = load i32, i32* %1
%6 = or i32 %5, %4
store i32 %6, i32* %1
%7 = load i32, i32* @F_SETFL
%8 = load i32, i32* %1
%9 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NDELAY = global i32 0
@F_SETFL = global i32 0
define void @set_nodelay_mode() {
%1 = load i32, i32* @F_GETFL
%2 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %1)
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = load i32, i32* @F_SETFL
%6 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %5, i32 %4)
ret void
}