xunge/DecIR huggingface dataset:
int utf8len(char ch) {
  unsigned char uc = (unsigned char)ch;
  if (uc >= 0xFC)
    return (6);
  else if (uc >= 0xF8)
    return (5);
  else if (uc >= 0xF0)
    return (4);
  else if (uc >= 0xE0)
    return (3);
  else if (uc >= 0xC0)
    return (2);
  else
    return (1);
}


x86 assembly (clang, -O0):
<utf8len>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0xfc,%eax
jl     112b <utf8len+0x2b>
movl   $0x6,-0x4(%rbp)
jmp    119e <utf8len+0x9e>
movzbl -0x6(%rbp),%eax
cmp    $0xf8,%eax
jl     1146 <utf8len+0x46>
movl   $0x5,-0x4(%rbp)
jmp    119e <utf8len+0x9e>
movzbl -0x6(%rbp),%eax
cmp    $0xf0,%eax
jl     1161 <utf8len+0x61>
movl   $0x4,-0x4(%rbp)
jmp    119e <utf8len+0x9e>
movzbl -0x6(%rbp),%eax
cmp    $0xe0,%eax
jl     117c <utf8len+0x7c>
movl   $0x3,-0x4(%rbp)
jmp    119e <utf8len+0x9e>
movzbl -0x6(%rbp),%eax
cmp    $0xc0,%eax
jl     1197 <utf8len+0x97>
movl   $0x2,-0x4(%rbp)
jmp    119e <utf8len+0x9e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8len>:
mov    $0x6,%eax
cmp    $0xfb,%dil
ja     1138 <utf8len+0x38>
mov    $0x5,%eax
cmp    $0xf7,%dil
ja     1138 <utf8len+0x38>
mov    $0x4,%eax
cmp    $0xef,%dil
ja     1138 <utf8len+0x38>
mov    $0x3,%eax
cmp    $0xdf,%dil
ja     1138 <utf8len+0x38>
cmp    $0xc0,%dil
mov    $0x1,%eax
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @utf8len(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
store i8 %5, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp sge i32 %7, 252
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 6, i32* %2
br label %31
10: ; preds = %1
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp sge i32 %12, 248
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 5, i32* %2
br label %31
15: ; preds = %10
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = icmp sge i32 %17, 240
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 4, i32* %2
br label %31
20: ; preds = %15
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = icmp sge i32 %22, 224
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 3, i32* %2
br label %31
25: ; preds = %20
%26 = load i8, i8* %4
%27 = zext i8 %26 to i32
%28 = icmp sge i32 %27, 192
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 2, i32* %2
br label %31
30: ; preds = %25
store i32 1, i32* %2
br label %31
31: ; preds = %30, %29, %24, %19, %14, %9
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @utf8len(i8 signext %0) {
%2 = icmp ugt i8 %0, -5
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ugt i8 %0, -9
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = icmp ugt i8 %0, -17
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ugt i8 %0, -33
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ugt i8 %0, -65
%11 = select i1 %10, i32 2, i32 1
br label %12
12: ; preds = %9, %7, %5, %3, %1
%13 = phi i32 [ 6, %1 ], [ 5, %3 ], [ 4, %5 ], [ 3, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, int /*<<< orphan*/ *, int);
float int32_to_eh_float32(int32_t i) {
  float f;
  memcpy(&f, &i, sizeof(float));
  return f;
}


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

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

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

LLVM IR (-O2):
define float @int32_to_eh_float32(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = bitcast float* %3 to i8*
%5 = call i32 @memcpy(float* %3, i32* %2, i32 4)
%6 = load float, float* %3
ret float %6
}
int networkInterrogate() {}


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

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

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

LLVM IR (-O2):
define i32 @networkInterrogate() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_shutdown(int /*<<< orphan*/ *);
int ssl_close(void *sl) {
  SSL *ssl = (SSL *)sl;
  SSL_shutdown(ssl);
  SSL_free(ssl);
  return 0;
}


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

x86 assembly (clang, -O2):
<ssl_close>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SSL_shutdown@plt>
mov    %rbx,%rdi
call   1030 <SSL_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ssl_close(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @SSL_shutdown(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @SSL_free(i32* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @ssl_close(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @SSL_shutdown(i32* %2)
%4 = tail call i32 @SSL_free(i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int valor = 0;
  printf("Digite um valor: ");
  scanf("%d", &valor);
  system("/usr/bin/clear");
  ;
  printf("O valor digitado foi: %d", valor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
call   1030 <system@plt>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <system@plt>
mov    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Digite um valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"/usr/bin/clear\00"
@.str.3 = [25 x i8] c"O valor digitado foi: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Digite um valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"/usr/bin/clear\00"
@.str.3 = [25 x i8] c"O valor digitado foi: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %6)
ret i32 0
}
int main_called() { return 6; }


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

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

LLVM IR (-O0):
define i32 @main_called() {
ret i32 6
}

LLVM IR (-O2):
define i32 @main_called() {
ret i32 6
}
unsigned int saturate(int n, int bitdepth) {
  return (((1 << bitdepth) - 1) < (((0) > (n) ? (0) : (n)))
              ? ((1 << bitdepth) - 1)
              : (((0) > (n) ? (0) : (n))));
}


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jle    112f <saturate+0x2f>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <saturate+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    1158 <saturate+0x58>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1179 <saturate+0x79>
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jle    116d <saturate+0x6d>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    1173 <saturate+0x73>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
mov    %esi,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
not    %edx
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @saturate(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = icmp sgt i32 %0, 0
%6 = select i1 %5, i32 %0, i32 0
%7 = icmp sgt i32 %6, %4
%8 = select i1 %7, i32 %4, i32 %6
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  double *a;
  a = (double *)malloc(sizeof(double) * (1024 * 1024));
  for (int i = 0; i < 1024; i++) {
#pragma acc enter data copyin(a [0:N])
#pragma acc exit data delete (a [0:N])
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x800000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1154 <main+0x44>
jmp    1146 <main+0x36>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 8388608)
%5 = inttoptr i64 %4 to double*
store double* %5, double** %2
store i32 0, i32* %3
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1024
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %6
13: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 8388608)
ret i32 0
}
/* Variables and functions */
unsigned long THRandom_seed();
unsigned long Random_seed() { return THRandom_seed(); }


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

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

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

LLVM IR (-O2):
define i64 @Random_seed() {
%1 = tail call i64 (...) @THRandom_seed()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exynos_5410_gpio_write_mask(unsigned int, unsigned int,
                                               unsigned int);
void odroid_xu_gpio_write_23(unsigned int data) {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 2;
  exynos_5410_gpio_write_mask(bank_offset, ((data & 1U) << bit_index),
                              (1U << bit_index));
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_write_23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xc40,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
and    $0x1,%esi
mov    -0xc(%rbp),%ecx
shl    %cl,%esi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1030 <exynos_5410_gpio_write_mask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_write_23>:
lea    0x0(,%rdi,4),%esi
and    $0x4,%esi
mov    $0xc40,%edi
mov    $0x4,%edx
jmp    1030 <exynos_5410_gpio_write_mask@plt>

LLVM IR (-O0):
define void @odroid_xu_gpio_write_23(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 3136, i32* %3
store i32 2, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = call i32 @exynos_5410_gpio_write_mask(i32 %5, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @odroid_xu_gpio_write_23(i32 %0) {
%2 = shl i32 %0, 2
%3 = and i32 %2, 4
%4 = tail call i32 @exynos_5410_gpio_write_mask(i32 3136, i32 %3, i32 4)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_dobldobl_multi_homogenization(int m) {
  int fail;
  int b;
  double c;
  fail = _ada_use_c2phc4c(911, &m, &b, &c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_dobldobl_multi_homogenization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x38f,%edi
lea    -0x4(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_dobldobl_multi_homogenization>:
sub    $0x18,%rsp
mov    %edi,0x8(%rsp)
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x38f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @solcon_dobldobl_multi_homogenization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %2
%6 = call i32 @_ada_use_c2phc4c(i32 911, i32* %2, i32* %4, double* %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @solcon_dobldobl_multi_homogenization(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
%5 = bitcast i32* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @_ada_use_c2phc4c(i32 911, i32* %2, i32* %3, double* %4, i32 0)
ret i32 %7
}
/* Variables and functions */
float gegl_floorf(float);
float gegl_ceilf(float x) { return -gegl_floorf(-x); }


x86 assembly (clang, -O0):
<gegl_ceilf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <gegl_floorf@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gegl_ceilf>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <gegl_floorf@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @gegl_ceilf(float %0) {
%2 = fneg float %0
%3 = tail call float @gegl_floorf(float %2)
%4 = fneg float %3
ret float %4
}
/* Type definitions */
struct DSPObject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct DSPObject *);
void dsp_fetchinstr_dispose(struct DSPObject *obj0) {
  if (obj0) {
    free(obj0);
  }
}


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

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

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

LLVM IR (-O2):
%struct.DSPObject = type { i32 }
define void @dsp_fetchinstr_dispose(%struct.DSPObject* %0) {
%2 = icmp eq %struct.DSPObject* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.DSPObject* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int *malloc(int);
int *generate_empty_board(int N) {
  int *row;
  row = malloc(sizeof(int) * N);
  for (int i = 0; i < N; ++i)
    row[i] = -1;
  return row;
}


x86 assembly (clang, -O0):
<generate_empty_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <generate_empty_board+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <generate_empty_board+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_empty_board>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    114c <generate_empty_board+0x2c>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r14,%rdi
mov    $0xff,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i32* @generate_empty_board(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = bitcast i32* %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %1
ret i32* %3
}
signed long int signedlongint_id(signed long int x) { return x; }


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

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

LLVM IR (-O0):
define i64 @signedlongint_id(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @signedlongint_id(i64 returned %0) {
ret i64 %0
}
int Media_Flush() { return 1; }


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

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

LLVM IR (-O0):
define i32 @Media_Flush() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Media_Flush() {
ret i32 1
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *hash_key_dup(const void *key, size_t key_size) {
  void *new_key = malloc(key_size);
  memcpy(new_key, key, key_size);
  return new_key;
}


x86 assembly (clang, -O0):
<hash_key_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @hash_key_dup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @hash_key_dup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, long);
void *checkedMalloc(size_t size) {
  void *retVal = malloc(size);
  if ((!retVal) && size) {
    printf("malloc failed size %ld\n", (long)size);
    abort();
  }
  return retVal;
}


x86 assembly (clang, -O0):
<checkedMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <checkedMalloc+0x46>
cmpq   $0x0,-0x8(%rbp)
je     1176 <checkedMalloc+0x46>
mov    -0x8(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkedMalloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <malloc@plt>
test   %rbx,%rbx
je     1143 <checkedMalloc+0x13>
test   %rax,%rax
je     1145 <checkedMalloc+0x15>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"malloc failed size %ld\0A\00"
define i8* @checkedMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i64, i64* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %8, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [24 x i8] c"malloc failed size %ld\0A\00"
define noalias i8* @checkedMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
ret i8* %2
}
void d(int v) { int z = v; }


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

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

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

LLVM IR (-O2):
define void @d(i32 %0) {
ret void
}
void func2(void) {
Label2_1:;
  enum enumTag {
    e = 1,
  } enumVar = e;
Label2_2:;
  struct structTag {
    int i1;
    int i2;
  } structVar = {e, enumVar};
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.structTag = type { i32, i32 }
define void @func2() {
%1 = alloca i32
%2 = alloca %struct.structTag
br label %3
3: ; preds = %0
store i32 1, i32* %1
br label %4
4: ; preds = %3
%5 = getelementptr inbounds %struct.structTag, %struct.structTag* %2, i32 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.structTag, %struct.structTag* %2, i32 0, i32 1
%7 = load i32, i32* %1
store i32 %7, i32* %6
ret void
}

LLVM IR (-O2):
define void @func2() {
ret void
}
unsigned avcodec_version(void) { return 0x000408; }


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

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

LLVM IR (-O0):
define i32 @avcodec_version() {
ret i32 1032
}

LLVM IR (-O2):
define i32 @avcodec_version() {
ret i32 1032
}
/* Variables and functions */
float sin_f(float);
float cos_f(float x) { return (sin_f(x + 1.5707963267948966f)); }


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

x86 assembly (clang, -O2):
<cos_f>:
addss  0xee8(%rip),%xmm0
jmp    1030 <sin_f@plt>

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

LLVM IR (-O2):
define float @cos_f(float %0) {
%2 = fadd float %0, 0x3FF921FB60000000
%3 = tail call float @sin_f(float %2)
ret float %3
}
int bits_next(int bits) {
  bits++;
  if (bits > 8)
    bits = 5;
  return bits;
}


x86 assembly (clang, -O0):
<bits_next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jle    1121 <bits_next+0x21>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_next>:
lea    0x1(%rdi),%ecx
cmp    $0x8,%edi
mov    $0x5,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_next(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = icmp sgt i32 %0, 7
%4 = select i1 %3, i32 5, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _pwd_error(char const *message, int ret) {
  fputs("pwd"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_pwd_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pwd_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pwd: \00"
@stderr = global i32 0
define i32 @_pwd_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"pwd: \00"
@stderr = global i32 0
define i32 @_pwd_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exec_once_init();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("start to init exec_once\n");
  exec_once_init();
  printf("after init exec_once\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)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <exec_once_init@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <exec_once_init@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"start to init exec_once\0A\00"
@.str.1 = [22 x i8] c"after init exec_once\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 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @exec_once_init()
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"start to init exec_once\00"
@str.2 = [21 x i8] c"after init exec_once\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @exec_once_init()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
unsigned int _set(unsigned int src2, unsigned int csta, unsigned int cstb) {
  csta &= 0x1f;
  cstb &= 0x1f;
  if (csta > cstb)
    return src2;
  else {
    unsigned int mask = (((1 << (cstb - csta)) << 1) - 1) << csta;
    return src2 | mask;
  }
}


x86 assembly (clang, -O0):
<_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jbe    1136 <_set+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <_set+0x5a>
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set>:
mov    %edi,%eax
and    $0x1f,%esi
and    $0x1f,%edx
sub    %esi,%edx
jb     111e <_set+0x1e>
mov    $0x2,%edi
mov    %edx,%ecx
shl    %cl,%edi
add    $0xffffffff,%edi
mov    %esi,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = and i32 %9, 31
store i32 %10, i32* %6
%11 = load i32, i32* %7
%12 = and i32 %11, 31
store i32 %12, i32* %7
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = icmp ugt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load i32, i32* %5
store i32 %17, i32* %4
br label %30
18: ; preds = %3
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = sub i32 %19, %20
%22 = shl i32 1, %21
%23 = shl i32 %22, 1
%24 = sub nsw i32 %23, 1
%25 = load i32, i32* %6
%26 = shl i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %5
%28 = load i32, i32* %8
%29 = or i32 %27, %28
store i32 %29, i32* %4
br label %30
30: ; preds = %18, %16
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @_set(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 31
%5 = and i32 %2, 31
%6 = icmp ult i32 %5, %4
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = sub nsw i32 %5, %4
%9 = shl i32 2, %8
%10 = add nsw i32 %9, -1
%11 = shl i32 %10, %4
%12 = or i32 %11, %0
br label %13
13: ; preds = %3, %7
%14 = phi i32 [ %12, %7 ], [ %0, %3 ]
ret i32 %14
}
/* Variables and functions */
double genrand64_real1();
int genrand64_int1(unsigned int maxint) {
  return (int)(genrand64_real1() * (double)maxint + 0.5);
}


x86 assembly (clang, -O0):
<genrand64_int1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
call   1030 <genrand64_real1@plt>
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand64_int1>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <genrand64_real1@plt>
mov    %ebx,%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xed3(%rip),%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @genrand64_int1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call double (...) @genrand64_real1()
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to double
%6 = call double @llvm.fmuladd.f64(double %3, double %5, double 5.000000e-01)
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @genrand64_int1(i32 %0) {
%2 = tail call double (...) @genrand64_real1()
%3 = uitofp i32 %0 to double
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 5.000000e-01)
%5 = fptosi double %4 to i32
ret i32 %5
}
void ajoutLettre(int lettre, int resultat[]) { resultat[lettre]++; }


x86 assembly (clang, -O0):
<ajoutLettre>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajoutLettre>:
movslq %edi,%rax
addl   $0x1,(%rsi,%rax,4)
ret

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

LLVM IR (-O2):
define void @ajoutLettre(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
store i32 %6, i32* %4
ret void
}
void launch_app_in_new_terminal(char *appname, int argc, char **argv) {}


x86 assembly (clang, -O0):
<launch_app_in_new_terminal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @launch_app_in_new_terminal(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret void
}

LLVM IR (-O2):
define void @launch_app_in_new_terminal(i8* nocapture %0, i32 %1, i8** nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ikmem_boot_hook2(int stage) { printf("boot %d\n", stage); }


x86 assembly (clang, -O0):
<ikmem_boot_hook2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ikmem_boot_hook2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"boot %d\0A\00"
define void @ikmem_boot_hook2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"boot %d\0A\00"
define void @ikmem_boot_hook2(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double sinh(double);
extern __attribute__((visibility("hidden"))) double lj_vm_sinh(double x) {
  return sinh(x);
}


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

x86 assembly (clang, -O2):
<lj_vm_sinh>:
jmp    1030 <sinh@plt>

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

LLVM IR (-O2):
define hidden double @lj_vm_sinh(double %0) {
%2 = tail call double @sinh(double %0)
ret double %2
}
void ff_h264chroma_init_aarch64() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264chroma_init_aarch64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_is_empty_empty();
int /*<<< orphan*/ test_is_empty_null();
int /*<<< orphan*/ test_is_empty_one_item();
void test_is_empty() {
  test_is_empty_empty();
  test_is_empty_null();
  test_is_empty_one_item();
}


x86 assembly (clang, -O0):
<test_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_is_empty_empty@plt>
mov    $0x0,%al
call   1030 <test_is_empty_null@plt>
mov    $0x0,%al
call   1040 <test_is_empty_one_item@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_is_empty>:
push   %rax
xor    %eax,%eax
call   1050 <test_is_empty_empty@plt>
xor    %eax,%eax
call   1030 <test_is_empty_null@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_is_empty_one_item@plt>

LLVM IR (-O0):
define void @test_is_empty() {
%1 = call i32 (...) @test_is_empty_empty()
%2 = call i32 (...) @test_is_empty_null()
%3 = call i32 (...) @test_is_empty_one_item()
ret void
}

LLVM IR (-O2):
define void @test_is_empty() {
%1 = tail call i32 (...) @test_is_empty_empty()
%2 = tail call i32 (...) @test_is_empty_null()
%3 = tail call i32 (...) @test_is_empty_one_item()
ret void
}
int test_imm_DAuint16_reg(unsigned short val) {
  return ((val) & (0xDA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DAuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xda,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DAuint16_reg>:
test   $0xda,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 218
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void g1(void) {}


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

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

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

LLVM IR (-O2):
define void @g1() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void initdata(double *u1, char *fname) {
  int ix, iy;
  FILE *fp;
}


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

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

LLVM IR (-O0):
define void @initdata(double* %0, i8* %1) {
%3 = alloca double*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store double* %0, double** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @initdata(double* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
size_t strftime(char *, size_t, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
size_t print_time(char *out, size_t out_size) {
  time_t t = time(NULL);
  struct tm *local_time = localtime(&t);
  size_t bytes_written = strftime(out, out_size, "%R %d-%b-%Y", local_time);
  return bytes_written;
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    0xe94(%rip),%rdx
call   1050 <strftime@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeaa(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%R %d-%b-%Y\00"
define i64 @print_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.tm*
%7 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%8 = call i32 @time(i32* null)
store i32 %8, i32* %5
%9 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %9, %struct.tm** %6
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = load %struct.tm*, %struct.tm** %6
%13 = call i64 @strftime(i8* %10, i64 %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %12)
store i64 %13, i64* %7
%14 = load i64, i64* %7
ret i64 %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%R %d-%b-%Y\00"
define i64 @print_time(i8* %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i64 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void clr1(int *x) { memset(x, 0, 1); }


x86 assembly (clang, -O0):
<clr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr1>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clr1(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 1)
ret void
}
int test_imm_51uint8_mem(unsigned char *val) {
  return ((*val) & (-0x51 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_51uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -81
%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_51uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -81
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void free2a(int **arr) {
  free(arr[0]);
  free(arr);
}


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

x86 assembly (clang, -O2):
<free2a>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free2a(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i32** %0 to i8*
tail call void @free(i8* %4)
ret void
}