xunge/DecIR huggingface dataset:
void StringCpy(char *strA, char *strB) {
  int i;
  for (i = 0; i < 23; i++) {
    strA[i] = strB[i];
    if (strB[i] == '\0')
      break;
  }
}


x86 assembly (clang, -O0):
<StringCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x17,-0x14(%rbp)
jge    1160 <StringCpy+0x60>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    114d <StringCpy+0x4d>
jmp    1160 <StringCpy+0x60>
jmp    1152 <StringCpy+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <StringCpy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringCpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
cmpb   $0x0,(%rsi,%rax,1)
je     112a <StringCpy+0x2a>
lea    0x1(%rax),%rcx
cmp    $0x16,%rax
mov    %rcx,%rax
jne    1110 <StringCpy+0x10>
ret

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

LLVM IR (-O2):
define void @StringCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
%10 = add nuw nsw i64 %4, 1
%11 = icmp eq i64 %10, 23
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %13, label %3
13: ; preds = %3
ret void
}
void test26(void) {
  double a;
  double b;
  double c;
  unsigned char d;
  if (a == b) {
  }
  if (a < b) {
  }
  if (c >= a) {
  }
  d = (a <= c);
}


x86 assembly (clang, -O0):
<test26>:
push   %rbp
mov    %rsp,%rbp
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    111f <test26+0x1f>
jp     111f <test26+0x1f>
jmp    111f <test26+0x1f>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1138 <test26+0x38>
jmp    1138 <test26+0x38>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     114d <test26+0x4d>
jmp    114d <test26+0x4d>
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x19(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test26() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i8
%5 = load double, double* %1
%6 = load double, double* %2
%7 = fcmp oeq double %5, %6
br i1 %7, label %8, label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %0
%10 = load double, double* %1
%11 = load double, double* %2
%12 = fcmp olt double %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
br label %14
14: ; preds = %13, %9
%15 = load double, double* %3
%16 = load double, double* %1
%17 = fcmp oge double %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
br label %19
19: ; preds = %18, %14
%20 = load double, double* %1
%21 = load double, double* %3
%22 = fcmp ole double %20, %21
%23 = zext i1 %22 to i32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
ret void
}

LLVM IR (-O2):
define void @test26() {
ret void
}
int f_ne_mm1(float *a1, float *a2) { return (((*a1) != (*a2))); }


