xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int main(int ac, char **av) {
  fprintf(stderr,
          "hello %s %d"
          "\n",
          (*av), (ac));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%ecx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%ecx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"hello %s %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %0)
ret i32 0
}
void pisar(unsigned int m) {
  unsigned int i;
  char *p = (char *)m;
  for (i = 0; i < 0x00001000; i++) {
    p[i] = 0xcd;
  }
}


x86 assembly (clang, -O0):
<pisar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jae    113b <pisar+0x3b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
movb   $0xcd,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <pisar+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pisar>:
push   %rax
mov    %edi,%edi
mov    $0x1000,%edx
mov    $0xcd,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pisar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
store i32 0, i32* %3
br label %8
8: ; preds = %16, %1
%9 = load i32, i32* %3
%10 = icmp ult i32 %9, 4096
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 -51, i8* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %3
%18 = add i32 %17, 1
store i32 %18, i32* %3
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @pisar(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ intmax_t;

/* Variables and functions */
int /*<<< orphan*/ atomax10(char const *);
intmax_t getn(const char *s) { return atomax10(s); }


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

x86 assembly (clang, -O2):
<getn>:
jmp    1030 <atomax10@plt>

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

LLVM IR (-O2):
define i32 @getn(i8* %0) {
%2 = tail call i32 @atomax10(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int __m128i;

/* Variables and functions */
__m128i _mm_J(__m128i x, __m128i y, __m128i z) { return ((x) ^ ((y) | ~(z))); }


x86 assembly (clang, -O0):
<_mm_J>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_J>:
mov    %edx,%eax
not    %eax
or     %esi,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @_mm_J(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 = xor i32 %9, -1
%11 = or i32 %8, %10
%12 = xor i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_mm_J(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = or i32 %4, %1
%6 = xor i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ isPrime(int);
int findPrimeGreaterThan(int val) {
  if (val & 1) {
    val += 2;
  } else {
    val++;
  }
  while (!isPrime(val)) {
    val += 2;
  }
  return val;
}


x86 assembly (clang, -O0):
<findPrimeGreaterThan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1138 <findPrimeGreaterThan+0x28>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <findPrimeGreaterThan+0x31>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <findPrimeGreaterThan+0x36>
mov    -0x4(%rbp),%edi
call   1030 <isPrime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1163 <findPrimeGreaterThan+0x53>
jmp    1171 <findPrimeGreaterThan+0x61>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <findPrimeGreaterThan+0x36>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findPrimeGreaterThan>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x1,%eax
sbb    $0x0,%ebx
add    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <isPrime@plt>
add    $0x2,%ebx
test   %eax,%eax
je     1130 <findPrimeGreaterThan+0x20>
add    $0xfffffffe,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @findPrimeGreaterThan(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 2
%5 = add nsw i32 %4, %0
br label %6
6: ; preds = %6, %1
%7 = phi i32 [ %5, %1 ], [ %10, %6 ]
%8 = tail call i32 @isPrime(i32 %7)
%9 = icmp eq i32 %8, 0
%10 = add nsw i32 %7, 2
br i1 %9, label %6, label %11
11: ; preds = %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ assert(int);
int open(char *, int /*<<< orphan*/);
int read(int, char *, int);
int /*<<< orphan*/ srand48(long);
void randomize(void) {
  static char RB[16];
  int rfd = open("/dev/urandom", O_RDONLY);
  assert(read(rfd, RB, sizeof(long)) == sizeof(long));
  srand48(*((long *)RB));
}


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2ee6(%rip),%rsi
mov    $0x8,%edx
call   1030 <read@plt>
cltq
cmp    $0x8,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2ec2(%rip),%rdi
call   1050 <srand48@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1060 <open@plt>
lea    0x2ef3(%rip),%rsi
mov    %eax,%edi
mov    $0x8,%edx
call   1030 <read@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x2ed2(%rip),%rdi
pop    %rax
jmp    1050 <srand48@plt>

LLVM IR (-O0):
@randomize.RB = internal global [16 x i8] zeroinitializer
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @randomize() {
%1 = alloca i32
%2 = load i32, i32* @O_RDONLY
%3 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @read(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @randomize.RB, i64 0, i64 0), i32 8)
%6 = sext i32 %5 to i64
%7 = icmp eq i64 %6, 8
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* bitcast ([16 x i8]* @randomize.RB to i64*)
%11 = call i32 @srand48(i64 %10)
ret void
}

LLVM IR (-O2):
@randomize.RB = internal global [16 x i8] zeroinitializer
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define void @randomize() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @read(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @randomize.RB, i64 0, i64 0), i32 8)
%4 = icmp eq i32 %3, 8
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i64, i64* bitcast ([16 x i8]* @randomize.RB to i64*)
%8 = tail call i32 @srand48(i64 %7)
ret void
}
/* Variables and functions */
char toupper(char);
void upcase(char *ptr, int n) {
  while (n--) {
    *ptr = toupper(*ptr);
    ++ptr;
  }
}


x86 assembly (clang, -O0):
<upcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <upcase+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <upcase+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @upcase(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = load i8, i8* %6
%9 = tail call signext i8 @toupper(i8 signext %8)
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
void Point_dtor() {}


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

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

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

LLVM IR (-O2):
define void @Point_dtor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertInt(int, int);
int finishTestCase();
int /*<<< orphan*/ initTestCase(char *);
int produceOne();
int test1(void) {
  initTestCase("Test Int");
  assertInt(10, 5 + 5);
  assertInt(1, produceOne());
  return finishTestCase();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <initTestCase@plt>
mov    $0xa,%esi
mov    %esi,%edi
call   1060 <assertInt@plt>
mov    $0x0,%al
call   1040 <produceOne@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1060 <assertInt@plt>
mov    $0x0,%al
call   1050 <finishTestCase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <initTestCase@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1060 <assertInt@plt>
xor    %eax,%eax
call   1040 <produceOne@plt>
mov    $0x1,%edi
mov    %eax,%esi
call   1060 <assertInt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <finishTestCase@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Test Int\00"
define i32 @test1() {
%1 = call i32 @initTestCase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @assertInt(i32 10, i32 10)
%3 = call i32 (...) @produceOne()
%4 = call i32 @assertInt(i32 1, i32 %3)
%5 = call i32 (...) @finishTestCase()
ret i32 %5
}

LLVM IR (-O2):
@.str = [9 x i8] c"Test Int\00"
define i32 @test1() {
%1 = tail call i32 @initTestCase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assertInt(i32 10, i32 10)
%3 = tail call i32 (...) @produceOne()
%4 = tail call i32 @assertInt(i32 1, i32 %3)
%5 = tail call i32 (...) @finishTestCase()
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dbg_break();
void arch_benchmarks(void) { dbg_break(); }


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

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

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

LLVM IR (-O2):
define void @arch_benchmarks() {
%1 = tail call i32 (...) @dbg_break()
ret void
}
void g_random_set_seed() {}


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

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

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

LLVM IR (-O2):
define void @g_random_set_seed() {
ret void
}
float torad(float x) { return x * 3.14159 / 180; }


x86 assembly (clang, -O0):
<torad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<torad>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @torad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 3.141590e+00
%6 = fdiv double %5, 1.800000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @torad(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.141590e+00
%4 = fdiv double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
int smbd_recv(struct smbd_connection *info, struct msghdr *msg) { return -1; }


x86 assembly (clang, -O0):
<smbd_recv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.smbd_connection = type opaque
%struct.msghdr = type opaque
define i32 @smbd_recv(%struct.smbd_connection* %0, %struct.msghdr* %1) {
%3 = alloca %struct.smbd_connection*
%4 = alloca %struct.msghdr*
store %struct.smbd_connection* %0, %struct.smbd_connection** %3
store %struct.msghdr* %1, %struct.msghdr** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.smbd_connection = type opaque
%struct.msghdr = type opaque
define i32 @smbd_recv(%struct.smbd_connection* nocapture readnone %0, %struct.msghdr* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int strlen(char *);
void fgets_null_check_Bad() {
  char line[100];
  while (fgets(line, 100, stdin)) {
    line[strlen(line) - 2] = 0;
  }
}


x86 assembly (clang, -O0):
<fgets_null_check_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1161 <fgets_null_check_Bad+0x41>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x2,%eax
cltq
movb   $0x0,-0x70(%rbp,%rax,1)
jmp    1128 <fgets_null_check_Bad+0x8>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_null_check_Bad>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    0x2eba(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1166 <fgets_null_check_Bad+0x46>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x2(%rax,%rbx,1)
mov    (%r14),%edx
jmp    1140 <fgets_null_check_Bad+0x20>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @fgets_null_check_Bad() {
%1 = alloca [100 x i8]
br label %2
2: ; preds = %7, %0
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i64 @fgets(i8* %3, i32 100, i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %9, 2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %11
store i8 0, i8* %12
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @fgets_null_check_Bad() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 100, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %0, %6
%7 = call i32 @strlen(i8* %2)
%8 = add nsw i32 %7, -2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %10
%11 = load i32, i32* @stdin
%12 = call i64 @fgets(i8* %2, i32 100, i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %0
ret void
}
/* Variables and functions */
float add2(float, float);
float add1(float n) { return add2(n + 1, n - 1); }


x86 assembly (clang, -O0):
<add1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xec9(%rip),%xmm2
subss  %xmm2,%xmm1
call   1030 <add2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add1>:
movaps %xmm0,%xmm1
movss  0xee5(%rip),%xmm0
addss  %xmm1,%xmm0
addss  0xedd(%rip),%xmm1
jmp    1030 <add2@plt>

LLVM IR (-O0):
define float @add1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 1.000000e+00
%5 = load float, float* %2
%6 = fsub float %5, 1.000000e+00
%7 = call float @add2(float %4, float %6)
ret float %7
}

LLVM IR (-O2):
define float @add1(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fadd float %0, -1.000000e+00
%4 = tail call float @add2(float %2, float %3)
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;

/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ gluOrtho2D(double, double, double, double);
void reshape(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(-2.0, 2.0, -2.0, 2.0);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
movsd  0xe86(%rip),%xmm2
movsd  0xe86(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
call   1050 <gluOrtho2D@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <glViewport@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
movsd  0xe95(%rip),%xmm0
movsd  0xe95(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
call   1050 <gluOrtho2D@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(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 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = call i32 @gluOrtho2D(double -2.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.000000e+00)
%12 = load i32, i32* @GL_MODELVIEW
%13 = call i32 @glMatrixMode(i32 %12)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @gluOrtho2D(double -2.000000e+00, double 2.000000e+00, double -2.000000e+00, double 2.000000e+00)
%8 = load i32, i32* @GL_MODELVIEW
%9 = tail call i32 @glMatrixMode(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
void readln(char *input) {
  printf("Please enter string: ");
  fgets(input, 1024, stdin);
  input[strlen(input) - 1] = '\0';
}


x86 assembly (clang, -O0):
<readln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readln>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Please enter string: \00"
@stdin = global i32 0
define void @readln(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 1024, i32 %5)
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Please enter string: \00"
@stdin = global i32 0
define void @readln(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %0, i32 1024, i32 %3)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int my_strcmp(const void *a, const void *b) {
  return strcmp(*((const char **)a), *((const char **)b));
}


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

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @my_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int test_imm_80uint16_mem(unsigned short *val) {
  return ((*val) & (-0x80 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_80uint16_mem>:
movzwl (%rdi),%eax
cmp    $0x80,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_80uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -128
%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_80uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 128
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void disable_kernel_vsx(void) {}


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

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

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

LLVM IR (-O2):
define void @disable_kernel_vsx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeCommands(char **commands, unsigned int commandCount) {
  for (unsigned int i = 0; i < commandCount; ++i) {
    free(commands[i]);
  }
}


x86 assembly (clang, -O0):
<freeCommands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <freeCommands+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeCommands+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeCommands>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1142 <freeCommands+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeCommands+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @freeCommands(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
float blendLinearBurn(float, float);
float blendLinearDodge(float, float);
float blendLinearLight(float base, float blend) {
  return blend < 0.5f ? blendLinearBurn(base, (2.0f * blend))
                      : blendLinearDodge(base, (2.0f * (blend - 0.5f)));
}


x86 assembly (clang, -O0):
<blendLinearLight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xec6(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1165 <blendLinearLight+0x45>
movss  -0x4(%rbp),%xmm0
movss  0xeb3(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
call   1040 <blendLinearBurn@plt>
movss  %xmm0,-0xc(%rbp)
jmp    1191 <blendLinearLight+0x71>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  0xe89(%rip),%xmm1
subss  %xmm1,%xmm2
movss  0xe81(%rip),%xmm1
mulss  %xmm2,%xmm1
call   1030 <blendLinearDodge@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendLinearLight>:
movss  0xed8(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    1136 <blendLinearLight+0x16>
addss  %xmm1,%xmm1
jmp    1040 <blendLinearBurn@plt>
addss  0xec6(%rip),%xmm1
addss  %xmm1,%xmm1
jmp    1030 <blendLinearDodge@plt>

LLVM IR (-O0):
define float @blendLinearLight(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fcmp olt float %5, 5.000000e-01
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load float, float* %3
%9 = load float, float* %4
%10 = fmul float 2.000000e+00, %9
%11 = call float @blendLinearBurn(float %8, float %10)
br label %18
12: ; preds = %2
%13 = load float, float* %3
%14 = load float, float* %4
%15 = fsub float %14, 5.000000e-01
%16 = fmul float 2.000000e+00, %15
%17 = call float @blendLinearDodge(float %13, float %16)
br label %18
18: ; preds = %12, %7
%19 = phi float [ %11, %7 ], [ %17, %12 ]
ret float %19
}

LLVM IR (-O2):
define float @blendLinearLight(float %0, float %1) {
%3 = fcmp olt float %1, 5.000000e-01
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = fmul float %1, 2.000000e+00
%6 = tail call float @blendLinearBurn(float %0, float %5)
br label %11
7: ; preds = %2
%8 = fadd float %1, -5.000000e-01
%9 = fmul float %8, 2.000000e+00
%10 = tail call float @blendLinearDodge(float %0, float %9)
br label %11
11: ; preds = %7, %4
%12 = phi float [ %6, %4 ], [ %10, %7 ]
ret float %12
}
void g_type_module_register_enum() {}


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

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

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

LLVM IR (-O2):
define void @g_type_module_register_enum() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void wait_for_power(void) { usleep(10 * 1000); }


x86 assembly (clang, -O0):
<wait_for_power>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2710,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_power>:
mov    $0x2710,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @wait_for_power() {
%1 = call i32 @usleep(i32 10000)
ret void
}

LLVM IR (-O2):
define void @wait_for_power() {
%1 = tail call i32 @usleep(i32 10000)
ret void
}
int isascii(int c) { return c <= 0x7f; }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 127
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp slt i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version() { printf("mklocale: Version %s\n", "0.0.1"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"mklocale: Version %s\0A\00"
@.str.1 = [6 x i8] c"0.0.1\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"mklocale: Version %s\0A\00"
@.str.1 = [6 x i8] c"0.0.1\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *scopy(s)
char *s;
{
  register char *p = ((char *)myalloc(strlen(s) + 1, sizeof(char), "type"));
  (void)strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<scopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
lea    0xea8(%rip),%rdx
mov    $0x0,%al
call   1040 <myalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scopy>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
lea    0xebc(%rip),%rdx
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <myalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"type\00"
define i8* @scopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, i64, i8*, ...) bitcast (i32 (...)* @myalloc to i32 (i64, i64, i8*, ...)*)(i64 %6, i64 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"type\00"
define i8* @scopy(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, i64, i8*, ...) bitcast (i32 (...)* @myalloc to i32 (i64, i64, i8*, ...)*)(i64 %3, i64 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
char *g0(char **argv, int argc) { return argv[argc]; }


x86 assembly (clang, -O0):
<g0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g0>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i8* @g0(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 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @g0(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
char rand();
int64_t rand_signed64() {
  char bytes[8];
  for (int i = 0; i < 8; i++)
    bytes[i] = rand();
  return *(int64_t *)bytes;
}


x86 assembly (clang, -O0):
<rand_signed64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1148 <rand_signed64+0x38>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x8(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <rand_signed64+0xf>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_signed64>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
call   1030 <rand@plt>
movzbl %bl,%eax
shl    $0x18,%eax
movzbl %r15b,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movzbl %r14b,%edx
shl    $0x8,%edx
or     %ecx,%edx
movzbl %bpl,%eax
or     %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_signed64() {
%1 = alloca [8 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 8
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = call signext i8 (...) @rand()
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 %9
store i8 %7, i8* %10
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @rand_signed64() {
%1 = tail call signext i8 (...) @rand()
%2 = tail call signext i8 (...) @rand()
%3 = tail call signext i8 (...) @rand()
%4 = tail call signext i8 (...) @rand()
%5 = tail call signext i8 (...) @rand()
%6 = tail call signext i8 (...) @rand()
%7 = tail call signext i8 (...) @rand()
%8 = tail call signext i8 (...) @rand()
%9 = zext i8 %4 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %3 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %10, %12
%14 = zext i8 %2 to i32
%15 = shl nuw nsw i32 %14, 8
%16 = or i32 %13, %15
%17 = zext i8 %1 to i32
%18 = or i32 %16, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgpopptr(void) { gen("popl\t%edx"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"popl\09%edx\00"
define void @cgpopptr() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"popl\09%edx\00"
define void @cgpopptr() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo804() {}


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

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

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

LLVM IR (-O2):
define void @foo804() {
ret void
}
void do_chmod(filename, newmode) char *filename;
int newmode;
{
  if (chmod(filename, newmode) == -1)
    perror(filename);
}


x86 assembly (clang, -O0):
<do_chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <chmod@plt>
cmp    $0xffffffff,%eax
jne    1151 <do_chmod+0x31>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_chmod>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <chmod@plt>
cmp    $0xffffffff,%eax
je     1132 <do_chmod+0x12>
pop    %rbx
ret
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <perror@plt>

LLVM IR (-O0):
define void @do_chmod(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 = load i32, i32* %4
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @chmod to i32 (i8*, i32, ...)*)(i8* %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @do_chmod(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @chmod to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
br label %7
7: ; preds = %5, %2
ret void
}
extern int JMarray_dim(const int Jmax) { return Jmax * Jmax + 2 * Jmax + 1; }


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

x86 assembly (clang, -O2):
<JMarray_dim>:
lea    0x2(%rdi),%eax
imul   %edi,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @JMarray_dim(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 2, %6
%8 = add nsw i32 %5, %7
%9 = add nsw i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @JMarray_dim(i32 %0) {
%2 = add i32 %0, 2
%3 = mul i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
gen_multiply_by_two() { output_line("dad \th"); }


x86 assembly (clang, -O0):
<gen_multiply_by_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <output_line@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"dad \09h\00"
define i32 @gen_multiply_by_two() {
%1 = alloca i32
%2 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"dad \09h\00"
define i32 @gen_multiply_by_two() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
long GetMouseAbsX286();
long getmouseabsx() { return GetMouseAbsX286(); }


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

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

LLVM IR (-O0):
define i64 @getmouseabsx() {
%1 = call i64 (...) @GetMouseAbsX286()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getmouseabsx() {
%1 = tail call i64 (...) @GetMouseAbsX286()
ret i64 %1
}
/* Variables and functions */
int detect();
int /*<<< orphan*/ printf(char *);
void get_libname(void) {
  if (detect() == 1) {
    printf("p5600\n");
  } else {
    printf("mips\n");
  }
}


x86 assembly (clang, -O0):
<get_libname>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <detect@plt>
cmp    $0x1,%eax
jne    1145 <get_libname+0x25>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <get_libname+0x31>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_libname>:
push   %rax
xor    %eax,%eax
call   1040 <detect@plt>
cmp    $0x1,%eax
lea    0xed3(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"p5600\0A\00"
@.str.1 = [6 x i8] c"mips\0A\00"
define void @get_libname() {
%1 = call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"mips\00"
@str.2 = [6 x i8] c"p5600\00"
define void @get_libname() {
%1 = tail call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sio_mask(int, int, int, int);
int board_hp_dl145_g3_enable(void) {
  sio_mask(0xcd6, 0x44, 0x24, 0x24);
  return 0;
}


x86 assembly (clang, -O0):
<board_hp_dl145_g3_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcd6,%edi
mov    $0x44,%esi
mov    $0x24,%ecx
mov    %ecx,%edx
call   1030 <sio_mask@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_hp_dl145_g3_enable>:
push   %rax
mov    $0xcd6,%edi
mov    $0x44,%esi
mov    $0x24,%edx
mov    $0x24,%ecx
call   1030 <sio_mask@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @board_hp_dl145_g3_enable() {
%1 = call i32 @sio_mask(i32 3286, i32 68, i32 36, i32 36)
ret i32 0
}

LLVM IR (-O2):
define i32 @board_hp_dl145_g3_enable() {
%1 = tail call i32 @sio_mask(i32 3286, i32 68, i32 36, i32 36)
ret i32 0
}
void f_incomplete() {
  union U5;
  union U5 {
    char j;
  };
  if (1) {
    union U5;
    union U5 {
      char i;
      char j;
    };
    if (1) {
      union U5;
    }
  }
}


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

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

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

LLVM IR (-O2):
define void @f_incomplete() {
ret void
}