xunge/DecIR huggingface dataset:
float IsosclesTriangleNextAdjacent(float adjLength, float inRadius) {
  return adjLength - (inRadius * 2.0f);
}


x86 assembly (clang, -O0):
<IsosclesTriangleNextAdjacent>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsosclesTriangleNextAdjacent>:
addss  %xmm1,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @IsosclesTriangleNextAdjacent(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 = fneg float %6
%8 = call float @llvm.fmuladd.f32(float %7, float 2.000000e+00, float %5)
ret float %8
}

LLVM IR (-O2):
define float @IsosclesTriangleNextAdjacent(float %0, float %1) {
%3 = fneg float %1
%4 = tail call float @llvm.fmuladd.f32(float %3, float 2.000000e+00, float %0)
ret float %4
}
/* Type definitions */
struct s_bctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct s_bctx *);
void _destroy_bctx(struct s_bctx *b) {
  if (b) {
    free(b);
  }
}


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

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

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

LLVM IR (-O2):
%struct.s_bctx = type { i32 }
define void @_destroy_bctx(%struct.s_bctx* %0) {
%2 = icmp eq %struct.s_bctx* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.s_bctx* %0)
br label %5
5: ; preds = %3, %1
ret void
}
const int get32b(unsigned char *p) {
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}


