xunge/DecIR huggingface dataset:
int aqua_baldo() {
  int a0 = 32 * 5;
  int a1 = a0 % 11 - 2;
  int a2 = 11 % (6 + a1);
  return (1 - a0) + a1 % a2;
}


x86 assembly (clang, -O0):
<aqua_baldo>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
sub    $0x2,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x6,%ecx
mov    $0xb,%eax
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x10(%rbp),%eax
add    %edx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @aqua_baldo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 160, i32* %1
%4 = load i32, i32* %1
%5 = srem i32 %4, 11
%6 = sub nsw i32 %5, 2
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = add nsw i32 6, %7
%9 = srem i32 11, %8
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = sub nsw i32 1, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = srem i32 %12, %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @aqua_baldo() {
ret i32 -159
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ getIPString(struct sockaddr *);
int /*<<< orphan*/ logInternal(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sendGenError(struct sockaddr *);
void internalError(struct sockaddr *client, char *error, char *get) {
  char *ip;
  sendGenError(client);
  if (get != NULL)
    logInternal(getIPString(client), get);
  err(1, error);
}


x86 assembly (clang, -O0):
<internalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <sendGenError@plt>
cmpq   $0x0,-0x18(%rbp)
je     117c <internalError+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <getIPString@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1040 <logInternal@plt>
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1050 <err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internalError>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <sendGenError@plt>
test   %r15,%r15
je     116a <internalError+0x2a>
mov    %rbx,%rdi
call   1030 <getIPString@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1040 <logInternal@plt>
mov    $0x1,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <err@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define void @internalError(%struct.sockaddr* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sockaddr*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store %struct.sockaddr* %0, %struct.sockaddr** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load %struct.sockaddr*, %struct.sockaddr** %4
%9 = call i32 @sendGenError(%struct.sockaddr* %8)
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load %struct.sockaddr*, %struct.sockaddr** %4
%14 = call i32 @getIPString(%struct.sockaddr* %13)
%15 = load i8*, i8** %6
%16 = call i32 @logInternal(i32 %14, i8* %15)
br label %17
17: ; preds = %12, %3
%18 = load i8*, i8** %5
%19 = call i32 @err(i32 1, i8* %18)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @internalError(%struct.sockaddr* %0, i8* %1, i8* %2) {
%4 = tail call i32 @sendGenError(%struct.sockaddr* %0)
%5 = icmp eq i8* %2, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @getIPString(%struct.sockaddr* %0)
%8 = tail call i32 @logInternal(i32 %7, i8* %2)
br label %9
9: ; preds = %6, %3
%10 = tail call i32 @err(i32 1, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __infer_fail(char *);
void my_assert(int x) {
  if (!x) {
    __infer_fail("ASSERTION_FAILURE");
  }
}


x86 assembly (clang, -O0):
<my_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <my_assert+0x21>
lea    0xed4(%rip),%rdi
call   1030 <__infer_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_assert>:
test   %edi,%edi
je     1115 <my_assert+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <__infer_fail@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"ASSERTION_FAILURE\00"
define void @my_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @__infer_fail(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
extern char *char_star_to_char_star(char *s) {
  return s == (char *)0 ? (char *)0 : s + 1;
}


x86 assembly (clang, -O0):
<char_star_to_char_star>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111e <char_star_to_char_star+0x1e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    112a <char_star_to_char_star+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_star_to_char_star>:
lea    0x1(%rdi),%rax
test   %rdi,%rdi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @char_star_to_char_star(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
br label %9
9: ; preds = %6, %5
%10 = phi i8* [ null, %5 ], [ %8, %6 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @char_star_to_char_star(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = select i1 %2, i8* null, i8* %3
ret i8* %4
}
/* Type definitions */
struct timeval {
  long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long timeInNanos(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (((long long)tv.tv_sec)) + (tv.tv_usec);
}


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

x86 assembly (clang, -O2):
<timeInNanos>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @timeInNanos() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @timeInNanos() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
ret i64 %8
}
int main() {
  int a = 0;
  while (1) {
    if (a == 10000) {
      a = 0;
    } else {
      a = a + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jne    112b <main+0x2b>
movl   $0x0,-0x8(%rbp)
jmp    1134 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %0, %10
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 10000
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 0, i32* %2
br label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
void fun() {
  char str[7] = {'h', 'e', 'l', 'l', 'o', '\n', '\0'};
  char fmt[3] = {'%', 's', '\0'};
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xef0(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xee8(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xedf(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xed7(%rip),%al
mov    %al,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.fun.str = [7 x i8] c"hello\0A\00"
@__const.fun.fmt = [3 x i8] c"%s\00"
define void @fun() {
%1 = alloca [7 x i8]
%2 = alloca [3 x i8]
%3 = bitcast [7 x i8]* %1 to i8*
%4 = bitcast [3 x i8]* %2 to i8*
ret void
}

LLVM IR (-O2):
define void @fun() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseqx_set_progressive(uint8_t *p_mp2vseqx) { p_mp2vseqx[5] |= 0x8; }


x86 assembly (clang, -O0):
<mp2vseqx_set_progressive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
or     $0x8,%ecx
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_set_progressive>:
orb    $0x8,0x14(%rdi)
ret

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

LLVM IR (-O2):
define void @mp2vseqx_set_progressive(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = or i32 %3, 8
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_stdarg(int);
int main(int argc, char **argv) {
  if (test_stdarg(1) != 1) {
    printf("ERROR\n");
    return 1;
  }
  printf("All done.\n");
  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    $0x1,%edi
call   1040 <test_stdarg@plt>
cmp    $0x1,%eax
je     1161 <main+0x41>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1174 <main+0x54>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <test_stdarg@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bl
lea    0xec6(%rip),%rax
lea    0xec9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ERROR\0A\00"
@.str.1 = [11 x i8] c"All done.\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 = call i32 @test_stdarg(i32 1)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@str = [10 x i8] c"All done.\00"
@str.2 = [6 x i8] c"ERROR\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_stdarg(i32 1)
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = zext i1 %6 to i32
%8 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ qd_add_d(double const *, double, double *);
void qd_sub_qd_d(const double *a, double b, double *c) { qd_add_d(a, -b, c); }


x86 assembly (clang, -O0):
<qd_sub_qd_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rsi
call   1030 <qd_add_d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_sub_qd_d>:
xorps  0xee9(%rip),%xmm0
jmp    1030 <qd_add_d@plt>

LLVM IR (-O0):
define void @qd_sub_qd_d(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double, double* %5
%9 = fneg double %8
%10 = load double*, double** %6
%11 = call i32 @qd_add_d(double* %7, double %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @qd_sub_qd_d(double* %0, double %1, double* %2) {
%4 = fneg double %1
%5 = tail call i32 @qd_add_d(double* %0, double %4, double* %2)
ret void
}
/* Variables and functions */
size_t strlen(const char *s) { return 4; }


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

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

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 4
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture readnone %0) {
ret i64 4
}
/* 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, 4) == 4);
  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    $0x4,%edx
call   1030 <read@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2ec5(%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    $0x4,%edx
call   1030 <read@plt>
xor    %edi,%edi
cmp    $0x4,%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 4)
%6 = icmp eq i32 %5, 4
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* bitcast ([16 x i8]* @randomize.RB to i64*)
%10 = call i32 @srand48(i64 %9)
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 4)
%4 = icmp eq i32 %3, 4
%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 */
int /*<<< orphan*/ compilerAssert();
void chpl_incRefCountsForDomainsInArrayEltTypes2(void) {
  compilerAssert();
  return;
}


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

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

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

LLVM IR (-O2):
define void @chpl_incRefCountsForDomainsInArrayEltTypes2() {
%1 = tail call i32 (...) @compilerAssert()
ret void
}
int iswhitespace(char c) { return (c == ' ' || c == '\t' || c == '\n'); }


x86 assembly (clang, -O0):
<iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <iswhitespace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <iswhitespace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhitespace>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1111 <iswhitespace+0x11>
cmp    $0x20,%dil
jne    1112 <iswhitespace+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @iswhitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @iswhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int unix_ioctl(int, int /*<<< orphan*/, int);
void set_smem_log_flag(void) {
  int fd;
  int ret;
  fd = open("/proc/mlog", O_RDONLY);
  if (fd >= 0)
    ret = unix_ioctl(fd, 0, 2);
  close(fd);
}


x86 assembly (clang, -O0):
<set_smem_log_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     116c <set_smem_log_flag+0x3c>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <unix_ioctl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_smem_log_flag>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     115a <set_smem_log_flag+0x2a>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <unix_ioctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/proc/mlog\00"
@O_RDONLY = global i32 0
define void @set_smem_log_flag() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @unix_ioctl(i32 %8, i32 0, i32 2)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* %1
%12 = call i32 @close(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/proc/mlog\00"
@O_RDONLY = global i32 0
define void @set_smem_log_flag() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @unix_ioctl(i32 %2, i32 0, i32 2)
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @close(i32 %2)
ret void
}
int sum_array(int my_array[]) {
  int j;
  int highest;
  int smallest;
  for (j = 0; j < 3; j++) {
    if (my_array[j] > highest) {
      highest = my_array[j];
    }
    if (my_array[j] < smallest) {
      smallest = my_array[j];
    }
  }
  return (highest);
  return (smallest);
}


x86 assembly (clang, -O0):
<sum_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1170 <sum_array+0x70>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jle    113b <sum_array+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jge    115d <sum_array+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <sum_array+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sum_array+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sum_array(i32* nocapture %0) {
ret i32 undef
}
void make_access(void) {}


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

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

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

LLVM IR (-O2):
define void @make_access() {
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ outOfMemory();
void *safe_calloc(size_t size) {
  void *result = calloc(1, size);
  if (result == NULL)
    outOfMemory();
  return result;
}


x86 assembly (clang, -O0):
<safe_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <safe_calloc+0x30>
mov    $0x0,%al
call   1040 <outOfMemory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_calloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <safe_calloc+0x1d>
xor    %eax,%eax
call   1040 <outOfMemory@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_calloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @outOfMemory()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @safe_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @outOfMemory()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
long function(int test[]) {
  if (test == &test[0]) {
    if (test == &test) {
      return 0;
    }
    return 1;
  }
  return 2;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    %rcx,%rax
jne    1144 <function+0x44>
mov    -0x10(%rbp),%rax
lea    -0x10(%rbp),%rcx
cmp    %rcx,%rax
jne    1137 <function+0x37>
movq   $0x0,-0x8(%rbp)
jmp    114c <function+0x4c>
movq   $0x1,-0x8(%rbp)
jmp    114c <function+0x4c>
movq   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @function(i32* nocapture readnone %0) {
ret i64 1
}
void HAL_MspDeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @HAL_MspDeInit() {
ret void
}
int main(void) {
  {
    {
      while (1) {
      while_0_continue:;
        goto while_0_break;
      }
    while_0_break:;
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1110 <main+0x10>
jmp    1115 <main+0x15>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
br label %3
3: ; preds = %2
br label %4
4: ; preds = %3
ret i32 0
}

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


x86 assembly (clang, -O0):
<PIC18F4520_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <serial_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F4520_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC18F4520_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F4520_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Variables and functions */
int LINES;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ refresh();
int main() {
  initscr();
  clear();
  move(10, 20);
  addstr("hello word");
  move(LINES - 1, 0);
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1090 <move@plt>
lea    0xe5d(%rip),%rdi
call   1070 <addstr@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
sub    $0x1,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
xor    %eax,%eax
call   1080 <clear@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1090 <move@plt>
lea    0xe6b(%rip),%rdi
call   1070 <addstr@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
add    $0xffffffff,%edi
xor    %esi,%esi
call   1090 <move@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hello word\00"
@LINES = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 (...) @clear()
%4 = call i32 @move(i32 10, i32 20)
%5 = call i32 @addstr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @LINES
%7 = sub nsw i32 %6, 1
%8 = call i32 @move(i32 %7, i32 0)
%9 = call i32 (...) @refresh()
%10 = call i32 (...) @getch()
%11 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello word\00"
@LINES = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @clear()
%3 = tail call i32 @move(i32 10, i32 20)
%4 = tail call i32 @addstr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @LINES
%6 = add nsw i32 %5, -1
%7 = tail call i32 @move(i32 %6, i32 0)
%8 = tail call i32 (...) @refresh()
%9 = tail call i32 (...) @getch()
%10 = tail call i32 (...) @endwin()
ret i32 0
}
int icnvrt(double x, int ipwr2) { return ((int)(ipwr2 * x)); }


x86 assembly (clang, -O0):
<icnvrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icnvrt>:
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @icnvrt(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @icnvrt(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
int steps(int start) {
  if (start <= 0)
    return -1;
  int count = 0;
  while (start > 1) {
    if (start % 2 == 0)
      start /= 2;
    else
      start = (start * 3) + 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<steps>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <steps+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <steps+0x73>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116d <steps+0x6d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1155 <steps+0x55>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    115f <steps+0x5f>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <steps+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<steps>:
test   %edi,%edi
jle    1128 <steps+0x28>
xor    %eax,%eax
cmp    $0x1,%edi
je     1127 <steps+0x27>
xor    %eax,%eax
nopl   (%rax)
mov    %edi,%ecx
shr    %ecx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %ecx,%edi
add    $0x1,%eax
cmp    $0x1,%edi
jg     1110 <steps+0x10>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @steps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %28
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %23, %8
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %3
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* %3
%18 = sdiv i32 %17, 2
store i32 %18, i32* %3
br label %23
19: ; preds = %12
%20 = load i32, i32* %3
%21 = mul nsw i32 %20, 3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %19, %16
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %9
26: ; preds = %9
%27 = load i32, i32* %4
store i32 %27, i32* %2
br label %28
28: ; preds = %26, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @steps(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %16, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %14, %5 ], [ 0, %3 ]
%7 = phi i32 [ %13, %5 ], [ %0, %3 ]
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
%10 = lshr i32 %7, 1
%11 = mul nsw i32 %7, 3
%12 = add nsw i32 %11, 1
%13 = select i1 %9, i32 %10, i32 %12
%14 = add nuw nsw i32 %6, 1
%15 = icmp sgt i32 %13, 1
br i1 %15, label %5, label %16
16: ; preds = %5, %3, %1
%17 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %14, %5 ]
ret i32 %17
}
int isbinary(int c) { return c == '0' || c == '1'; }


x86 assembly (clang, -O0):
<isbinary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isbinary+0x20>
cmpl   $0x31,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbinary>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isbinary(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int fpclassify(double);
int __pruabi_fpclassify(double a) { return fpclassify(a); }


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

x86 assembly (clang, -O2):
<__pruabi_fpclassify>:
jmp    1030 <fpclassify@plt>

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

LLVM IR (-O2):
define i32 @__pruabi_fpclassify(double %0) {
%2 = tail call i32 @fpclassify(double %0)
ret i32 %2
}
/* Variables and functions */
double O1_y(double, double, double, double);
double O2_x(double sign, double xi, double et, double qq) {
  return O1_y(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<O2_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <O1_y@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<O2_x>:
jmp    1030 <O1_y@plt>

LLVM IR (-O0):
define double @O2_x(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @O1_y(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @O2_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @O1_y(double %0, double %1, double %2, double %3)
ret double %5
}
/* Variables and functions */
int lib_c(int);
int lib_b(int i) { return lib_c(i - 1) + 1; }


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

x86 assembly (clang, -O2):
<lib_b>:
push   %rax
add    $0xffffffff,%edi
call   1030 <lib_c@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lib_b(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @lib_c(i32 %2)
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *umalloc(int);
char *ustrdup2(const char *start, const char *fin) {
  int len = fin - start;
  char *d = umalloc(len + 1);
  strncpy(d, start, len);
  d[len] = '\0';
  return d;
}


x86 assembly (clang, -O0):
<ustrdup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <umalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrdup2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1040 <umalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ustrdup2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = call i8* @umalloc(i32 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = call i32 @strncpy(i8* %16, i8* %17, i32 %18)
%20 = load i8*, i8** %6
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @ustrdup2(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, 1
%8 = tail call i8* @umalloc(i32 %7)
%9 = tail call i32 @strncpy(i8* %8, i8* %0, i32 %6)
%10 = shl i64 %5, 32
%11 = ashr exact i64 %10, 32
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 0, i8* %12
ret i8* %8
}
void _Jv_LookupInterfaceMethodIdx() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_LookupInterfaceMethodIdx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
scalar_t__ dup2(int, int);
void xdup2(int o, int n) {
  if (dup2(o, n) < 0)
    die("dup2:");
}


x86 assembly (clang, -O0):
<xdup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
cmp    $0x0,%rax
jge    114f <xdup2+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdup2>:
push   %rax
call   1030 <dup2@plt>
test   %rax,%rax
js     112d <xdup2+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"dup2:\00"
define void @xdup2(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 i64 @dup2(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"dup2:\00"
define void @xdup2(i32 %0, i32 %1) {
%3 = tail call i64 @dup2(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
void X509_CRL_get_ext_by_OBJ(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CRL_get_ext_by_OBJ() {
ret void
}
/* Variables and functions */
int *get_random_arr(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quick_sort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ show(int *, int);
int main() {
  int len = 25;
  int *arr = get_random_arr(len);
  printf("ori\n");
  show(arr, len);
  quick_sort(arr, 0, len - 1);
  printf("sorted\n");
  show(arr, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x19,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <get_random_arr@plt>
mov    %rax,-0x10(%rbp)
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <show@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1060 <quick_sort@plt>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <show@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x19,%edi
call   1040 <get_random_arr@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
call   1050 <show@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1060 <quick_sort@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
call   1050 <show@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ori\0A\00"
@.str.1 = [8 x i8] c"sorted\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 25, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @get_random_arr(i32 %4)
store i32* %5, i32** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load i32, i32* %2
%9 = call i32 @show(i32* %7, i32 %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = call i32 @quick_sort(i32* %10, i32 0, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32*, i32** %3
%16 = load i32, i32* %2
%17 = call i32 @show(i32* %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"ori\00"
@str.2 = [7 x i8] c"sorted\00"
define i32 @main() {
%1 = tail call i32* @get_random_arr(i32 25)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @show(i32* %1, i32 25)
%4 = tail call i32 @quick_sort(i32* %1, i32 0, i32 24)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @show(i32* %1, i32 25)
ret i32 0
}
/* Type definitions */
struct nouveau_pushbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUFCTX(struct nouveau_pushbuf *);
int /*<<< orphan*/ nouveau_bufctx_reset(int /*<<< orphan*/, int);
void PUSH_RESET(struct nouveau_pushbuf *push, int bin) {
  nouveau_bufctx_reset(BUFCTX(push), bin);
}


x86 assembly (clang, -O0):
<PUSH_RESET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <BUFCTX@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <nouveau_bufctx_reset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUSH_RESET>:
push   %rbx
mov    %esi,%ebx
call   1040 <BUFCTX@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <nouveau_bufctx_reset@plt>

LLVM IR (-O0):
%struct.nouveau_pushbuf = type { i32 }
define void @PUSH_RESET(%struct.nouveau_pushbuf* %0, i32 %1) {
%3 = alloca %struct.nouveau_pushbuf*
%4 = alloca i32
store %struct.nouveau_pushbuf* %0, %struct.nouveau_pushbuf** %3
store i32 %1, i32* %4
%5 = load %struct.nouveau_pushbuf*, %struct.nouveau_pushbuf** %3
%6 = call i32 @BUFCTX(%struct.nouveau_pushbuf* %5)
%7 = load i32, i32* %4
%8 = call i32 @nouveau_bufctx_reset(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.nouveau_pushbuf = type { i32 }
define void @PUSH_RESET(%struct.nouveau_pushbuf* %0, i32 %1) {
%3 = tail call i32 @BUFCTX(%struct.nouveau_pushbuf* %0)
%4 = tail call i32 @nouveau_bufctx_reset(i32 %3, i32 %1)
ret void
}