x86 assembly (clang, -O0):
<f_ne_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_mm1>:
movss  (%rsi),%xmm0
cmpneqss (%rdi),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @f_ne_mm1(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp une float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double drand48();
double rng_uniform_pos(void) {
  double ran = drand48();
  while (ran == 0)
    ran = drand48();
  return ran;
}


x86 assembly (clang, -O0):
<rng_uniform_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <drand48@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    114d <rng_uniform_pos+0x3d>
jp     114d <rng_uniform_pos+0x3d>
mov    $0x0,%al
call   1030 <drand48@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1124 <rng_uniform_pos+0x14>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_uniform_pos>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <drand48@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1133 <rng_uniform_pos+0x23>
jnp    1120 <rng_uniform_pos+0x10>
pop    %rax
ret

LLVM IR (-O0):
define double @rng_uniform_pos() {
%1 = alloca double
%2 = call double (...) @drand48()
store double %2, double* %1
br label %3
3: ; preds = %6, %0
%4 = load double, double* %1
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call double (...) @drand48()
store double %7, double* %1
br label %3
8: ; preds = %3
%9 = load double, double* %1
ret double %9
}

LLVM IR (-O2):
define double @rng_uniform_pos() {
%1 = tail call double (...) @drand48()
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %0, %3
%4 = tail call double (...) @drand48()
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %3, label %6
6: ; preds = %3, %0
%7 = phi double [ %1, %0 ], [ %4, %3 ]
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void FP_RESTORE_ROUNDING() {
  addbyte(0xd9);
  addbyte(0x6c);
  addbyte(0x24);
  addbyte(0x08);
}


x86 assembly (clang, -O0):
<FP_RESTORE_ROUNDING>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <addbyte@plt>
mov    $0x6c,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
call   1030 <addbyte@plt>
mov    $0x8,%edi
call   1030 <addbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP_RESTORE_ROUNDING>:
push   %rax
mov    $0xd9,%edi
call   1030 <addbyte@plt>
mov    $0x6c,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
call   1030 <addbyte@plt>
mov    $0x8,%edi
pop    %rax
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @FP_RESTORE_ROUNDING() {
%1 = call i32 @addbyte(i32 217)
%2 = call i32 @addbyte(i32 108)
%3 = call i32 @addbyte(i32 36)
%4 = call i32 @addbyte(i32 8)
ret void
}

LLVM IR (-O2):
define void @FP_RESTORE_ROUNDING() {
%1 = tail call i32 @addbyte(i32 217)
%2 = tail call i32 @addbyte(i32 108)
%3 = tail call i32 @addbyte(i32 36)
%4 = tail call i32 @addbyte(i32 8)
ret void
}
/* Variables and functions */
void bootloader_ana_bod_reset_config(bool enable) { (void)enable; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void printBranchTo(int blockId) {
  FILE *file = fopen("coverage.cov", "a");
  fprintf(file, "lead to block %d\n", blockId);
  fclose(file);
}


x86 assembly (clang, -O0):
<printBranchTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeaf(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBranchTo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"coverage.cov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [18 x i8] c"lead to block %d\0A\00"
define void @printBranchTo(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i32, i32* %2
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"coverage.cov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [18 x i8] c"lead to block %d\0A\00"
define void @printBranchTo(i32 %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
char get_bit_char(char val, unsigned pos) {
  return (val & ((char)1 << pos)) != 0;
}


x86 assembly (clang, -O0):
<get_bit_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_char>:
bt     %esi,%edi
setb   %al
ret

LLVM IR (-O0):
define signext i8 @get_bit_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @get_bit_char(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl nuw i32 1, %1
%5 = and i32 %4, %3
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t minipack_unpack_uint8(void *ptr, size_t *sz) {
  *sz = 2;
  return *((uint8_t *)(ptr + 1));
}


x86 assembly (clang, -O0):
<minipack_unpack_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_uint8>:
movq   $0x2,(%rsi)
mov    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @minipack_unpack_uint8(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 2, i64* %1
%3 = getelementptr i8, i8* %0, i64 1
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *newCopy(void *obj, int n) {
  void *obj1 = malloc(n);
  if (obj1)
    memcpy(obj1, obj, n);
  return obj1;
}


x86 assembly (clang, -O0):
<newCopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <newCopy+0x36>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newCopy>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1145 <newCopy+0x25>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @newCopy(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @newCopy(i8* %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int EVP_PKEY_assign_RSA(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSA_up_ref(int /*<<< orphan*/ *);
int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) {
  int ret = EVP_PKEY_assign_RSA(pkey, key);
  if (ret)
    RSA_up_ref(key);
  return ret;
}


x86 assembly (clang, -O0):
<EVP_PKEY_set1_RSA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <EVP_PKEY_assign_RSA@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <EVP_PKEY_set1_RSA+0x33>
mov    -0x10(%rbp),%rdi
call   1040 <RSA_up_ref@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set1_RSA>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <EVP_PKEY_assign_RSA@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1139 <EVP_PKEY_set1_RSA+0x19>
mov    %rbx,%rdi
call   1040 <RSA_up_ref@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @EVP_PKEY_set1_RSA(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_PKEY_assign_RSA(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @RSA_up_ref(i32* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
float acos(int);
int glmComputeVectorLength2f(float const *);
int glmDotProduct2f(float const *, float const *);
float glmComputeVectorAngle2fRad(const float v1[2], const float v2[2]) {
  return acos(glmDotProduct2f(v1, v2) /
              (glmComputeVectorLength2f(v1) * glmComputeVectorLength2f(v2)));
}


x86 assembly (clang, -O0):
<glmComputeVectorAngle2fRad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <glmDotProduct2f@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <acos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorAngle2fRad>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <glmDotProduct2f@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <glmComputeVectorLength2f@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <acos@plt>

LLVM IR (-O0):
define float @glmComputeVectorAngle2fRad(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @glmDotProduct2f(float* %5, float* %6)
%8 = load float*, float** %3
%9 = call i32 @glmComputeVectorLength2f(float* %8)
%10 = load float*, float** %4
%11 = call i32 @glmComputeVectorLength2f(float* %10)
%12 = mul nsw i32 %9, %11
%13 = sdiv i32 %7, %12
%14 = call float @acos(i32 %13)
ret float %14
}

LLVM IR (-O2):
define float @glmComputeVectorAngle2fRad(float* %0, float* %1) {
%3 = tail call i32 @glmDotProduct2f(float* %0, float* %1)
%4 = tail call i32 @glmComputeVectorLength2f(float* %0)
%5 = tail call i32 @glmComputeVectorLength2f(float* %1)
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %3, %6
%8 = tail call float @acos(i32 %7)
ret float %8
}
float GetValueInRange(float value, float min, float max) {
  if (value < min) {
    return min;
  }
  if (value > max) {
    return max;
  }
  return value;
}


x86 assembly (clang, -O0):
<GetValueInRange>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <GetValueInRange+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <GetValueInRange+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <GetValueInRange+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <GetValueInRange+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetValueInRange>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @GetValueInRange(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @GetValueInRange(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
void gtk_im_context_filter_keypress() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_context_filter_keypress() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int mathutils_random_in_range(int min, int max) {
  assert(min < max);
  srand(time(NULL));
  return rand() % (max - min) + min;
}


x86 assembly (clang, -O0):
<mathutils_random_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mathutils_random_in_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
sub    %ebx,%ebp
setg   %dil
call   1040 <assert@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mathutils_random_in_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @time(i32* null)
%11 = call i32 @srand(i32 %10)
%12 = call i32 (...) @rand()
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = srem i32 %12, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @mathutils_random_in_range(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 @srand(i32 %6)
%8 = tail call i32 (...) @rand()
%9 = sub nsw i32 %1, %0
%10 = srem i32 %8, %9
%11 = add nsw i32 %10, %0
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage() { fprintf(stdout, "usage: gpnetbenchServer -p PORT [-h]\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [38 x i8] c"usage: gpnetbenchServer -p PORT [-h]\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [38 x i8] c"usage: gpnetbenchServer -p PORT [-h]\0A\00"
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popinteger16array_(void *x, unsigned int *n) {
  popNarray((char *)x, (*n * 16));
}


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

x86 assembly (clang, -O2):
<popinteger16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popinteger16array_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @popNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @popinteger16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
void cam_interrupt_detach(const int c, const int n) {}


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

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

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

LLVM IR (-O2):
define void @cam_interrupt_detach(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ TableSize(int, int);
int Reduced_SpharmonicTableSize(int bw, int m) {
  int i, sum;
  sum = 0;
  for (i = 0; i < m; i++)
    sum += TableSize(i, bw);
  return sum;
}


x86 assembly (clang, -O0):
<Reduced_SpharmonicTableSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115e <Reduced_SpharmonicTableSize+0x4e>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <TableSize@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <Reduced_SpharmonicTableSize+0x1c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reduced_SpharmonicTableSize>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <Reduced_SpharmonicTableSize+0x36>
mov    %esi,%r15d
mov    %edi,%r14d
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <TableSize@plt>
add    %eax,%ebp
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1130 <Reduced_SpharmonicTableSize+0x20>
jmp    1148 <Reduced_SpharmonicTableSize+0x38>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Reduced_SpharmonicTableSize(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = tail call i64 @TableSize(i32 %6, i32 %0)
%8 = trunc i64 %7 to i32
%9 = add i32 %5, %8
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkParentheses(char *);
int /*<<< orphan*/ getLine(char *);
int main(int argc, char **argv) {
  char str[100000];
  getLine(str);
  checkParentheses(str);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x186b0(%rbp),%rdi
call   1040 <getLine@plt>
lea    -0x186b0(%rbp),%rdi
call   1030 <checkParentheses@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x186b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x186a0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <getLine@plt>
mov    %rbx,%rdi
call   1030 <checkParentheses@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
add    $0x186a0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%8 = call i32 @getLine(i8* %7)
%9 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%10 = call i32 @checkParentheses(i8* %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100000 x i8]
%4 = getelementptr inbounds [100000 x i8], [100000 x i8]* %3, i64 0, i64 0
%5 = call i32 @getLine(i8* %4)
%6 = call i32 @checkParentheses(i8* %4)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ CL_GameConsoleText();
int /*<<< orphan*/ Cmd_TokenizeString(void *);
void Con_ClearNotify(void) {
  Cmd_TokenizeString(((void *)0));
  CL_GameConsoleText();
}


x86 assembly (clang, -O0):
<Con_ClearNotify>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <Cmd_TokenizeString@plt>
mov    $0x0,%al
call   1040 <CL_GameConsoleText@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Con_ClearNotify>:
push   %rax
xor    %edi,%edi
call   1030 <Cmd_TokenizeString@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CL_GameConsoleText@plt>

LLVM IR (-O0):
define void @Con_ClearNotify() {
%1 = call i32 @Cmd_TokenizeString(i8* null)
%2 = call i32 (...) @CL_GameConsoleText()
ret void
}

LLVM IR (-O2):
define void @Con_ClearNotify() {
%1 = tail call i32 @Cmd_TokenizeString(i8* null)
%2 = tail call i32 (...) @CL_GameConsoleText()
ret void
}
int compare_rule(const void *a, const void *b) { return *(int *)a - *(int *)b; }


x86 assembly (clang, -O0):
<compare_rule>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_rule>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @compare_rule(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double strtod(char const *, char **);
void fig08_06() {
  const char *string = "51.2% are admitted";
  double d;
  char *stringPtr;
  d = strtod(string, &stringPtr);
  printf("The string \"%s\" is converted to the\n", string);
  printf("double value %.2f and the string \"%s\"\n", d, stringPtr);
}


x86 assembly (clang, -O0):
<fig08_06>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig08_06>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strtod@plt>
movsd  %xmm0,(%rsp)
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xedd(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"51.2% are admitted\00"
@.str.1 = [37 x i8] c"The string \22%s\22 is converted to the\0A\00"
@.str.2 = [39 x i8] c"double value %.2f and the string \22%s\22\0A\00"
define void @fig08_06() {
%1 = alloca i8*
%2 = alloca double
%3 = alloca i8*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = load i8*, i8** %1
%5 = call double @strtod(i8* %4, i8** %3)
store double %5, double* %2
%6 = load i8*, i8** %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load double, double* %2
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), double %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"51.2% are admitted\00"
@.str.1 = [37 x i8] c"The string \22%s\22 is converted to the\0A\00"
@.str.2 = [39 x i8] c"double value %.2f and the string \22%s\22\0A\00"
define void @fig08_06() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call double @strtod(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), double %3, i8* %5)
ret void
}
int fun356() { return 356; }


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

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

LLVM IR (-O0):
define i32 @fun356() {
ret i32 356
}

LLVM IR (-O2):
define i32 @fun356() {
ret i32 356
}
/* Type definitions */
struct drm_file {
  int dummy;
};
struct drm_device {
  int dummy;
};

/* Variables and functions */
int radeon_fullscreen(struct drm_device *dev, void *data,
                      struct drm_file *file_priv) {
  return 0;
}


x86 assembly (clang, -O0):
<radeon_fullscreen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
define i32 @radeon_fullscreen(%struct.drm_device* %0, i8* %1, %struct.drm_file* %2) {
%4 = alloca %struct.drm_device*
%5 = alloca i8*
%6 = alloca %struct.drm_file*
store %struct.drm_device* %0, %struct.drm_device** %4
store i8* %1, i8** %5
store %struct.drm_file* %2, %struct.drm_file** %6
ret i32 0
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
define i32 @radeon_fullscreen(%struct.drm_device* nocapture readnone %0, i8* nocapture readnone %1, %struct.drm_file* nocapture readnone %2) {
ret i32 0
}
void sapi_register_term_signal(void *libctx, void *app_cb,
                               void (*signal_evcb)(void *)) {}


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

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

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

LLVM IR (-O2):
define void @sapi_register_term_signal(i8* nocapture %0, i8* nocapture %1, void (i8*)* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ change_data(int *);
int main(void) {
  int a = 5;
  change_data(&a);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <change_data@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <change_data@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @change_data(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
unsigned invert(unsigned src_bf, unsigned inv_spos, unsigned inv_len) {
  extern unsigned maxbit;
  if (inv_len == maxbit + 1) {
    return src_bf ^ ~0;
  } else {
    return src_bf ^ (((1 << inv_len) - 1) << ((inv_spos + 1) - inv_len));
  }
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1132 <invert+0x32>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <invert+0x54>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
sub    $0x1,%edx
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
sub    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edi,%eax
mov    0x2ecf(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %edx,%ecx
jne    1115 <invert+0x15>
not    %eax
ret
mov    $0xffffffff,%edi
mov    %edx,%ecx
shl    %cl,%edi
not    %edi
sub    %edx,%esi
add    $0x1,%sil
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
@maxbit = external global i32
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load i32, i32* @maxbit
%10 = add i32 %9, 1
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i32, i32* %5
%14 = xor i32 %13, -1
store i32 %14, i32* %4
br label %26
15: ; preds = %3
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = shl i32 1, %17
%19 = sub nsw i32 %18, 1
%20 = load i32, i32* %6
%21 = add i32 %20, 1
%22 = load i32, i32* %7
%23 = sub i32 %21, %22
%24 = shl i32 %19, %23
%25 = xor i32 %16, %24
store i32 %25, i32* %4
br label %26
26: ; preds = %15, %12
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
@maxbit = external global i32
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @maxbit
%5 = add i32 %4, 1
%6 = icmp eq i32 %5, %2
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = xor i32 %0, -1
br label %16
9: ; preds = %3
%10 = shl nsw i32 -1, %2
%11 = xor i32 %10, -1
%12 = add i32 %1, 1
%13 = sub i32 %12, %2
%14 = shl i32 %11, %13
%15 = xor i32 %14, %0
br label %16
16: ; preds = %9, %7
%17 = phi i32 [ %8, %7 ], [ %15, %9 ]
ret i32 %17
}
struct multiboot_info *mbi_address(void) {
  extern struct multiboot_info *mbi;
  return (mbi);
}


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

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

LLVM IR (-O0):
%struct.multiboot_info = type opaque
@mbi = external global %struct.multiboot_info*
define %struct.multiboot_info* @mbi_address() {
%1 = load %struct.multiboot_info*, %struct.multiboot_info** @mbi
ret %struct.multiboot_info* %1
}

LLVM IR (-O2):
%struct.multiboot_info = type opaque
@mbi = external global %struct.multiboot_info*
define %struct.multiboot_info* @mbi_address() {
%1 = load %struct.multiboot_info*, %struct.multiboot_info** @mbi
ret %struct.multiboot_info* %1
}
/* Variables and functions */
int /*<<< orphan*/ f10_0(int);
int f10() {
  f10_0(1);
  return 10;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f10_0@plt>
mov    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
push   %rax
mov    $0x1,%edi
call   1030 <f10_0@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f10() {
%1 = call i32 @f10_0(i32 1)
ret i32 10
}

LLVM IR (-O2):
define i32 @f10() {
%1 = tail call i32 @f10_0(i32 1)
ret i32 10
}
int isprimer(int a) {
  int i;
  for (i = 2; i < a; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isprimer+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isprimer+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isprimer+0x50>
jmp    113b <isprimer+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isprimer+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprimer>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isprimer+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isprimer+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isprimer+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isprimer(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
void l4x_debug_stats_suspend_hit(void) {}


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

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

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

LLVM IR (-O2):
define void @l4x_debug_stats_suspend_hit() {
ret void
}
int testfn() {
  int value;
  asm volatile("mov $1, %0" : "=r"(value));
  return 4;
}


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

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

LLVM IR (-O0):
define i32 @testfn() {
%1 = alloca i32
%2 = call i32 asm sideeffect "mov $$1, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
ret i32 4
}

LLVM IR (-O2):
define i32 @testfn() {
%1 = tail call i32 asm sideeffect "mov $$1, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 4
}
/* Type definitions */
typedef int /*<<< orphan*/ mp_size_t;
typedef int /*<<< orphan*/ mp_limb_t;

/* Variables and functions */
void mpfq_zero(mp_limb_t *dst, mp_size_t n) {
  for (; n--;)
    *dst++ = 0;
}


x86 assembly (clang, -O0):
<mpfq_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1139 <mpfq_zero+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x0,(%rax)
jmp    110b <mpfq_zero+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpfq_zero>:
test   %esi,%esi
je     1126 <mpfq_zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @mpfq_zero(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void Usage(const char *msg) {
  fprintf(stderr, "%s", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}