xunge/DecIR huggingface dataset:
int ld_bge_rm2(long double a1, long double *a2) {
  return !(__builtin_isgreaterequal(a1, *a2));
}


x86 assembly (clang, -O0):
<ld_bge_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bge_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_bge_rm2(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp oge x86_fp80 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_bge_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp ugt x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1148 <main+0x38>
jmp    112f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void start_data(void *pr_data) {
  FILE *fp = pr_data;
  fprintf(fp, "  <data>\n");
}


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

x86 assembly (clang, -O2):
<start_data>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" <data>\0A\00"
define void @start_data(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" <data>\0A\00"
define void @start_data(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 9, i64 1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_PUBLIC;
scalar_t__ i2d_RSA_PUBKEY;
int PEM_write_RSA_PUBKEY(FILE *fp, RSA *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_RSA_PUBKEY, PEM_STRING_PUBLIC, fp, x,
                        NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_RSA_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_RSA_PUBKEY>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_RSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32 @PEM_write_RSA_PUBKEY(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_RSA_PUBKEY
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PUBLIC
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_RSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32 @PEM_write_RSA_PUBKEY(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_RSA_PUBKEY
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_PUBLIC
%6 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
int count_six(int n) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @count_six(i32 %0) {
ret i32 -1
}
/* Variables and functions */
unsigned int precomputed16_bitcount(unsigned int);
unsigned int populationCount(unsigned int n) {
  return precomputed16_bitcount(n);
}


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

x86 assembly (clang, -O2):
<populationCount>:
jmp    1030 <precomputed16_bitcount@plt>

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

LLVM IR (-O2):
define i32 @populationCount(i32 %0) {
%2 = tail call i32 @precomputed16_bitcount(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = -1;
  short int p = (unsigned short int)i;
  printf("p=%d\n", 65536 / 2);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %ax,-0xa(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x8000,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"p=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 32768)
ret i32 1
}
int strcmp(const char *s1, const char *s2) {
  for (; *s1 == *s2; ++s1, ++s2) {
    if (*s1 == '\0')
      ;
    return (0);
  }
  return ((*(unsigned char *)s1 < *(unsigned char *)s2) ? -1 : +1);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1143 <strcmp+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1137 <strcmp+0x37>
jmp    1137 <strcmp+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1163 <strcmp+0x63>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%al
setae  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
br label %20
20: ; preds = %19, %14
store i32 0, i32* %3
br label %36
21: ; No predecessors!
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = icmp slt i32 %29, %32
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 -1, i32 1
store i32 %35, i32* %3
br label %36
36: ; preds = %26, %20
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = icmp ult i8 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410U;
    if ((state[0UL] >> 4U) & 1U) {
      if ((state[0UL] >> 3U) & 1U) {
      }
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = state[0UL] + 1105064296U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <RandomFunc+0x4f>
mov    -0x14(%rbp),%eax
shr    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114a <RandomFunc+0x4a>
jmp    114a <RandomFunc+0x4a>
jmp    1158 <RandomFunc+0x58>
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
add    $0x41ddf168,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x136ff696,%eax
add    (%rdi),%eax
test   $0x10,%al
sete   %cl
shl    %cl,%eax
add    $0x41ddf168,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = add i64 %9, 51238316
%11 = add i64 %10, 274866410
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %12, i32* %13
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %14
%16 = lshr i32 %15, 4
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %27
19: ; preds = %2
%20 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%21 = load i32, i32* %20
%22 = lshr i32 %21, 3
%23 = and i32 %22, 1
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
br label %26
26: ; preds = %25, %19
br label %33
27: ; preds = %2
%28 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%29 = load i32, i32* %28
%30 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%31 = load i32, i32* %30
%32 = add i32 %31, %29
store i32 %32, i32* %30
br label %33
33: ; preds = %27, %26
%34 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%35 = load i32, i32* %34
%36 = add i32 %35, 1105064296
%37 = load i32*, i32** %4
%38 = getelementptr inbounds i32, i32* %37, i64 0
store i32 %36, i32* %38
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 326104726
%5 = lshr i32 %4, 4
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
%8 = shl i32 %4, %7
%9 = add i32 %8, 1105064296
store i32 %9, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ const *, int);
void store16(void *out, const uint16_t v) { memcpy(out, &v, sizeof v); }


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

x86 assembly (clang, -O2):
<store16>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @store16(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 @memcpy(i8* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @store16(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
char toLowerCase(char ch) { return ch - 'A' + 'a'; }


x86 assembly (clang, -O0):
<toLowerCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @toLowerCase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
%6 = add nsw i32 %5, 97
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @toLowerCase(i8 signext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_lc898122(int, int);
void GyOutSignalCont_lc898122(void) { RegWriteA_lc898122(0x0280, 0x04); }


x86 assembly (clang, -O0):
<GyOutSignalCont_lc898122>:
push   %rbp
mov    %rsp,%rbp
mov    $0x280,%edi
mov    $0x4,%esi
call   1030 <RegWriteA_lc898122@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyOutSignalCont_lc898122>:
mov    $0x280,%edi
mov    $0x4,%esi
jmp    1030 <RegWriteA_lc898122@plt>

LLVM IR (-O0):
define void @GyOutSignalCont_lc898122() {
%1 = call i32 @RegWriteA_lc898122(i32 640, i32 4)
ret void
}

LLVM IR (-O2):
define void @GyOutSignalCont_lc898122() {
%1 = tail call i32 @RegWriteA_lc898122(i32 640, i32 4)
ret void
}
void term_install() {}


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

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

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

LLVM IR (-O2):
define void @term_install() {
ret void
}
unsigned precise_fraction_ured(unsigned v) { return v >> 16; }


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

x86 assembly (clang, -O2):
<precise_fraction_ured>:
mov    %edi,%eax
shr    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @precise_fraction_ured(i32 %0) {
%2 = lshr i32 %0, 16
ret i32 %2
}
/* Variables and functions */
scalar_t__ findMajority(char *, int, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char majority;
  if (findMajority("AAACCBBCCCBCC", 13, &majority))
    printf("Мажорант: %c\n", majority);
  else
    printf("Няма мажорант.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0xd,%esi
lea    -0x5(%rbp),%rdx
call   1040 <findMajority@plt>
cmp    $0x0,%rax
je     1165 <main+0x45>
movsbl -0x5(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <main+0x53>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rdx
mov    $0xd,%esi
call   1050 <findMajority@plt>
test   %rax,%rax
je     1161 <main+0x31>
movsbl 0x7(%rsp),%esi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116d <main+0x3d>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"AAACCBBCCCBCC\00"
@.str.1 = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
@.str.2 = [28 x i8] c"\D0\9D\D1\8F\D0\BC\D0\B0 \D0\BC\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i64 @findMajority(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13, i8* %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"AAACCBBCCCBCC\00"
@.str.1 = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
@str = [27 x i8] c"\D0\9D\D1\8F\D0\BC\D0\B0 \D0\BC\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82.\00"
define i32 @main() {
%1 = alloca i8
%2 = call i64 @findMajority(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13, i8* %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %10
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret i32 0
}
unsigned long alignToBound(unsigned long a, unsigned long alignTo) {
  return ((a + alignTo) / alignTo) * alignTo;
}


x86 assembly (clang, -O0):
<alignToBound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
imul   -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignToBound>:
add    %rsi,%rdi
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1119 <alignToBound+0x19>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
jmp    111f <alignToBound+0x1f>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @alignToBound(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 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = load i64, i64* %4
%9 = udiv i64 %7, %8
%10 = load i64, i64* %4
%11 = mul i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @alignToBound(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = urem i64 %3, %1
%5 = sub i64 %3, %4
ret i64 %5
}
float bar_to_psi(float value) { return value * 14.5037738f; }


x86 assembly (clang, -O0):
<bar_to_psi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @bar_to_psi(float %0) {
%2 = fmul float %0, 0x402D01EEA0000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_theta(void) {
  record_linux_param_description("tcp_illinois.c", "theta",
                                 "# of fast RTT's before full growth");
}


x86 assembly (clang, -O0):
<module_param_desc_theta>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
lea    0xeec(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_theta>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
lea    0xef0(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"tcp_illinois.c\00"
@.str.1 = [6 x i8] c"theta\00"
@.str.2 = [35 x i8] c"# of fast RTT's before full growth\00"
define void @module_param_desc_theta() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"tcp_illinois.c\00"
@.str.1 = [6 x i8] c"theta\00"
@.str.2 = [35 x i8] c"# of fast RTT's before full growth\00"
define void @module_param_desc_theta() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ nw_fill(int);
void nw_fill_test(void **state) {
  assert_int_equal(nw_fill(0x80ul), 0x0102040810204080ul);
}


x86 assembly (clang, -O0):
<nw_fill_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x80,%edi
call   1040 <nw_fill@plt>
mov    %eax,%edi
mov    $0x10204080,%esi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nw_fill_test>:
push   %rax
mov    $0x80,%edi
call   1040 <nw_fill@plt>
mov    %eax,%edi
mov    $0x10204080,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @nw_fill_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @nw_fill(i32 128)
%4 = call i32 @assert_int_equal(i32 %3, i32 270549120)
ret void
}

LLVM IR (-O2):
define void @nw_fill_test(i8** nocapture readnone %0) {
%2 = tail call i32 @nw_fill(i32 128)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 270549120)
ret void
}
int ConsoleGetChar() {}


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

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

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

LLVM IR (-O2):
define i32 @ConsoleGetChar() {
ret i32 undef
}
char not(char one) {
  if (one == '1') {
    return '0';
  } else {
    return '1';
  }
}


x86 assembly (clang, -O0):
<not>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x31,%eax
jne    1120 <not+0x20>
movb   $0x30,-0x1(%rbp)
jmp    1124 <not+0x24>
movb   $0x31,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @not(i8 signext %0) {
%2 = icmp eq i8 %0, 49
%3 = select i1 %2, i8 48, i8 49
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  printf("Enter any number");
  scanf("%d", &a);
  b = a % 2;
  if (b == 0) {
    printf("The given numbr is even");
  } else {
    printf("The given numbr is not even");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1174 <main+0x54>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xeca(%rip),%rax
lea    0xedb(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter any number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"The given numbr is even\00"
@.str.3 = [28 x i8] c"The given numbr is not even\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter any number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"The given numbr is even\00"
@.str.3 = [28 x i8] c"The given numbr is not even\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
int test_imm_5Bint16_mem(short *val) {
  return ((*val) & (-0x5B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Bint16_mem>:
movzwl (%rdi),%eax
test   $0xffa5,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Bint16_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, -91
%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_5Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -91
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo6(void) { return; }


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

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

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

LLVM IR (-O2):
define void @foo6() {
ret void
}
/* Variables and functions */
int readRBG0(int /*<<< orphan*/);
int readRBG1(int /*<<< orphan*/);
int readRBG(void) {
  int b0 = readRBG0(0);
  int b1 = readRBG1(0);
  if (b0 != -1)
    if (b1 != -1)
      if (b0 != b1)
        return b0;
  return -1;
}


x86 assembly (clang, -O0):
<readRBG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <readRBG0@plt>
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1040 <readRBG1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1171 <readRBG+0x51>
cmpl   $0xffffffff,-0xc(%rbp)
je     116c <readRBG+0x4c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1167 <readRBG+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <readRBG+0x58>
jmp    116c <readRBG+0x4c>
jmp    1171 <readRBG+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readRBG>:
push   %rbx
xor    %edi,%edi
call   1030 <readRBG0@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1040 <readRBG1@plt>
cmp    %eax,%ebx
mov    $0xffffffff,%ecx
cmovne %ebx,%ecx
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
cmp    $0xffffffff,%ebx
cmove  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @readRBG() {
%1 = tail call i32 @readRBG0(i32 0)
%2 = tail call i32 @readRBG1(i32 0)
%3 = icmp eq i32 %1, -1
%4 = icmp eq i32 %2, -1
%5 = select i1 %3, i1 true, i1 %4
%6 = icmp eq i32 %1, %2
%7 = select i1 %5, i1 true, i1 %6
%8 = select i1 %7, i32 -1, i32 %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ display(int *, int);
int /*<<< orphan*/ heapsort(int *, int);
int main(int argc, char *argv[]) {
  int a[] = {26, 5, 33, 77, 1, 61, 11, 59, 15, 48, 19, 22};
  heapsort(a, 11);
  display(a, 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0xb,%esi
call   1040 <heapsort@plt>
lea    -0x40(%rbp),%rdi
mov    $0xc,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <heapsort@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [12 x i32] [i32 26, i32 5, i32 33, i32 77, i32 1, i32 61, i32 11, i32 59, i32 15, i32 48, i32 19, i32 22]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [12 x i32]* %6 to i8*
%8 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 0
%9 = call i32 @heapsort(i32* %8, i32 11)
%10 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 0
%11 = call i32 @display(i32* %10, i32 12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [12 x i32] [i32 26, i32 5, i32 33, i32 77, i32 1, i32 61, i32 11, i32 59, i32 15, i32 48, i32 19, i32 22]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i32]
%4 = bitcast [12 x i32]* %3 to i8*
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 @heapsort(i32* %5, i32 11)
%7 = call i32 @display(i32* %5, i32 12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drawCenteredPowerstacker();
int /*<<< orphan*/ eraseCenteredPowerstacker();
int /*<<< orphan*/ eraseDisplay();
int /*<<< orphan*/ nxtFillRect(int /*<<< orphan*/, int, int,
                               int /*<<< orphan*/);
int /*<<< orphan*/ wait10Msec(int);
void doPowerstackerSplash() {
  eraseDisplay();
  drawCenteredPowerstacker();
  wait10Msec(100);
  eraseDisplay();
  wait10Msec(50);
  nxtFillRect(0, 64, 100, 0);
  eraseCenteredPowerstacker();
  wait10Msec(300);
}


x86 assembly (clang, -O0):
<doPowerstackerSplash>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <eraseDisplay@plt>
mov    $0x0,%al
call   1070 <drawCenteredPowerstacker@plt>
mov    $0x64,%edi
call   1050 <wait10Msec@plt>
mov    $0x0,%al
call   1030 <eraseDisplay@plt>
mov    $0x32,%edi
call   1050 <wait10Msec@plt>
xor    %ecx,%ecx
mov    $0x40,%esi
mov    $0x64,%edx
mov    %ecx,%edi
call   1060 <nxtFillRect@plt>
mov    $0x0,%al
call   1040 <eraseCenteredPowerstacker@plt>
mov    $0x12c,%edi
call   1050 <wait10Msec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doPowerstackerSplash>:
push   %rax
xor    %eax,%eax
call   1030 <eraseDisplay@plt>
xor    %eax,%eax
call   1070 <drawCenteredPowerstacker@plt>
mov    $0x64,%edi
call   1050 <wait10Msec@plt>
xor    %eax,%eax
call   1030 <eraseDisplay@plt>
mov    $0x32,%edi
call   1050 <wait10Msec@plt>
xor    %edi,%edi
mov    $0x40,%esi
mov    $0x64,%edx
xor    %ecx,%ecx
call   1060 <nxtFillRect@plt>
xor    %eax,%eax
call   1040 <eraseCenteredPowerstacker@plt>
mov    $0x12c,%edi
pop    %rax
jmp    1050 <wait10Msec@plt>

LLVM IR (-O0):
define void @doPowerstackerSplash() {
%1 = call i32 (...) @eraseDisplay()
%2 = call i32 (...) @drawCenteredPowerstacker()
%3 = call i32 @wait10Msec(i32 100)
%4 = call i32 (...) @eraseDisplay()
%5 = call i32 @wait10Msec(i32 50)
%6 = call i32 @nxtFillRect(i32 0, i32 64, i32 100, i32 0)
%7 = call i32 (...) @eraseCenteredPowerstacker()
%8 = call i32 @wait10Msec(i32 300)
ret void
}

LLVM IR (-O2):
define void @doPowerstackerSplash() {
%1 = tail call i32 (...) @eraseDisplay()
%2 = tail call i32 (...) @drawCenteredPowerstacker()
%3 = tail call i32 @wait10Msec(i32 100)
%4 = tail call i32 (...) @eraseDisplay()
%5 = tail call i32 @wait10Msec(i32 50)
%6 = tail call i32 @nxtFillRect(i32 0, i32 64, i32 100, i32 0)
%7 = tail call i32 (...) @eraseCenteredPowerstacker()
%8 = tail call i32 @wait10Msec(i32 300)
ret void
}
unsigned xrop3_99_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_99_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_99_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %ecx
mov    %eax,%edx
or     %ecx,%edx
or     $0xff,%ecx
xor    %eax,%ecx
and    %edx,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_99_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_99_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = or i32 %7, 255
%9 = xor i32 %8, %4
%10 = or i32 %4, %7
%11 = and i32 %9, %10
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ very_long_function(int);
blah() { very_long_function(1); }


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

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

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

LLVM IR (-O2):
define i32 @blah() {
%1 = tail call i32 @very_long_function(i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ early_puts(char const *);
int /*<<< orphan*/ virtio_stop();
void virtio_panic(const char *string) {
  early_puts("panic: ");
  early_puts(string);
  early_puts("\n");
  virtio_stop();
}


x86 assembly (clang, -O0):
<virtio_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <early_puts@plt>
mov    -0x8(%rbp),%rdi
call   1030 <early_puts@plt>
lea    0xec0(%rip),%rdi
call   1030 <early_puts@plt>
mov    $0x0,%al
call   1040 <virtio_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<virtio_panic>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <early_puts@plt>
mov    %rbx,%rdi
call   1030 <early_puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <early_puts@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <virtio_stop@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"panic: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @virtio_panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @early_puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @early_puts(i8* %4)
%6 = call i32 @early_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @virtio_stop()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"panic: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @virtio_panic(i8* %0) {
%2 = tail call i32 @early_puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @early_puts(i8* %0)
%4 = tail call i32 @early_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @virtio_stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char const *, int);
void Sys_Mkdir(const char *path) { mkdir(path, 0750); }


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

x86 assembly (clang, -O2):
<Sys_Mkdir>:
mov    $0x1e8,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define void @Sys_Mkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 488)
ret void
}
/* Variables and functions */
int COLS;
int nc_COLS(void) { return COLS; }


x86 assembly (clang, -O0):
<nc_COLS>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@COLS = global i32 0
define i32 @nc_COLS() {
%1 = load i32, i32* @COLS
ret i32 %1
}

LLVM IR (-O2):
@COLS = global i32 0
define i32 @nc_COLS() {
%1 = load i32, i32* @COLS
ret i32 %1
}
int is_ascii_lowercase_text(char in_c) {
  if ((in_c >= 0x61 && in_c <= 0x7A)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_ascii_lowercase_text>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_ascii_lowercase_text+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <is_ascii_lowercase_text+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <is_ascii_lowercase_text+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ascii_lowercase_text>:
add    $0x85,%dil
xor    %eax,%eax
cmp    $0xe6,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_ascii_lowercase_text(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %13
12: ; preds = %7, %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_ascii_lowercase_text(i8 signext %0) {
%2 = add i8 %0, -123
%3 = icmp ult i8 %2, -26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void proov(char **c) { printf("Korras."); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Korras.\00"
define void @proov(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Korras.\00"
define void @proov(i8** nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int getchar();
scalar_t__ isdigit(int);
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  int c;
  while ((c = getchar()) != EOF)
    if (isdigit(c) || c == '\n')
      putchar(c);
}


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)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
je     1188 <main+0x58>
mov    -0x14(%rbp),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    117b <main+0x4b>
cmpl   $0xa,-0x14(%rbp)
jne    1183 <main+0x53>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
jne    1151 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1175 <main+0x45>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1147 <main+0x17>
mov    %ebx,%edi
call   1040 <isdigit@plt>
cmp    $0xa,%ebx
je     1160 <main+0x30>
test   %rax,%rax
je     1167 <main+0x37>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
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
br label %7
7: ; preds = %21, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = call i64 @isdigit(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %21
18: ; preds = %15, %11
%19 = load i32, i32* %6
%20 = call i32 @putchar(i32 %19)
br label %21
21: ; preds = %18, %15
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %18, label %6
6: ; preds = %2, %14
%7 = phi i32 [ %15, %14 ], [ %3, %2 ]
%8 = tail call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
%10 = icmp eq i32 %7, 10
%11 = or i1 %10, %9
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 @putchar(i32 %7)
br label %14
14: ; preds = %6, %12
%15 = tail call i32 (...) @getchar()
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %6
18: ; preds = %14, %2
ret i32 0
}
short g(short a) { return __builtin_bswap16(a); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
rol    $0x8,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @g(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i16 @llvm.bswap.i16(i16 %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @g(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}