xunge/DecIR huggingface dataset:
/* Variables and functions */
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/);
int fork() {
  int pid = 0;
  pid = syscall(0, 0, 0, 0);
  return pid;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @fork() {
%1 = tail call i32 @syscall(i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
void test_one(int x) {
#pragma omp parallel for
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ chr1setBank4(int);
void vrc7setParamsC000(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank4(val << 10);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xa,%edi
call   1030 <chr1setBank4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank4@plt>

LLVM IR (-O0):
define void @vrc7setParamsC000(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank4(i32 %7)
ret void
}

LLVM IR (-O2):
define void @vrc7setParamsC000(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank4(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgneg(void) { gen("neg\tax"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"neg\09ax\00"
define void @cgneg() {
%1 = call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"neg\09ax\00"
define void @cgneg() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo_2_2_1_2_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_2_2_2_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int main(int argc, const char *argv[]) {
  hello();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hello()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ImprimirVetor(int *vet, int tam) {
  int i;
  for (i = 0; i < tam; i++) {
    printf("%d ", vet[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<ImprimirVetor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <ImprimirVetor+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ImprimirVetor+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ImprimirVetor>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <ImprimirVetor+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <ImprimirVetor+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @ImprimirVetor(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @ImprimirVetor(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
void foo429() {}


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

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

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

LLVM IR (-O2):
define void @foo429() {
ret void
}
void board_info(char *board_name) { return; }


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

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

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

LLVM IR (-O2):
define void @board_info(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void thread_exit(void) { exit(0); }


x86 assembly (clang, -O0):
<thread_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<thread_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @thread_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ACUTE_assert_print(int, unsigned char *);
void ACUTE_assert(int result, int line, unsigned char *exception) {
  if (!(result)) {
    ACUTE_assert_print(line, exception);
  }
}


x86 assembly (clang, -O0):
<ACUTE_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1138 <ACUTE_assert+0x28>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <ACUTE_assert_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ACUTE_assert>:
test   %edi,%edi
je     1115 <ACUTE_assert+0x5>
ret
mov    %esi,%edi
mov    %rdx,%rsi
jmp    1030 <ACUTE_assert_print@plt>

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

LLVM IR (-O2):
define void @ACUTE_assert(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @ACUTE_assert_print(i32 %1, i8* %2)
br label %7
7: ; preds = %5, %3
ret void
}
int prefilter(void *workspace, char *packet, int size) { return 1; }


x86 assembly (clang, -O0):
<prefilter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @prefilter(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ check_range(int, int *);
void __e_acsl_check_range(int range, int *vet) {
  check_range(range, vet);
  return;
}


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

x86 assembly (clang, -O2):
<__e_acsl_check_range>:
jmp    1030 <check_range@plt>

LLVM IR (-O0):
define void @__e_acsl_check_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 = call i32 @check_range(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @__e_acsl_check_range(i32 %0, i32* %1) {
%3 = tail call i32 @check_range(i32 %0, i32* %1)
ret void
}
double set_percentage_of_area(double value, float offset) {
  if (offset != 0)
    return (value - value * offset / 100);
  else
    return value;
}


x86 assembly (clang, -O0):
<set_percentage_of_area>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112a <set_percentage_of_area+0x2a>
jp     112a <set_percentage_of_area+0x2a>
jmp    115b <set_percentage_of_area+0x5b>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb7(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <set_percentage_of_area+0x65>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_percentage_of_area>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    110a <set_percentage_of_area+0xa>
jnp    111e <set_percentage_of_area+0x1e>
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
divsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @set_percentage_of_area(double %0, float %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca float
store double %0, double* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp une float %6, 0.000000e+00
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load double, double* %4
%10 = load double, double* %4
%11 = load float, float* %5
%12 = fpext float %11 to double
%13 = fmul double %10, %12
%14 = fdiv double %13, 1.000000e+02
%15 = fsub double %9, %14
store double %15, double* %3
br label %18
16: ; preds = %2
%17 = load double, double* %4
store double %17, double* %3
br label %18
18: ; preds = %16, %8
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @set_percentage_of_area(double %0, float %1) {
%3 = fcmp une float %1, 0.000000e+00
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = fpext float %1 to double
%6 = fmul double %5, %0
%7 = fdiv double %6, 1.000000e+02
%8 = fsub double %0, %7
br label %9
9: ; preds = %2, %4
%10 = phi double [ %8, %4 ], [ %0, %2 ]
ret double %10
}
/* Variables and functions */
long write(int, char *, int);
long client_socket_write_(int *sockfd, char *value, int *vlen) {
  long nb;
  nb = write(*sockfd, value, *vlen);
  return nb;
}


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

x86 assembly (clang, -O2):
<client_socket_write_>:
mov    (%rdi),%edi
mov    (%rdx),%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i64 @client_socket_write_(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = call i64 @write(i32 %9, i8* %10, i32 %12)
store i64 %13, i64* %7
%14 = load i64, i64* %7
ret i64 %14
}

LLVM IR (-O2):
define i64 @client_socket_write_(i32* nocapture %0, i8* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
%6 = tail call i64 @write(i32 %4, i8* %1, i32 %5)
ret i64 %6
}
/* Type definitions */
typedef char const int8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, char const);
char strlen(char const *);
void copy_char(char **pointer, const char *value) {
  int8_t size = strlen(value);
  memcpy(*pointer, &size, 1);
  *pointer += 1;
  memcpy(*pointer, value, size);
  *pointer += size;
}


x86 assembly (clang, -O0):
<copy_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%al
movsbl %al,%edx
call   1040 <memcpy@plt>
movsbl -0x11(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_char>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %al,0x7(%rsp)
mov    (%rbx),%rdi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <memcpy@plt>
mov    (%rbx),%rdi
add    $0x1,%rdi
mov    %rdi,(%rbx)
movsbl 0x7(%rsp),%edx
mov    %r14,%rsi
call   1040 <memcpy@plt>
movsbq 0x7(%rsp),%rax
add    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @copy_char(i8** nocapture %0, i8* %1) {
%3 = alloca i8
%4 = tail call signext i8 @strlen(i8* %1)
store i8 %4, i8* %3
%5 = load i8*, i8** %0
%6 = call i32 @memcpy(i8* %5, i8* %3, i8 signext 1)
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %3
%10 = call i32 @memcpy(i8* %8, i8* %1, i8 signext %9)
%11 = load i8, i8* %3
%12 = load i8*, i8** %0
%13 = sext i8 %11 to i64
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8* %14, i8** %0
ret void
}
void invalidate_bdev(struct block_device *x, int y) { return; }


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

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

LLVM IR (-O0):
%struct.block_device = type opaque
define void @invalidate_bdev(%struct.block_device* %0, i32 %1) {
%3 = alloca %struct.block_device*
%4 = alloca i32
store %struct.block_device* %0, %struct.block_device** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.block_device = type opaque
define void @invalidate_bdev(%struct.block_device* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ string_equal_display_error(char const *const,
                                              char const *const);
void _assert_string_equal(const char *const a, const char *const b,
                          const char *const file, const int line) {
  if (!string_equal_display_error(a, b)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_string_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <string_equal_display_error@plt>
cmp    $0x0,%eax
jne    1159 <_assert_string_equal+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_string_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <string_equal_display_error@plt>
test   %eax,%eax
je     1138 <_assert_string_equal+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

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

LLVM IR (-O2):
define void @_assert_string_equal(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @string_equal_display_error(i8* %0, i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_fail(i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int trurl_default_cmpf(const void *a, const void *b) {
  return (size_t)a - (size_t)b;
}


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

x86 assembly (clang, -O2):
<trurl_default_cmpf>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @trurl_default_cmpf(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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @trurl_default_cmpf(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
struct mthca_fmr *to_mfmr(struct ib_fmr *ibmr) {
  const struct ib_fmr *__mptr = (ibmr);
  return (struct mthca_fmr *)((char *)__mptr);
}


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

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

LLVM IR (-O0):
%struct.mthca_fmr = type opaque
%struct.ib_fmr = type opaque
define %struct.mthca_fmr* @to_mfmr(%struct.ib_fmr* %0) {
%2 = alloca %struct.ib_fmr*
%3 = alloca %struct.ib_fmr*
store %struct.ib_fmr* %0, %struct.ib_fmr** %2
%4 = load %struct.ib_fmr*, %struct.ib_fmr** %2
store %struct.ib_fmr* %4, %struct.ib_fmr** %3
%5 = load %struct.ib_fmr*, %struct.ib_fmr** %3
%6 = bitcast %struct.ib_fmr* %5 to i8*
%7 = bitcast i8* %6 to %struct.mthca_fmr*
ret %struct.mthca_fmr* %7
}

LLVM IR (-O2):
%struct.mthca_fmr = type opaque
%struct.ib_fmr = type opaque
define %struct.mthca_fmr* @to_mfmr(%struct.ib_fmr* readnone %0) {
%2 = bitcast %struct.ib_fmr* %0 to %struct.mthca_fmr*
ret %struct.mthca_fmr* %2
}
extern void foo(void) {}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int read_multprec_target_system(int decimals) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(491, &decimals, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<read_multprec_target_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1eb,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_multprec_target_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1eb,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_multprec_target_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 491, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_multprec_target_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 491, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ T3D_OutputMessage(char *);
void T3D_PrintBanner(void) {
  T3D_OutputMessage(
      "\nphoto23d  Copyright (C) 2014-2015 Dave Gorst\n"
      "============================================\n\n"
      "This program comes with ABSOLUTELY NO WARRANTY.\n"
      "This is free software, and you are welcome to redistribute it\n"
      "under certain conditions.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [230 x i8] c"\0Aphoto23d Copyright (C) 2014-2015 Dave Gorst\0A============================================\0A\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions.\0A\0A\00"
define void @T3D_PrintBanner() {
%1 = call i32 @T3D_OutputMessage(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [230 x i8] c"\0Aphoto23d Copyright (C) 2014-2015 Dave Gorst\0A============================================\0A\0AThis program comes with ABSOLUTELY NO WARRANTY.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions.\0A\0A\00"
define void @T3D_PrintBanner() {
%1 = tail call i32 @T3D_OutputMessage(i8* getelementptr inbounds ([230 x i8], [230 x i8]* @.str, i64 0, i64 0))
ret void
}
double compute_dp_de(const double gamma_zero, const double coeff_b,
                     const double epsv, const double specific_volume) {
  return (gamma_zero * (1.0 - epsv) + coeff_b * epsv) / specific_volume;
}


x86 assembly (clang, -O0):
<compute_dp_de>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xedb(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_dp_de>:
movsd  0xef8(%rip),%xmm4
subsd  %xmm2,%xmm4
mulsd  %xmm2,%xmm1
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @compute_dp_de(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fsub double 1.000000e+00, %10
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = call double @llvm.fmuladd.f64(double %9, double %11, double %14)
%16 = load double, double* %8
%17 = fdiv double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @compute_dp_de(double %0, double %1, double %2, double %3) {
%5 = fsub double 1.000000e+00, %2
%6 = fmul double %1, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %5, double %6)
%8 = fdiv double %7, %3
ret double %8
}
int flowkey_match(struct pna_flowkey *key_a, struct pna_flowkey *key_b) {
  unsigned long long a_hi, a_lo, b_hi, b_lo;
  a_hi = *(unsigned long long *)key_a;
  a_lo = *((unsigned long long *)key_a + 1);
  b_hi = *(unsigned long long *)key_b;
  b_lo = *((unsigned long long *)key_b + 1);
  return (a_hi == b_hi) && (a_lo == b_lo);
}


x86 assembly (clang, -O0):
<flowkey_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x28(%rbp),%rcx
mov    %al,-0x31(%rbp)
jne    115b <flowkey_match+0x5b>
mov    -0x20(%rbp),%rax
cmp    -0x30(%rbp),%rax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flowkey_match>:
mov    (%rdi),%rcx
mov    0x8(%rdi),%rdx
xor    (%rsi),%rcx
xor    0x8(%rsi),%rdx
xor    %eax,%eax
or     %rcx,%rdx
sete   %al
ret

LLVM IR (-O0):
%struct.pna_flowkey = type opaque
define i32 @flowkey_match(%struct.pna_flowkey* %0, %struct.pna_flowkey* %1) {
%3 = alloca %struct.pna_flowkey*
%4 = alloca %struct.pna_flowkey*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store %struct.pna_flowkey* %0, %struct.pna_flowkey** %3
store %struct.pna_flowkey* %1, %struct.pna_flowkey** %4
%9 = load %struct.pna_flowkey*, %struct.pna_flowkey** %3
%10 = bitcast %struct.pna_flowkey* %9 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %5
%12 = load %struct.pna_flowkey*, %struct.pna_flowkey** %3
%13 = bitcast %struct.pna_flowkey* %12 to i64*
%14 = getelementptr inbounds i64, i64* %13, i64 1
%15 = load i64, i64* %14
store i64 %15, i64* %6
%16 = load %struct.pna_flowkey*, %struct.pna_flowkey** %4
%17 = bitcast %struct.pna_flowkey* %16 to i64*
%18 = load i64, i64* %17
store i64 %18, i64* %7
%19 = load %struct.pna_flowkey*, %struct.pna_flowkey** %4
%20 = bitcast %struct.pna_flowkey* %19 to i64*
%21 = getelementptr inbounds i64, i64* %20, i64 1
%22 = load i64, i64* %21
store i64 %22, i64* %8
%23 = load i64, i64* %5
%24 = load i64, i64* %7
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %30
26: ; preds = %2
%27 = load i64, i64* %6
%28 = load i64, i64* %8
%29 = icmp eq i64 %27, %28
br label %30
30: ; preds = %26, %2
%31 = phi i1 [ false, %2 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
%struct.pna_flowkey = type opaque
define i32 @flowkey_match(%struct.pna_flowkey* nocapture %0, %struct.pna_flowkey* nocapture %1) {
%3 = bitcast %struct.pna_flowkey* %0 to i64*
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %3, i64 1
%6 = load i64, i64* %5
%7 = bitcast %struct.pna_flowkey* %1 to i64*
%8 = load i64, i64* %7
%9 = getelementptr inbounds i64, i64* %7, i64 1
%10 = load i64, i64* %9
%11 = icmp eq i64 %4, %8
%12 = icmp eq i64 %6, %10
%13 = select i1 %11, i1 %12, i1 false
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, int, int, int);
int read(int, int *, int);
int write(int, int *, int);
uint8_t read_byte(int fd, uint8_t address) {
  return 0;
  uint8_t dataBuffer[0x08];
  uint8_t buff[0x08];
  buff[0] = address;
  if (write(fd, buff, 0x08) != 0x08) {
    printf(
        "I2C slave 0x%x failed to go to register 0x%x [read_byte():write %d]",
        0x00, address, errno);
    return (-1);
  } else {
    if (read(fd, dataBuffer, 0x08) != 0x08) {
      printf("Could not read from I2C slave 0x%x, register 0x%x "
             "[read_byte():read %d]",
             0x00, address, errno);
      return (-1);
    }
  }
  return 0;
}


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

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

LLVM IR (-O0):
@errno = global i32 0
define i32 @read_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x i32]
%6 = alloca [8 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @read_byte(i32 %0, i32 %1) {
ret i32 0
}
int clk_enable(struct clk *c) { return 0; }


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define i32 @clk_enable(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
ret i32 0
}

LLVM IR (-O2):
%struct.clk = type opaque
define i32 @clk_enable(%struct.clk* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nxtClearPixel(int, int);
void clearline(int xc, int s, int e) {
  for (int i = s; i <= e; i++) {
    nxtClearPixel(xc, i);
  }
}


x86 assembly (clang, -O0):
<clearline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     114c <clearline+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <nxtClearPixel@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <clearline+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearline>:
push   %rbp
push   %r14
push   %rbx
cmp    %edx,%esi
jg     1141 <clearline+0x31>
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %ebp,%esi
call   1030 <nxtClearPixel@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <clearline+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @clearline(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %1, %3 ]
%8 = tail call i32 @nxtClearPixel(i32 %0, i32 %7)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %2
br i1 %10, label %5, label %6
}
int test_imm_58uint32_mem(unsigned int *val) {
  return ((*val) & (0x58 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_58uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 88
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ flush_stdin();
void signal_handler(int sig) {
  flush_stdin();
  exit(128 + sig);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <flush_stdin@plt>
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <flush_stdin@plt>
sub    $0xffffff80,%ebx
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @flush_stdin()
%4 = load i32, i32* %2
%5 = add nsw i32 128, %4
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @flush_stdin()
%3 = add nsw i32 %0, 128
%4 = tail call i32 @exit(i32 %3)
unreachable
}
long double _Complex div_long_double_rc(long double a, long double _Complex b) {
  return a / b;
}


x86 assembly (clang, -O0):
<div_long_double_rc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0x20(%rbp),%rax
fldt   0x10(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldt   (%rax)
fldt   0x10(%rax)
mov    %rsp,%rax
fstpt  0x30(%rax)
fstpt  0x20(%rax)
fldz
fstpt  0x10(%rax)
fstpt  (%rax)
call   1150 <__divxc3>
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
add    $0x70,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<div_long_double_rc>:
sub    $0x48,%rsp
fldt   0x50(%rsp)
fldt   0x60(%rsp)
fldt   0x70(%rsp)
fstpt  0x30(%rsp)
fstpt  0x20(%rsp)
fldz
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1130 <__divxc3>
add    $0x48,%rsp
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @div_long_double_rc(x86_fp80 %0, { x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 0
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i32 0, i32 1
%9 = load x86_fp80, x86_fp80* %8
%10 = call { x86_fp80, x86_fp80 } @__divxc3(x86_fp80 %5, x86_fp80 0xK00000000000000000000, x86_fp80 %7, x86_fp80 %9)
%11 = extractvalue { x86_fp80, x86_fp80 } %10, 0
%12 = extractvalue { x86_fp80, x86_fp80 } %10, 1
%13 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%14 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %11, x86_fp80* %13
store x86_fp80 %12, x86_fp80* %14
%15 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %15
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @div_long_double_rc(x86_fp80 %0, { x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %1, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = tail call { x86_fp80, x86_fp80 } @__divxc3(x86_fp80 %0, x86_fp80 0xK00000000000000000000, x86_fp80 %4, x86_fp80 %6)
ret { x86_fp80, x86_fp80 } %7
}
/* Type definitions */
struct twhlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ twhlist_del_init(struct twhlist_node *);
void twhash_del(struct twhlist_node *node) { twhlist_del_init(node); }


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

x86 assembly (clang, -O2):
<twhash_del>:
jmp    1030 <twhlist_del_init@plt>

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

LLVM IR (-O2):
%struct.twhlist_node = type { i32 }
define void @twhash_del(%struct.twhlist_node* %0) {
%2 = tail call i32 @twhlist_del_init(%struct.twhlist_node* %0)
ret void
}
/* Type definitions */
struct md5_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ md5_init(struct md5_s *);
void InitMD5(struct md5_s *h) { md5_init(h); }


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

x86 assembly (clang, -O2):
<InitMD5>:
jmp    1030 <md5_init@plt>

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

LLVM IR (-O2):
%struct.md5_s = type { i32 }
define void @InitMD5(%struct.md5_s* %0) {
%2 = tail call i32 @md5_init(%struct.md5_s* %0)
ret void
}
/* Type definitions */
struct raw_pkt_bsmp {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ raw_bsmp_hton(struct raw_pkt_bsmp *);
size_t raw_bsmp_size(struct raw_pkt_bsmp *);
int /*<<< orphan*/ send(int, struct raw_pkt_bsmp *, size_t const, int);
ssize_t raw_bsmp_send(int sockfd, struct raw_pkt_bsmp *bsmp, int flags) {
  const size_t size = raw_bsmp_size(bsmp);
  raw_bsmp_hton(bsmp);
  return send(sockfd, bsmp, size, flags);
}


x86 assembly (clang, -O0):
<raw_bsmp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <raw_bsmp_size@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <raw_bsmp_hton@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_bsmp_send>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%r15d
mov    %rsi,%rdi
call   1050 <raw_bsmp_size@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <raw_bsmp_hton@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
%struct.raw_pkt_bsmp = type { i32 }
define i32 @raw_bsmp_send(i32 %0, %struct.raw_pkt_bsmp* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.raw_pkt_bsmp*
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store %struct.raw_pkt_bsmp* %1, %struct.raw_pkt_bsmp** %5
store i32 %2, i32* %6
%8 = load %struct.raw_pkt_bsmp*, %struct.raw_pkt_bsmp** %5
%9 = call i64 @raw_bsmp_size(%struct.raw_pkt_bsmp* %8)
store i64 %9, i64* %7
%10 = load %struct.raw_pkt_bsmp*, %struct.raw_pkt_bsmp** %5
%11 = call i32 @raw_bsmp_hton(%struct.raw_pkt_bsmp* %10)
%12 = load i32, i32* %4
%13 = load %struct.raw_pkt_bsmp*, %struct.raw_pkt_bsmp** %5
%14 = load i64, i64* %7
%15 = load i32, i32* %6
%16 = call i32 @send(i32 %12, %struct.raw_pkt_bsmp* %13, i64 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.raw_pkt_bsmp = type { i32 }
define i32 @raw_bsmp_send(i32 %0, %struct.raw_pkt_bsmp* %1, i32 %2) {
%4 = tail call i64 @raw_bsmp_size(%struct.raw_pkt_bsmp* %1)
%5 = tail call i32 @raw_bsmp_hton(%struct.raw_pkt_bsmp* %1)
%6 = tail call i32 @send(i32 %0, %struct.raw_pkt_bsmp* %1, i64 %4, i32 %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogControlHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void DebugLogControlLogging() { UAVObjLogging(DebugLogControlHandle()); }


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

x86 assembly (clang, -O2):
<DebugLogControlLogging>:
push   %rax
xor    %eax,%eax
call   1040 <DebugLogControlHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @DebugLogControlLogging() {
%1 = call i32 (...) @DebugLogControlHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DebugLogControlLogging() {
%1 = tail call i32 (...) @DebugLogControlHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
void pr9314() {
  printf(__PRETTY_FUNCTION__);
  printf(__func__);
}


x86 assembly (clang, -O0):
<pr9314>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@__PRETTY_FUNCTION__.pr9314 = [14 x i8] c"void pr9314()\00"
@__func__.pr9314 = [7 x i8] c"pr9314\00"
define void @pr9314() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__PRETTY_FUNCTION__.pr9314, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.pr9314, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__PRETTY_FUNCTION__.pr9314 = [14 x i8] c"void pr9314()\00"
@__func__.pr9314 = [7 x i8] c"pr9314\00"
define void @pr9314() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @__PRETTY_FUNCTION__.pr9314, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.pr9314, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AuxMagSensorHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AuxMagSensorRequestUpdate() { UAVObjRequestUpdate(AuxMagSensorHandle()); }


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

x86 assembly (clang, -O2):
<AuxMagSensorRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AuxMagSensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AuxMagSensorRequestUpdate() {
%1 = call i32 (...) @AuxMagSensorHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AuxMagSensorRequestUpdate() {
%1 = tail call i32 (...) @AuxMagSensorHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int read(int, void *, size_t);
ssize_t xread(int filedes, void *buffer, size_t size) {
  ssize_t err = read(filedes, buffer, size);
  if (err == -1) {
    perror("read() failed");
    exit(1);
  }
  return err;
}


x86 assembly (clang, -O0):
<xread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1176 <xread+0x46>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xread>:
push   %rax
call   1030 <read@plt>
cmp    $0xffffffff,%eax
je     113d <xread+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"read() failed\00"
define i32 @xread(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @read(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [14 x i8] c"read() failed\00"
define i32 @xread(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}