x86 assembly (clang, -O0):
<get32b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32b>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @get32b(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get32b(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_alrm(int signo) { printf("catched sigalrm\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"catched sigalrm\0A\00"
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"catched sigalrm\00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ nop();
void FN_unreachable_statement_exit_bad() {
  exit(2);
  nop();
}


x86 assembly (clang, -O0):
<FN_unreachable_statement_exit_bad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<FN_unreachable_statement_exit_bad>:
push   %rax
mov    $0x2,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @FN_unreachable_statement_exit_bad() {
%1 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @FN_unreachable_statement_exit_bad() {
%1 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int signum(int);
int Comparator_int(const void *a, const void *b) {
  return signum(*(int *)a - *(int *)b);
}


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

x86 assembly (clang, -O2):
<Comparator_int>:
mov    (%rdi),%edi
sub    (%rsi),%edi
jmp    1030 <signum@plt>

LLVM IR (-O0):
define i32 @Comparator_int(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
%12 = call i32 @signum(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @Comparator_int(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
%8 = tail call i32 @signum(i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void output_values_length_us(double main_out_value, double sec_out_value) {
  printf("Your converted value is %g feet, %g inches\n\n", main_out_value,
         sec_out_value);
}


x86 assembly (clang, -O0):
<output_values_length_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"Your converted value is %g feet, %g inches\0A\0A\00"
define void @output_values_length_us(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Your converted value is %g feet, %g inches\0A\0A\00"
define void @output_values_length_us(double %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %0, double %1)
ret void
}
int thirdBits(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @thirdBits() {
ret i32 2
}

LLVM IR (-O2):
define i32 @thirdBits() {
ret i32 2
}
int main() {
  for (1; 2; 3) {
    if (2) {
      continue;
    }
  }
  while (1) {
    123;
    if (0) {
      continue;
    }
  }
  do {
    continue;
  } while (6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    111a <main+0x1a>
jmp    1124 <main+0x24>
jmp    111f <main+0x1f>
jmp    110b <main+0xb>
jmp    1129 <main+0x29>
jmp    1129 <main+0x29>

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int switch3(unsigned a) {
  switch (a) {
  case (12 + 0):
    return 1;
  case (12 + 1)...(12 + 11):
    return 11;
  case (12 + 12)...(12 + 13):
    return (12 + 22);
  default:
    return (12 + 44);
  }
}


x86 assembly (clang, -O0):
<switch3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xc,%eax
je     1143 <switch3+0x43>
jmp    111b <switch3+0x1b>
mov    -0xc(%rbp),%eax
add    $0xfffffff3,%eax
sub    $0xb,%eax
jb     114f <switch3+0x4f>
jmp    112f <switch3+0x2f>
mov    -0xc(%rbp),%eax
add    $0xffffffe8,%eax
sub    $0x2,%eax
jb     115b <switch3+0x5b>
jmp    1167 <switch3+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <switch3+0x6e>
movl   $0xb,-0x4(%rbp)
jmp    116e <switch3+0x6e>
movl   $0x22,-0x4(%rbp)
jmp    116e <switch3+0x6e>
movl   $0x38,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch3>:
add    $0xfffffff4,%edi
mov    $0x38,%eax
cmp    $0xd,%edi
ja     111a <switch3+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @switch3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 12, label %5
i32 13, label %6
i32 14, label %6
i32 15, label %6
i32 16, label %6
i32 17, label %6
i32 18, label %6
i32 19, label %6
i32 20, label %6
i32 21, label %6
i32 22, label %6
i32 23, label %6
i32 24, label %7
i32 25, label %7
]
5: ; preds = %1
store i32 1, i32* %2
br label %9
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 11, i32* %2
br label %9
7: ; preds = %1, %1
store i32 34, i32* %2
br label %9
8: ; preds = %1
store i32 56, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.switch3 = [14 x i32] [i32 1, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 34, i32 34]
define i32 @switch3(i32 %0) {
%2 = add i32 %0, -12
%3 = icmp ult i32 %2, 14
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [14 x i32], [14 x i32]* @switch.table.switch3, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 56, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __swap32(uint32_t x) {
  return (((((x & 0x0000ffffU & 0x00ffU) << 8) |
            (((x & 0x0000ffffU & 0xff00U) >> 8)))
           << 16) |
          (((((x & 0xffff0000U) >> 16 & 0x00ffU) << 8) |
            ((((x & 0xffff0000U) >> 16 & 0xff00U) >> 8)))));
}


x86 assembly (clang, -O0):
<__swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
and    $0xff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff0000,%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
mov    -0x4(%rbp),%edx
and    $0xffff0000,%edx
shr    $0x10,%edx
and    $0xff00,%edx
shr    $0x8,%edx
or     %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__swap32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @__swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i32, i32* %2
%8 = and i32 %7, 65535
%9 = and i32 %8, 65280
%10 = lshr i32 %9, 8
%11 = or i32 %6, %10
%12 = shl i32 %11, 16
%13 = load i32, i32* %2
%14 = and i32 %13, -65536
%15 = lshr i32 %14, 16
%16 = and i32 %15, 255
%17 = shl i32 %16, 8
%18 = load i32, i32* %2
%19 = and i32 %18, -65536
%20 = lshr i32 %19, 16
%21 = and i32 %20, 65280
%22 = lshr i32 %21, 8
%23 = or i32 %17, %22
%24 = or i32 %12, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @__swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_PK_WRITE_C and/or MBEDTLS_FS_IO and/or "
         "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or "
         "MBEDTLS_PEM_WRITE_C"
         "not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [131 x i8] c"MBEDTLS_PK_WRITE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_PEM_WRITE_Cnot defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [130 x i8] c"MBEDTLS_PK_WRITE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_PEM_WRITE_Cnot defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([130 x i8], [130 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int is_subdir(const char *dir1, const char *dir2) {
  return !strncmp(dir1, dir2, strlen(dir1)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_subdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %dl
xor    $0xff,%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_subdir>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @is_subdir(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 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_subdir(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
unsigned int hweight8(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x55);
  res = (res & 0x33) + ((res >> 2) & 0x33);
  return (res + (res >> 4)) & 0x0F;
}


x86 assembly (clang, -O0):
<hweight8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight8>:
mov    %edi,%eax
shr    %eax
and    $0x55,%eax
sub    %eax,%edi
mov    %edi,%ecx
and    $0x33,%ecx
shr    $0x2,%edi
and    $0x33,%edi
add    %edi,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
add    %ecx,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @hweight8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 85
%8 = sub i32 %4, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = and i32 %9, 51
%11 = load i32, i32* %3
%12 = lshr i32 %11, 2
%13 = and i32 %12, 51
%14 = add i32 %10, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = lshr i32 %16, 4
%18 = add i32 %15, %17
%19 = and i32 %18, 15
ret i32 %19
}

LLVM IR (-O2):
define i32 @hweight8(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 85
%4 = sub i32 %0, %3
%5 = and i32 %4, 51
%6 = lshr i32 %4, 2
%7 = and i32 %6, 51
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 15
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_or_insert(int);
void *process5(void *arg) {
  int val = 50;
  int found = find_or_insert(val);
  assert(found);
  return NULL;
}


x86 assembly (clang, -O0):
<process5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x32,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <find_or_insert@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process5>:
push   %rax
mov    $0x32,%edi
call   1040 <find_or_insert@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @process5(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 50, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @find_or_insert(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @assert(i32 %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @process5(i8* nocapture readnone %0) {
%2 = tail call i32 @find_or_insert(i32 50)
%3 = tail call i32 @assert(i32 %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ http_get(char *);
void prev() { http_get("/prev"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"/prev\00"
define void @prev() {
%1 = tail call i32 @http_get(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int crunch(char const);
unsigned char get_char_lsb(const char c) { return crunch(c) & 0x07; }


x86 assembly (clang, -O0):
<get_char_lsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <crunch@plt>
and    $0x7,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @get_char_lsb(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @crunch(i8 signext %3)
%5 = and i32 %4, 7
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @get_char_lsb(i8 signext %0) {
%2 = tail call i32 @crunch(i8 signext %0)
%3 = trunc i32 %2 to i8
%4 = and i8 %3, 7
ret i8 %4
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_r8(struct cpu *, int, unsigned char);
void cpu_set_h(struct cpu *cpu, unsigned char h) { cpu_set_r8(cpu, (7), h); }


x86 assembly (clang, -O0):
<cpu_set_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
movzbl -0x9(%rbp),%edx
call   1030 <cpu_set_r8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_set_h>:
mov    %esi,%edx
mov    $0x7,%esi
jmp    1030 <cpu_set_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_set_h(%struct.cpu* %0, i8 zeroext %1) {
%3 = alloca %struct.cpu*
%4 = alloca i8
store %struct.cpu* %0, %struct.cpu** %3
store i8 %1, i8* %4
%5 = load %struct.cpu*, %struct.cpu** %3
%6 = load i8, i8* %4
%7 = call i32 @cpu_set_r8(%struct.cpu* %5, i32 7, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_set_h(%struct.cpu* %0, i8 zeroext %1) {
%3 = tail call i32 @cpu_set_r8(%struct.cpu* %0, i32 7, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, ...);
int main() {
  int a = 3;
  int b = 2;
  double pontos = a / (double)b;
  printf("%f\n", pontos);
  double pi = 3.1415;
  int piconvertido = (int)pi;
  printf("%f %d\n", pi, piconvertido);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
movsd  0xed2(%rip),%xmm0
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [7 x i8] c"%f %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 3, i32* %1
store i32 2, i32* %2
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
store double %10, double* %3
%11 = load double, double* %3
%12 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %11)
store double 3.141500e+00, double* %4
%13 = load double, double* %4
%14 = fptosi double %13 to i32
store i32 %14, i32* %5
%15 = load double, double* %4
%16 = load i32, i32* %5
%17 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [7 x i8] c"%f %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.500000e+00)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double 3.141500e+00, i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world !\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello world !\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello world !\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
long long int recursive(long long int i) {
  printf("%lld\n", i);
  return recursive(++i);
}


x86 assembly (clang, -O0):
<recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1040 <recursive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
jmp    1120 <recursive+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"%lld\0A\00"
define i64 @recursive(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = load i64, i64* %2
%6 = add nsw i64 %5, 1
store i64 %6, i64* %2
%7 = call i64 @recursive(i64 %6)
ret i64 %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i64 @recursive(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = add nsw i64 %3, 1
br label %2
}
/* Type definitions */
struct sched_param {
  int /*<<< orphan*/ sched_priority;
};
typedef int /*<<< orphan*/ sched;

/* Variables and functions */
int /*<<< orphan*/ SCHED_FIFO;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sched_get_priority_max(int /*<<< orphan*/);
int /*<<< orphan*/ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                                      struct sched_param *);
void sched_set_max_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = sched_get_priority_max(SCHED_FIFO);
  sched_setscheduler(0, SCHED_FIFO, &sched);
}


x86 assembly (clang, -O0):
<sched_set_max_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <sched_get_priority_max@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_set_max_priority>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e9b(%rip),%rbx
mov    (%rbx),%edi
call   1050 <sched_get_priority_max@plt>
mov    %eax,(%rsp)
mov    (%rbx),%esi
xor    %edi,%edi
mov    %r14,%rdx
call   1030 <sched_setscheduler@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define void @sched_set_max_priority() {
%1 = alloca %struct.sched_param
%2 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 4)
%3 = load i32, i32* @SCHED_FIFO
%4 = call i32 @sched_get_priority_max(i32 %3)
%5 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @SCHED_FIFO
%7 = call i32 @sched_setscheduler(i32 0, i32 %6, %struct.sched_param* %1)
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define void @sched_set_max_priority() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 4)
%4 = load i32, i32* @SCHED_FIFO
%5 = call i32 @sched_get_priority_max(i32 %4)
%6 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* @SCHED_FIFO
%8 = call i32 @sched_setscheduler(i32 0, i32 %7, %struct.sched_param* %1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int _find_str(void *x, void *key) {
  if (strcmp((char *)x, (char *)key) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<_find_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <_find_str+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <_find_str+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_find_str>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_find_str(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
size_t cpio_align(size_t len) { return ((len + 0x03) & ~0x03); }


x86 assembly (clang, -O0):
<cpio_align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
and    $0xfffffffffffffffc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpio_align>:
lea    0x3(%rdi),%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @cpio_align(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3
%5 = and i64 %4, -4
ret i64 %5
}

LLVM IR (-O2):
define i64 @cpio_align(i64 %0) {
%2 = add i64 %0, 3
%3 = and i64 %2, -4
ret i64 %3
}
/* Variables and functions */
double calculoResistencia(int);
double calculoSuporte(int);
double calculoRegressaoFibonacci(double fatorDeRegressao, int quantidadeVelas) {
  double variacaoDePontos =
      calculoSuporte(quantidadeVelas) - calculoResistencia(quantidadeVelas);
  return (variacaoDePontos * fatorDeRegressao) +
         calculoSuporte(quantidadeVelas);
}


x86 assembly (clang, -O0):
<calculoRegressaoFibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <calculoSuporte@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <calculoResistencia@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <calculoSuporte@plt>
movsd  -0x28(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculoRegressaoFibonacci>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x8(%rsp)
call   1040 <calculoSuporte@plt>
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1030 <calculoResistencia@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %ebx,%edi
call   1040 <calculoSuporte@plt>
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @calculoRegressaoFibonacci(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call double @calculoSuporte(i32 %6)
%8 = load i32, i32* %4
%9 = call double @calculoResistencia(i32 %8)
%10 = fsub double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %3
%13 = load i32, i32* %4
%14 = call double @calculoSuporte(i32 %13)
%15 = call double @llvm.fmuladd.f64(double %11, double %12, double %14)
ret double %15
}

LLVM IR (-O2):
define double @calculoRegressaoFibonacci(double %0, i32 %1) {
%3 = tail call double @calculoSuporte(i32 %1)
%4 = tail call double @calculoResistencia(i32 %1)
%5 = fsub double %3, %4
%6 = tail call double @calculoSuporte(i32 %1)
%7 = tail call double @llvm.fmuladd.f64(double %5, double %0, double %6)
ret double %7
}
smp_init_pseries_mpic(void) {}


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

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

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

LLVM IR (-O2):
define i32 @smp_init_pseries_mpic() {
ret i32 undef
}
/* Variables and functions */
int g();
int f(int a) { return g() * a; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <g@plt>
imul   -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <g@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @g()
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 (...) @g()
%3 = mul nsw i32 %2, %0
ret i32 %3
}
int get_commands_count(char *main_cmd) {
  int no_of_cmds = 0;
  int i = 0;
  while (main_cmd[i] != '\0') {
    if (main_cmd[i] == '|') {
      no_of_cmds++;
    }
    i++;
  }
  return no_of_cmds + 1;
}


x86 assembly (clang, -O0):
<get_commands_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <get_commands_count+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7c,%eax
jne    1149 <get_commands_count+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <get_commands_count+0x16>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_commands_count>:
xor    %eax,%eax
jmp    1117 <get_commands_count+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x7c,%cl
je     1110 <get_commands_count+0x10>
test   %cl,%cl
jne    1113 <get_commands_count+0x13>
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_commands_count(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 124, label %7
]
7: ; preds = %2
%8 = add nsw i32 %4, 1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, 1
ret i32 %13
}
double rectifier(double x) { return (x > 0.0) ? x : 0.0; }


x86 assembly (clang, -O0):
<rectifier>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <rectifier+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <rectifier+0x37>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <rectifier+0x37>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rectifier>:
xorpd  %xmm1,%xmm1
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @rectifier(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, double %0, double 0.000000e+00
ret double %3
}
/* Type definitions */
typedef int uint32_t;
typedef int oldsr;

/* Variables and functions */
int or1k_mfspr(int);
int /*<<< orphan*/ or1k_mtspr(int, int);
uint32_t or1k_interrupts_disable(void) {
  uint32_t oldsr, newsr;
  oldsr = or1k_mfspr(0x0011U);
  newsr = (((oldsr)&0xfffffffbU) | ((!!(0)) << 2));
  or1k_mtspr(0x0011U, newsr);
  return (((oldsr) >> 2) & 0x1);
}


x86 assembly (clang, -O0):
<or1k_interrupts_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffb,%eax
or     $0x0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x11,%edi
call   1030 <or1k_mtspr@plt>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or1k_interrupts_disable>:
push   %rbx
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
mov    %eax,%ebx
mov    %eax,%esi
and    $0xfffffffb,%esi
mov    $0x11,%edi
call   1030 <or1k_mtspr@plt>
shr    $0x2,%ebx
and    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @or1k_interrupts_disable() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @or1k_mfspr(i32 17)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, -5
%6 = or i32 %5, 0
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @or1k_mtspr(i32 17, i32 %7)
%9 = load i32, i32* %1
%10 = ashr i32 %9, 2
%11 = and i32 %10, 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @or1k_interrupts_disable() {
%1 = tail call i32 @or1k_mfspr(i32 17)
%2 = and i32 %1, -5
%3 = tail call i32 @or1k_mtspr(i32 17, i32 %2)
%4 = lshr i32 %1, 2
%5 = and i32 %4, 1
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ uc_stack;
};
typedef TYPE_1__ ucontext_t;
typedef int /*<<< orphan*/ stack_t;

/* Variables and functions */
int getcontext(TYPE_1__ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int stack_getbounds(stack_t *sp) {
  ucontext_t ctx;
  int ret = getcontext(&ctx);
  if (ret != 0)
    return ret;
  memcpy(sp, &ctx.uc_stack, sizeof(stack_t));
  return 0;
}


x86 assembly (clang, -O0):
<stack_getbounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <getcontext@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     114d <stack_getbounds+0x2d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <stack_getbounds+0x46>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_getbounds>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1040 <getcontext@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1144 <stack_getbounds+0x24>
mov    %rsp,%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @stack_getbounds(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.TYPE_3__
%5 = alloca i32
store i32* %0, i32** %3
%6 = call i32 @getcontext(%struct.TYPE_3__* %4)
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %5
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load i32*, i32** %3
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
%14 = call i32 @memcpy(i32* %12, i32* %13, i32 4)
store i32 0, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @stack_getbounds(i32* %0) {
%2 = alloca %struct.TYPE_3__
%3 = bitcast %struct.TYPE_3__* %2 to i8*
%4 = call i32 @getcontext(%struct.TYPE_3__* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
%8 = call i32 @memcpy(i32* %0, i32* %7, i32 4)
br label %9
9: ; preds = %1, %6
ret i32 %4
}
void free_imatrix(int **m) {
  free(m[0]);
  free(m);
}


x86 assembly (clang, -O0):
<free_imatrix>:
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):
<free_imatrix>:
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 @free_imatrix(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 @free_imatrix(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
}
__attribute__((visibility("default"))) void pa_start_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @pa_start_Init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_serial(char);
void slputs(char *a) {
  int i = 0;
  while (a[i])
    write_serial(a[i++]);
}


x86 assembly (clang, -O0):
<slputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <slputs+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <write_serial@plt>
jmp    1123 <slputs+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <slputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <write_serial@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <slputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @slputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @write_serial(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
unsigned char inb(unsigned short port) {
  unsigned char v;
  asm volatile("inb %1,%0" : "=a"(v) : "dN"(port));
  return v;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1,$0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1,$0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct diff_addr_store {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addr_cmd(struct diff_addr_store *, char *,
                            int /*<<< orphan*/ const *, size_t);
void remove_item(struct diff_addr_store *store, const uint8_t *addr,
                 size_t length) {
  addr_cmd(store, "del", addr, length);
}


x86 assembly (clang, -O0):
<remove_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <addr_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_item>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <addr_cmd@plt>

LLVM IR (-O0):
%struct.diff_addr_store = type { i32 }
@.str = [4 x i8] c"del\00"
define void @remove_item(%struct.diff_addr_store* %0, i32* %1, i64 %2) {
%4 = alloca %struct.diff_addr_store*
%5 = alloca i32*
%6 = alloca i64
store %struct.diff_addr_store* %0, %struct.diff_addr_store** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load %struct.diff_addr_store*, %struct.diff_addr_store** %4
%8 = load i32*, i32** %5
%9 = load i64, i64* %6
%10 = call i32 @addr_cmd(%struct.diff_addr_store* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %8, i64 %9)
ret void
}

LLVM IR (-O2):
%struct.diff_addr_store = type { i32 }
@.str = [4 x i8] c"del\00"
define void @remove_item(%struct.diff_addr_store* %0, i32* %1, i64 %2) {
%4 = tail call i32 @addr_cmd(%struct.diff_addr_store* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pop3(int /*<<< orphan*/ *, char const *);
void pop3_handler(FILE *client, void *arg) { pop3(client, (const char *)arg); }


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

x86 assembly (clang, -O2):
<pop3_handler>:
jmp    1030 <pop3@plt>

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

LLVM IR (-O2):
define void @pop3_handler(i32* %0, i8* %1) {
%3 = tail call i32 @pop3(i32* %0, i8* %1)
ret void
}