xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;
typedef int mpfr_rnd_t;

/* Variables and functions */
int /*<<< orphan*/ mpfr_add_d(int /*<<< orphan*/, int /*<<< orphan*/, double,
                              int);
void mpfraddd(mpfr_t r2, mpfr_t r1, double *d, mpfr_rnd_t *irnd) {
  double d1;
  int n1;
  d1 = *d;
  n1 = *irnd;
  mpfr_add_d(r2, r1, d1, n1);
}


x86 assembly (clang, -O0):
<mpfraddd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%edx
call   1030 <mpfr_add_d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfraddd>:
movsd  (%rdx),%xmm0
mov    (%rcx),%edx
jmp    1030 <mpfr_add_d@plt>

LLVM IR (-O0):
define void @mpfraddd(i32 %0, i32 %1, double* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32*
%9 = alloca double
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32* %3, i32** %8
%11 = load double*, double** %7
%12 = load double, double* %11
store double %12, double* %9
%13 = load i32*, i32** %8
%14 = load i32, i32* %13
store i32 %14, i32* %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load double, double* %9
%18 = load i32, i32* %10
%19 = call i32 @mpfr_add_d(i32 %15, i32 %16, double %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @mpfraddd(i32 %0, i32 %1, double* nocapture %2, i32* nocapture %3) {
%5 = load double, double* %2
%6 = load i32, i32* %3
%7 = tail call i32 @mpfr_add_d(i32 %0, i32 %1, double %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int t[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, *p = t + 4;
  p += *p;
  printf("%d", *p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.t = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i32, i32* %9, i64 %10
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
void *cio_read(int);
void jpip_read_cptr() {
  int DR, CONT;
  long long Coff, codestream_size;
  DR = cio_read(2);
  CONT = cio_read(2);
  Coff = cio_read(8);
  codestream_size = cio_read(8);
}


x86 assembly (clang, -O0):
<jpip_read_cptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <cio_read@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1030 <cio_read@plt>
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jpip_read_cptr>:
push   %rax
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    $0x8,%edi
call   1030 <cio_read@plt>
mov    $0x8,%edi
pop    %rax
jmp    1030 <cio_read@plt>

LLVM IR (-O0):
define void @jpip_read_cptr() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = call i8* @cio_read(i32 2)
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %1
%7 = call i8* @cio_read(i32 2)
%8 = ptrtoint i8* %7 to i32
store i32 %8, i32* %2
%9 = call i8* @cio_read(i32 8)
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %3
%11 = call i8* @cio_read(i32 8)
%12 = ptrtoint i8* %11 to i64
store i64 %12, i64* %4
ret void
}

LLVM IR (-O2):
define void @jpip_read_cptr() {
%1 = tail call i8* @cio_read(i32 2)
%2 = tail call i8* @cio_read(i32 2)
%3 = tail call i8* @cio_read(i32 8)
%4 = tail call i8* @cio_read(i32 8)
ret void
}
/* Variables and functions */
float __rasind(float);
float r_asind(float *x) { return (__rasind(*x)); }


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

x86 assembly (clang, -O2):
<r_asind>:
movss  (%rdi),%xmm0
jmp    1030 <__rasind@plt>

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

LLVM IR (-O2):
define float @r_asind(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @__rasind(float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
char *strdup(char const *);
scalar_t__ strlen(char const *);
char *sal_strdup(const char *s) {
  char *ptr;
  if (s == NULL)
    return NULL;
  ptr = strdup(s);
  if (ptr == NULL) {
    printf("Cannot alloc %d bytes.\n", (int)strlen(s));
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<sal_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <sal_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    11a5 <sal_strdup+0x65>
mov    -0x10(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    119d <sal_strdup+0x5d>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sal_strdup>:
push   %rbx
test   %rdi,%rdi
je     1155 <sal_strdup+0x15>
mov    %rdi,%rbx
call   1060 <strdup@plt>
test   %rax,%rax
je     1159 <sal_strdup+0x19>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Cannot alloc %d bytes.\0A\00"
define i8* @sal_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %21
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @strlen(i8* %14)
%16 = trunc i64 %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %8
%20 = load i8*, i8** %4
store i8* %20, i8** %2
br label %21
21: ; preds = %19, %7
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
@.str = [24 x i8] c"Cannot alloc %d bytes.\0A\00"
define noalias i8* @sal_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i64 @strlen(i8* %0)
%8 = trunc i64 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %3, %1
%12 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %12
}
f(int p) { return p && 1; }


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

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @f(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 %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = phi i1 [ false, %1 ], [ true, %5 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_filled_rectangle(int /*<<< orphan*/, float, float, float,
                                       float);
void g2_filled_rectangle_(float *dev, float *x1, float *y1, float *x2,
                          float *y2) {
  g2_filled_rectangle(dtoi(*dev), *x1, *y1, *x2, *y2);
}


x86 assembly (clang, -O0):
<g2_filled_rectangle_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm3
call   1040 <g2_filled_rectangle@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_filled_rectangle_>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
movss  (%rbx),%xmm0
movss  (%r12),%xmm1
movss  (%r15),%xmm2
movss  (%r14),%xmm3
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <g2_filled_rectangle@plt>

LLVM IR (-O0):
define void @g2_filled_rectangle_(float* %0, float* %1, float* %2, float* %3, float* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = call i32 @dtoi(float %12)
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = load float*, float** %8
%17 = load float, float* %16
%18 = load float*, float** %9
%19 = load float, float* %18
%20 = load float*, float** %10
%21 = load float, float* %20
%22 = call i32 @g2_filled_rectangle(i32 %13, float %15, float %17, float %19, float %21)
ret void
}

LLVM IR (-O2):
define void @g2_filled_rectangle_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4) {
%6 = load float, float* %0
%7 = tail call i32 @dtoi(float %6)
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = load float, float* %4
%12 = tail call i32 @g2_filled_rectangle(i32 %7, float %8, float %9, float %10, float %11)
ret void
}
unsigned long hash(const char *str) {
  unsigned long hash = 5381;
  int c = 0;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1151 <hash+0x51>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hash+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = mul i64 %6, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
long get_word();
int /*<<< orphan*/ tokenize_one_word(long);
void tokenize(void) {
  signed long wlen = 0;
  while (wlen >= 0) {
    wlen = get_word();
    if (wlen > 0) {
      tokenize_one_word(wlen);
    }
  }
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     115f <tokenize+0x3f>
mov    $0x0,%al
call   1040 <get_word@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    115a <tokenize+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <tokenize_one_word@plt>
jmp    1130 <tokenize+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenize>:
push   %rbx
jmp    1135 <tokenize+0x15>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %rbx,%rbx
js     114e <tokenize+0x2e>
xor    %eax,%eax
call   1040 <get_word@plt>
mov    %rax,%rbx
test   %rax,%rax
jle    1130 <tokenize+0x10>
mov    %rbx,%rdi
call   1030 <tokenize_one_word@plt>
jmp    1130 <tokenize+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @tokenize() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %12, %0
%3 = load i64, i64* %1
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = call i64 (...) @get_word()
store i64 %6, i64* %1
%7 = load i64, i64* %1
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i64, i64* %1
%11 = call i32 @tokenize_one_word(i64 %10)
br label %12
12: ; preds = %9, %5
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @tokenize() {
br label %1
1: ; preds = %0, %6
%2 = tail call i64 (...) @get_word()
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @tokenize_one_word(i64 %2)
br label %6
6: ; preds = %4, %1
%7 = icmp sgt i64 %2, -1
br i1 %7, label %1, label %8
8: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_int_to_robot(double);
int main() {
  send_int_to_robot(1.1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <send_int_to_robot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @send_int_to_robot(double 1.100000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @send_int_to_robot(double 1.100000e+00)
ret i32 0
}
void mlb_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @mlb_iomux_config() {
ret void
}
int sign(const int x) {
  if (x == 0) {
    return 0;
  }
  return x > 0 ? 1 : -1;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <sign+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1133 <sign+0x33>
mov    -0x8(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @sign(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 -1
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 -1, i32 1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void scsi_unregister_module(void) { panic("scsi_unregister_module"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"scsi_unregister_module\00"
define void @scsi_unregister_module() {
%1 = call i32 @panic(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"scsi_unregister_module\00"
define void @scsi_unregister_module() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
double Sleef_log1p_u10(double x) { return __builtin_log1p(x); }


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

x86 assembly (clang, -O2):
<Sleef_log1p_u10>:
jmp    1030 <log1p@plt>

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

LLVM IR (-O2):
define double @Sleef_log1p_u10(double %0) {
%2 = tail call double @log1p(double %0)
ret double %2
}
int whitespace(int c) {
  return ((c == ' ') || (c == '\r') || (c == '\n') || (c == '\t'));
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <whitespace+0x3e>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <whitespace+0x3e>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <whitespace+0x3e>
cmpl   $0x9,-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):
<whitespace>:
cmp    $0x20,%edi
ja     111d <whitespace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    111d <whitespace+0x1d>
ret
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @whitespace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 10, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u3() { return (rand() & 0x7); }


x86 assembly (clang, -O0):
<mk_rnd_u3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_u3>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u3() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 7
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u3() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 7
ret i8 %3
}
int increment(int idx, int capacity) { return (idx + 1) % capacity; }


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
lea    0x1(%rdi),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @increment(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 = add nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @increment(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = srem i32 %3, %1
ret i32 %4
}
int main() {
  unsigned int a = 0x11223344;
  unsigned int b = 0;
  __builtin_memcpy(&a, &b, sizeof(a));
  return a != b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x11223344,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 287454020, i32* %2
store i32 0, i32* %3
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int write(int, char *, int);
int my_putchar(char c) { return (write(1, &c, 1)); }


x86 assembly (clang, -O0):
<my_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 %3
}

LLVM IR (-O2):
define i32 @my_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 %3
}
ISR(TIMER1_OVF_vect) {
  DEBUG("ISR "
        "TIMER1_OVF"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"ISR TIMER1_OVF occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [23 x i8] c"ISR TIMER1_OVF occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ map_read();
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ source_map_destroy();
void sighup() {
  source_map_destroy();
  map_read();
  signal(SIGHUP, sighup);
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <source_map_destroy@plt>
mov    $0x0,%al
call   1040 <map_read@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2e8e(%rip),%rsi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
xor    %eax,%eax
call   1050 <source_map_destroy@plt>
xor    %eax,%eax
call   1040 <map_read@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    0x2e91(%rip),%rsi
pop    %rax
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGHUP = global i32 0
define void @sighup() {
%1 = call i32 (...) @source_map_destroy()
%2 = call i32 (...) @map_read()
%3 = load i32, i32* @SIGHUP
%4 = call i32 @signal(i32 %3, void (...)* bitcast (void ()* @sighup to void (...)*))
ret void
}

LLVM IR (-O2):
@SIGHUP = global i32 0
define void @sighup() {
%1 = tail call i32 (...) @source_map_destroy()
%2 = tail call i32 (...) @map_read()
%3 = load i32, i32* @SIGHUP
%4 = tail call i32 @signal(i32 %3, void (...)* bitcast (void ()* @sighup to void (...)*))
ret void
}
unsigned int test_eq_int(int a, int b) {
  if (a != b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test_eq_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1122 <test_eq_int+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <test_eq_int+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eq_int>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test_eq_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_eq_int(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef union vec3 {
  int dummy;
} vec3;

/* Variables and functions */
union vec3 *vec3_add(union vec3 *, union vec3 *, union vec3 const *);
union vec3 *vec3_add_self(union vec3 *v1, const union vec3 *v2) {
  return vec3_add(v1, v1, v2);
}


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

x86 assembly (clang, -O2):
<vec3_add_self>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <vec3_add@plt>

LLVM IR (-O0):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_add_self(%union.vec3* %0, %union.vec3* %1) {
%3 = alloca %union.vec3*
%4 = alloca %union.vec3*
store %union.vec3* %0, %union.vec3** %3
store %union.vec3* %1, %union.vec3** %4
%5 = load %union.vec3*, %union.vec3** %3
%6 = load %union.vec3*, %union.vec3** %3
%7 = load %union.vec3*, %union.vec3** %4
%8 = call %union.vec3* @vec3_add(%union.vec3* %5, %union.vec3* %6, %union.vec3* %7)
ret %union.vec3* %8
}

LLVM IR (-O2):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_add_self(%union.vec3* %0, %union.vec3* %1) {
%3 = tail call %union.vec3* @vec3_add(%union.vec3* %0, %union.vec3* %0, %union.vec3* %1)
ret %union.vec3* %3
}
int Inverte(int n) {
  int l = 0, j;
  while (n != 0) {
    j = n % 10;
    l = (l * 10) + j;
    n /= 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<Inverte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <Inverte+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <Inverte+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Inverte>:
xor    %eax,%eax
test   %edi,%edi
je     113f <Inverte+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <Inverte+0x10>
ret

LLVM IR (-O0):
define i32 @Inverte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = srem i32 %9, 10
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 10
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 10
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @Inverte(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
__attribute__((weak)) void fd_nrf8001_broadcast_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_broadcast_success() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c_prt(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ format(char *, int /*<<< orphan*/);
int /*<<< orphan*/ message_color(int /*<<< orphan*/);
int /*<<< orphan*/ message_str(int /*<<< orphan*/);
void do_cmd_message_one(void) {
  c_prt(message_color(0), format("> %s", message_str(0)), 0, 0);
}


x86 assembly (clang, -O0):
<do_cmd_message_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <message_color@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1050 <message_str@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <format@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <c_prt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_message_one>:
push   %rbx
xor    %edi,%edi
call   1060 <message_color@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <message_str@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1040 <format@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <c_prt@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"> %s\00"
define void @do_cmd_message_one() {
%1 = call i32 @message_color(i32 0)
%2 = call i32 @message_str(i32 0)
%3 = call i32 @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @c_prt(i32 %1, i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"> %s\00"
define void @do_cmd_message_one() {
%1 = tail call i32 @message_color(i32 0)
%2 = tail call i32 @message_str(i32 0)
%3 = tail call i32 @format(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @c_prt(i32 %1, i32 %3, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, short const);
bool cutils_cdar_DynamicArray_short_format(const short *i, char **b,
                                           size_t *s) {
  snprintf(*b, *s, "%hd", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_short_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
lea    0xec3(%rip),%rdx
movswl (%rax),%ecx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_short_format>:
push   %rax
mov    (%rsi),%rax
mov    (%rdx),%rsi
movswl (%rdi),%ecx
lea    0xedf(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%hd\00"
define i32 @cutils_cdar_DynamicArray_short_format(i16* %0, i8** %1, i64* %2) {
%4 = alloca i16*
%5 = alloca i8**
%6 = alloca i64*
store i16* %0, i16** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load i16*, i16** %4
%12 = load i16, i16* %11
%13 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%hd\00"
define i32 @cutils_cdar_DynamicArray_short_format(i16* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load i16, i16* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %6)
ret i32 1
}
unsigned long reInitializeSignal() { return 0x7fffff; }


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

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

LLVM IR (-O0):
define i64 @reInitializeSignal() {
ret i64 8388607
}

LLVM IR (-O2):
define i64 @reInitializeSignal() {
ret i64 8388607
}
int test_imm_B7int8_mem(signed char *val) {
  return ((*val) & (0xB7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B7int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 183
%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_B7int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -73
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ pause();
void *start0(void *arg) {
  pause();
  assert(0);
}


x86 assembly (clang, -O0):
<start0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pause@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start0>:
push   %rax
xor    %eax,%eax
call   1040 <pause@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define i8* @start0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pause()
%5 = call i32 @assert(i32 0)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @start0(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pause()
%3 = tail call i32 @assert(i32 0)
ret i8* undef
}
/* Variables and functions */
int *f();
int main(void) { int *p = f(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @f()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gmp_default_free(void *p, size_t unused_size) { free(p); }


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

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

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

LLVM IR (-O2):
define void @gmp_default_free(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
unsigned long read_cr0();
int /*<<< orphan*/ write_cr0(unsigned long);
void set_cr0_wp(int wp) {
  unsigned long cr0 = read_cr0();
  cr0 &= ~(1UL << 16);
  if (wp)
    cr0 |= (1UL << 16);
  write_cr0(cr0);
}


x86 assembly (clang, -O0):
<set_cr0_wp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <read_cr0@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffeffff,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115c <set_cr0_wp+0x3c>
mov    -0x10(%rbp),%rax
or     $0x10000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <write_cr0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cr0_wp>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
setne  %bl
xor    %eax,%eax
call   1040 <read_cr0@plt>
and    $0xfffffffffffeffff,%rax
shl    $0x10,%rbx
or     %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <write_cr0@plt>

LLVM IR (-O0):
define void @set_cr0_wp(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 (...) @read_cr0()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = and i64 %5, -65537
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* %3
%11 = or i64 %10, 65536
store i64 %11, i64* %3
br label %12
12: ; preds = %9, %1
%13 = load i64, i64* %3
%14 = call i32 @write_cr0(i64 %13)
ret void
}

LLVM IR (-O2):
define void @set_cr0_wp(i32 %0) {
%2 = tail call i64 (...) @read_cr0()
%3 = and i64 %2, -65537
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i64 0, i64 65536
%6 = or i64 %3, %5
%7 = tail call i32 @write_cr0(i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SelectionSort(int *, int);
int __VERIFIER_nondet_int();
int main() {
  int *a;
  int array_size = __VERIFIER_nondet_int();
  SelectionSort(a, array_size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <SelectionSort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = call i32 @SelectionSort(i32* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @SelectionSort(i32* undef, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ subFetchAndInitLevelA();
void subFetchAndInitLevelB() { subFetchAndInitLevelA(); }


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

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

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

LLVM IR (-O2):
define void @subFetchAndInitLevelB() {
%1 = tail call i32 (...) @subFetchAndInitLevelA()
ret void
}
void dfn_acd(_Complex double d) {}


x86 assembly (clang, -O0):
<dfn_acd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dfn_acd(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
ret void
}

LLVM IR (-O2):
define void @dfn_acd(double %0, double %1) {
ret void
}
/* Variables and functions */
int htoi(char *, int);
int htoi_bin(char *s) { return htoi(s, 2); }


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

x86 assembly (clang, -O2):
<htoi_bin>:
mov    $0x2,%esi
jmp    1030 <htoi@plt>

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

LLVM IR (-O2):
define i32 @htoi_bin(i8* %0) {
%2 = tail call i32 @htoi(i8* %0, i32 2)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
float wcstof(const wchar_t *nptr, wchar_t **endptr) {
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<wcstof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstof>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @wcstof(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = call i32 @assert(i32 0)
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @wcstof(i32* nocapture readnone %0, i32** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret float 0.000000e+00
}
void rop3_52_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D & S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_52_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_52_0_0>:
mov    (%rdi),%al
and    %sil,%al
or     %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_52_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = load i8*, i8** %4
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @rop3_52_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
void TransposeWx8_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @TransposeWx8_SSSE3() {
ret void
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ drm_mode_config_cleanup(struct drm_device *);
void intel_modeset_cleanup(struct drm_device *dev) {
  drm_mode_config_cleanup(dev);
}


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

x86 assembly (clang, -O2):
<intel_modeset_cleanup>:
jmp    1030 <drm_mode_config_cleanup@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define void @intel_modeset_cleanup(%struct.drm_device* %0) {
%2 = alloca %struct.drm_device*
store %struct.drm_device* %0, %struct.drm_device** %2
%3 = load %struct.drm_device*, %struct.drm_device** %2
%4 = call i32 @drm_mode_config_cleanup(%struct.drm_device* %3)
ret void
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define void @intel_modeset_cleanup(%struct.drm_device* %0) {
%2 = tail call i32 @drm_mode_config_cleanup(%struct.drm_device* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_pointer(void *pointer) {
  if (pointer != NULL) {
    free(pointer);
  }
}


x86 assembly (clang, -O0):
<free_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_pointer+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_pointer>:
test   %rdi,%rdi
je     111a <free_pointer+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_pointer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_pointer(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}