xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ call_kriger_region_(int *, double *, double *, int *,
                                       double *, double *, double *, double *);
void Kriger_Region(int num_in_samples, double *X_samples, double *Y_samples,
                   int num_out_samples, double *Y_out_samples, double min_value,
                   double max_value, double nuget_kri) {
  call_kriger_region_(&num_in_samples, X_samples, Y_samples, &num_out_samples,
                      Y_out_samples, &min_value, &max_value, &nuget_kri);
}


x86 assembly (clang, -O0):
<Kriger_Region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x1c(%rbp),%rcx
lea    -0x30(%rbp),%r9
lea    -0x38(%rbp),%r10
lea    -0x40(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <call_kriger_region_@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kriger_Region>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
mov    %ecx,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
lea    0x10(%rsp),%rax
lea    0x18(%rsp),%r10
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rcx
lea    0x20(%rsp),%r9
push   %rax
push   %r10
call   1030 <call_kriger_region_@plt>
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define void @Kriger_Region(i32 %0, double* %1, double* %2, i32 %3, double* %4, double %5, double %6, double %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %9
store i32 %3, i32* %10
store double %5, double* %11
store double %6, double* %12
store double %7, double* %13
%14 = call i32 @call_kriger_region_(i32* %9, double* %1, double* %2, i32* %10, double* %4, double* %11, double* %12, double* %13)
ret void
}
void pcp_def_psi_metrics(struct activity *a) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_def_psi_metrics(%struct.activity* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_xfree() {
  printf("NOT IMPLEMENTED:"
         "pa_xfree"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"NOT IMPLEMENTED:pa_xfree\0A\00"
define i32 @pa_xfree() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [25 x i8] c"NOT IMPLEMENTED:pa_xfree\00"
define i32 @pa_xfree() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void show_usage(const char *progname, int exitcode) {
  fprintf(stderr, "USAGE: %s [<ttydev>]\n", progname);
  exit(exitcode);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"USAGE: %s [<ttydev>]\0A\00"
define void @show_usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"USAGE: %s [<ttydev>]\0A\00"
define void @show_usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *application_type(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ replace_variable(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ send_status(int /*<<< orphan*/ *, int);
void send_stats(FILE *client, char *uri) {
  send_status(client, 200);
  fprintf(client, "Content-Type: %s\n\n", application_type(uri));
  replace_variable(client, uri);
}


x86 assembly (clang, -O0):
<send_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xc8,%esi
call   1030 <send_status@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <application_type@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xe83(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <replace_variable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_stats>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xc8,%esi
call   1030 <send_status@plt>
mov    %r14,%rdi
call   1050 <application_type@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1060 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <replace_variable@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Content-Type: %s\0A\0A\00"
define void @send_stats(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 = call i32 @send_status(i32* %5, i32 200)
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i8* @application_type(i8* %8)
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32*, i32** %3
%12 = load i8*, i8** %4
%13 = call i32 @replace_variable(i32* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Content-Type: %s\0A\0A\00"
define void @send_stats(i32* %0, i8* %1) {
%3 = tail call i32 @send_status(i32* %0, i32 200)
%4 = tail call i8* @application_type(i8* %1)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @replace_variable(i32* %0, i8* %1)
ret void
}
/* Variables and functions */
void *a9(int);
void *a8(int x) { return (((x >> 8) & 1) ? a9(x) : a9(x)); }


x86 assembly (clang, -O0):
<a8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a8+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a9@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a8+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a9@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a8>:
jmp    1030 <a9@plt>

LLVM IR (-O0):
define i8* @a8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a9(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a9(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a8(i32 %0) {
%2 = tail call i8* @a9(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ uart_init(int);
void console_init(void) { uart_init(0x44e09000); }


x86 assembly (clang, -O0):
<console_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e09000,%edi
call   1030 <uart_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_init>:
mov    $0x44e09000,%edi
jmp    1030 <uart_init@plt>

LLVM IR (-O0):
define void @console_init() {
%1 = call i32 @uart_init(i32 1155567616)
ret void
}

LLVM IR (-O2):
define void @console_init() {
%1 = tail call i32 @uart_init(i32 1155567616)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_IP;
int /*<<< orphan*/ SO_ORIGINAL_DST;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
               struct sockaddr_in *, size_t *);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int getOrigDst(int fd, struct sockaddr_in *dst) {
  size_t sock_sz = sizeof(*dst);
  memset(dst, 0, sizeof(*dst));
  return getsockopt(fd, SOL_IP, SO_ORIGINAL_DST, dst, &sock_sz);
}


x86 assembly (clang, -O0):
<getOrigDst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x4,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1040 <getsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOrigDst>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x4,(%rsp)
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r8
mov    %ebp,%edi
mov    %rbx,%rcx
call   1040 <getsockopt@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@SOL_IP = global i32 0
@SO_ORIGINAL_DST = global i32 0
define i32 @getOrigDst(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in*
%5 = alloca i64
store i32 %0, i32* %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
store i64 4, i64* %5
%6 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%7 = call i32 @memset(%struct.sockaddr_in* %6, i32 0, i32 4)
%8 = load i32, i32* %3
%9 = load i32, i32* @SOL_IP
%10 = load i32, i32* @SO_ORIGINAL_DST
%11 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%12 = call i32 @getsockopt(i32 %8, i32 %9, i32 %10, %struct.sockaddr_in* %11, i64* %5)
ret i32 %12
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@SOL_IP = global i32 0
@SO_ORIGINAL_DST = global i32 0
define i32 @getOrigDst(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 4, i64* %3
%5 = tail call i32 @memset(%struct.sockaddr_in* %1, i32 0, i32 4)
%6 = load i32, i32* @SOL_IP
%7 = load i32, i32* @SO_ORIGINAL_DST
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, %struct.sockaddr_in* %1, i64* %3)
ret i32 %8
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_w39_fwh(struct flashctx *);
int printlock_w39v040a(struct flashctx *);
int printlock_w39v040fa(struct flashctx *flash) {
  int ret = 0;
  ret = printlock_w39v040a(flash);
  ret |= printlock_w39_fwh(flash);
  return ret;
}


x86 assembly (clang, -O0):
<printlock_w39v040fa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printlock_w39v040a@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printlock_w39_fwh@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlock_w39v040fa>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <printlock_w39v040a@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <printlock_w39_fwh@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fa(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
%3 = alloca i32
store %struct.flashctx* %0, %struct.flashctx** %2
store i32 0, i32* %3
%4 = load %struct.flashctx*, %struct.flashctx** %2
%5 = call i32 @printlock_w39v040a(%struct.flashctx* %4)
store i32 %5, i32* %3
%6 = load %struct.flashctx*, %struct.flashctx** %2
%7 = call i32 @printlock_w39_fwh(%struct.flashctx* %6)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040fa(%struct.flashctx* %0) {
%2 = tail call i32 @printlock_w39v040a(%struct.flashctx* %0)
%3 = tail call i32 @printlock_w39_fwh(%struct.flashctx* %0)
%4 = or i32 %3, %2
ret i32 %4
}
int setup_running_timers(void) {}


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

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

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

LLVM IR (-O2):
define i32 @setup_running_timers() {
ret i32 undef
}
void FPURoundingModeSet(unsigned long ulMode) {
  (*((volatile unsigned long *)(0xE000EF3C))) =
      ((*((volatile unsigned long *)(0xE000EF3C))) & ~(0x00C00000)) | ulMode;
}


x86 assembly (clang, -O0):
<FPURoundingModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xe000ef3c,%eax
mov    (%rax),%rcx
and    $0xffffffffff3fffff,%rcx
or     -0x8(%rbp),%rcx
mov    $0xe000ef3c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPURoundingModeSet>:
mov    $0xe000ef3c,%eax
mov    $0xffffffffff3fffff,%rcx
and    (%rax),%rcx
or     %rdi,%rcx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @FPURoundingModeSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%4 = and i64 %3, -12582913
%5 = load i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3758157628 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPURoundingModeSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%3 = and i64 %2, -12582913
%4 = or i64 %3, %0
store volatile i64 %4, i64* inttoptr (i64 3758157628 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;

/* Variables and functions */
int getent(char **, int /*<<< orphan*/ *, char **, int, char const *,
           int /*<<< orphan*/, int /*<<< orphan*/ *);
int cgetent(char **buf, char **db_array, const char *name) {
  u_int dummy;
  return (getent(buf, &dummy, db_array, -1, name, 0, NULL));
}


x86 assembly (clang, -O0):
<cgetent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%r8
lea    -0x1c(%rbp),%rsi
mov    $0xffffffff,%ecx
xor    %r9d,%r9d
xor    %eax,%eax
movq   $0x0,(%rsp)
call   1030 <getent@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgetent>:
sub    $0x18,%rsp
mov    %rdx,%r8
mov    %rsi,%rdx
movq   $0x0,(%rsp)
lea    0x14(%rsp),%rsi
mov    $0xffffffff,%ecx
xor    %r9d,%r9d
call   1030 <getent@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cgetent(i8** %0, i8** %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%8 = load i8**, i8*** %4
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %6
%11 = call i32 @getent(i8** %8, i32* %7, i8** %9, i32 -1, i8* %10, i32 0, i32* null)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cgetent(i8** %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @getent(i8** %0, i32* %4, i8** %1, i32 -1, i8* %2, i32 0, i32* null)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int space_handler(char **save) {
  write_instr(0x00);
  write_imm(0x2C);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<space_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x2c,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x2c,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @space_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 44)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @space_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 44)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
void odp_mem_barrier(void) { __asm__ __volatile__("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @odp_mem_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int *outer6(int);
int *outer7(int);
void outer_test2(int x) {
  int *ip = outer6(x);
  int *ip2 = outer7(x);
}


x86 assembly (clang, -O0):
<outer_test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <outer6@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <outer7@plt>
mov    %rax,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outer_test2>:
push   %rbx
mov    %edi,%ebx
call   1030 <outer6@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <outer7@plt>

LLVM IR (-O0):
define void @outer_test2(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32* @outer6(i32 %5)
store i32* %6, i32** %3
%7 = load i32, i32* %2
%8 = call i32* @outer7(i32 %7)
store i32* %8, i32** %4
ret void
}

LLVM IR (-O2):
define void @outer_test2(i32 %0) {
%2 = tail call i32* @outer6(i32 %0)
%3 = tail call i32* @outer7(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
void component_cbox_get_param(void *handle, unsigned int index, char *buffer,
                              int buffer_size) {
  debug_warning(
      "[component_cbox_get_param] component_cbox does not take any parameters");
}


x86 assembly (clang, -O0):
<component_cbox_get_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <debug_warning@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [71 x i8] c"[component_cbox_get_param] component_cbox does not take any parameters\00"
define void @component_cbox_get_param(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 @debug_warning(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"[component_cbox_get_param] component_cbox does not take any parameters\00"
define void @component_cbox_get_param(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @debug_warning(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ vd_cmp(void *, void *, size_t);
int default_vd_score_func(void *a, void *b, size_t n) {
  if ((!a) || (!b)) {
    return 2;
  }
  if (vd_cmp(a, b, n) == 0) {
    return 0;
  }
  return 3;
}


x86 assembly (clang, -O0):
<default_vd_score_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <default_vd_score_func+0x2a>
cmpq   $0x0,-0x18(%rbp)
jne    1146 <default_vd_score_func+0x36>
movl   $0x2,-0x4(%rbp)
jmp    1174 <default_vd_score_func+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <vd_cmp@plt>
cmp    $0x0,%rax
jne    116d <default_vd_score_func+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1174 <default_vd_score_func+0x64>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_vd_score_func>:
mov    $0x2,%eax
test   %rdi,%rdi
je     1134 <default_vd_score_func+0x24>
test   %rsi,%rsi
je     1134 <default_vd_score_func+0x24>
push   %rax
call   1030 <vd_cmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @default_vd_score_func(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %10, %3
store i32 2, i32* %4
br label %22
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = call i64 @vd_cmp(i8* %15, i8* %16, i64 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i32 0, i32* %4
br label %22
21: ; preds = %14
store i32 3, i32* %4
br label %22
22: ; preds = %21, %20, %13
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @default_vd_score_func(i8* %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = tail call i64 @vd_cmp(i8* %0, i8* %1, i64 %2)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 0, i32 3
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ 2, %3 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int gettimeofday(struct timeval *ptimeval, void *ptimezone) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<gettimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @gettimeofday(%struct.timeval* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
scalar_t__ isspace(int);
char *strtrim_right_end(char *beg, char *end) {
  while (end > beg && isspace((int)*--end)) {
    *end = '\0';
  }
  return end;
}


x86 assembly (clang, -O0):
<strtrim_right_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x11(%rbp)
jbe    1155 <strtrim_right_end+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1165 <strtrim_right_end+0x55>
jmp    1171 <strtrim_right_end+0x61>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1120 <strtrim_right_end+0x10>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtrim_right_end>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    %rdi,%rsi
jbe    114c <strtrim_right_end+0x3c>
mov    %rdi,%r14
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
cs nopw 0x0(%rax,%rax,1)
mov    %rax,%rbx
movsbl (%rax),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     114c <strtrim_right_end+0x3c>
movb   $0x0,(%rbx)
lea    -0x1(%rbx),%rax
cmp    %r14,%rbx
ja     1130 <strtrim_right_end+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strtrim_right_end(i8* readnone %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %13
4: ; preds = %2, %11
%5 = phi i8* [ %6, %11 ], [ %1, %2 ]
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i64 @isspace(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %4
store i8 0, i8* %6
%12 = icmp ugt i8* %6, %0
br i1 %12, label %4, label %13
13: ; preds = %4, %11, %2
%14 = phi i8* [ %1, %2 ], [ %6, %11 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void reset_worker_signals(void) {
  signal(SIGTERM, SIG_DFL);
  signal(SIGINT, SIG_DFL);
}


x86 assembly (clang, -O0):
<reset_worker_signals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_worker_signals>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define void @reset_worker_signals() {
%1 = load i32, i32* @SIGTERM
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define void @reset_worker_signals() {
%1 = load i32, i32* @SIGTERM
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RunAllTests();
int /*<<< orphan*/ gets(char *);
int main() {
  char string[10];
  RunAllTests();
  gets(string);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <RunAllTests@plt>
lea    0xe(%rsp),%rdi
call   1040 <gets@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = call i32 (...) @RunAllTests()
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @RunAllTests()
%4 = call i32 @gets(i8* %2)
ret i32 0
}
unsigned long westwood_do_filter(unsigned long a, unsigned long b) {
  return (((7 * a) + b) >> 3);
}


x86 assembly (clang, -O0):
<westwood_do_filter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x7,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
shr    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<westwood_do_filter>:
lea    0x0(,%rdi,8),%rax
sub    %rdi,%rax
add    %rsi,%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @westwood_do_filter(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = mul i64 7, %5
%7 = load i64, i64* %4
%8 = add i64 %6, %7
%9 = lshr i64 %8, 3
ret i64 %9
}

LLVM IR (-O2):
define i64 @westwood_do_filter(i64 %0, i64 %1) {
%3 = mul i64 %0, 7
%4 = add i64 %3, %1
%5 = lshr i64 %4, 3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 10, y = 20;
  y /= x;
  printf("integer divission: %d\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebd(%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
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"integer divission: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = sdiv i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"integer divission: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
char *memcpy(char *, char *, int);
void memcpy0() {
  char src[] = {1, 2, 3, 4};
  char dst[4] = {0};
  memcpy(dst, src, 4);
  if (memcpy(dst, src, 4) != dst) {
    (void)*(char *)0;
  }
  if (dst[0] != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<memcpy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    -0x8(%rbp),%rcx
cmp    %rcx,%rax
je     1172 <memcpy0+0x52>
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
je     117f <memcpy0+0x5f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy0>:
push   %r14
push   %rbx
push   %rax
movl   $0x4030201,0x4(%rsp)
04
movl   $0x0,(%rsp)
mov    %rsp,%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.memcpy0.src = [4 x i8] c"\01\02\03\04"
define void @memcpy0() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = call i8* @memcpy(i8* %5, i8* %6, i32 4)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%10 = call i8* @memcpy(i8* %8, i8* %9, i32 4)
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%12 = icmp ne i8* %10, %11
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = load i8, i8* null
br label %15
15: ; preds = %13, %0
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i8, i8* null
br label %22
22: ; preds = %20, %15
ret void
}

LLVM IR (-O2):
define void @memcpy0() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i8* @memcpy(i8* %4, i8* %3, i32 4)
%6 = call i8* @memcpy(i8* %4, i8* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _MM_SET_FLUSH_ZERO_MODE(unsigned int);
void test_MM_SET_FLUSH_ZERO_MODE(unsigned int A) { _MM_SET_FLUSH_ZERO_MODE(A); }


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

x86 assembly (clang, -O2):
<test_MM_SET_FLUSH_ZERO_MODE>:
jmp    1030 <_MM_SET_FLUSH_ZERO_MODE@plt>

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

LLVM IR (-O2):
define void @test_MM_SET_FLUSH_ZERO_MODE(i32 %0) {
%2 = tail call i32 @_MM_SET_FLUSH_ZERO_MODE(i32 %0)
ret void
}
/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
int cputime(void) {
  if (CLOCKS_PER_SEC < 100000)
    return clock() * 1000 / CLOCKS_PER_SEC;
  return clock() / (CLOCKS_PER_SEC / 1000);
}


x86 assembly (clang, -O0):
<cputime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
cmpl   $0x186a0,(%rax)
jge    114a <cputime+0x3a>
mov    $0x0,%al
call   1030 <clock@plt>
imul   $0x3e8,%eax,%eax
mov    0x2ea9(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x4(%rbp)
jmp    1170 <cputime+0x60>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputime>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ece(%rip),%rbx
mov    (%rbx),%ebp
xor    %eax,%eax
call   1030 <clock@plt>
cmp    $0x1869f,%ebp
jg     1136 <cputime+0x26>
imul   $0x3e8,%eax,%eax
cltd
idivl  (%rbx)
jmp    1150 <cputime+0x40>
movslq (%rbx),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define i32 @cputime() {
%1 = alloca i32
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = icmp slt i32 %2, 100000
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = call i32 (...) @clock()
%6 = mul nsw i32 %5, 1000
%7 = load i32, i32* @CLOCKS_PER_SEC
%8 = sdiv i32 %6, %7
store i32 %8, i32* %1
br label %14
9: ; preds = %0
%10 = call i32 (...) @clock()
%11 = load i32, i32* @CLOCKS_PER_SEC
%12 = sdiv i32 %11, 1000
%13 = sdiv i32 %10, %12
store i32 %13, i32* %1
br label %14
14: ; preds = %9, %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define i32 @cputime() {
%1 = load i32, i32* @CLOCKS_PER_SEC
%2 = icmp slt i32 %1, 100000
%3 = tail call i32 (...) @clock()
br i1 %2, label %4, label %8
4: ; preds = %0
%5 = mul nsw i32 %3, 1000
%6 = load i32, i32* @CLOCKS_PER_SEC
%7 = sdiv i32 %5, %6
br label %12
8: ; preds = %0
%9 = load i32, i32* @CLOCKS_PER_SEC
%10 = sdiv i32 %9, 1000
%11 = sdiv i32 %3, %10
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ %7, %4 ], [ %11, %8 ]
ret i32 %13
}
void swap(double *a, double *b) {
  double tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swap(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
store double %7, double* %5
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = load double*, double** %3
store double %9, double* %10
%11 = load double, double* %5
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @swap(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_halt(int return_value) {
  return _bytecode_write(5, *(uint32_t *)&return_value, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<bytecode_halt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x5,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_halt>:
mov    %edi,%esi
mov    $0x5,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_bytecode_write@plt>

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

LLVM IR (-O2):
define i32 @bytecode_halt(i32 %0) {
%2 = tail call i32 @_bytecode_write(i32 5, i32 %0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}
void strength_test7(int *data) {
  int i = 0;
  do {
    if (data[1])
      i = i + 1;
    else
      i = i + 2;
    data[data[2]] = 2;
  } while (21 * i < data[3]);
}


x86 assembly (clang, -O0):
<strength_test7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     112b <strength_test7+0x2b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <strength_test7+0x34>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
imul   $0x15,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     110f <strength_test7+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test7>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpl   $0x1,0x4(%rdi)
adc    $0x0,%eax
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
mov    %eax,%ecx
add    $0x1,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rax,%rdx,4),%edx
add    $0x1,%edx
mov    %ecx,%eax
cmp    0xc(%rdi),%edx
jl     1110 <strength_test7+0x10>
ret

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

LLVM IR (-O2):
define void @strength_test7(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = getelementptr inbounds i32, i32* %0, i64 3
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %10, %5 ]
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 2, i32 1
%10 = add nuw nsw i32 %9, %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 2, i32* %13
%14 = mul nsw i32 %10, 21
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %5, label %17
17: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int PulseF1() {
  long int stat = 0;
  BNCIO(46);
  BNCIO(1);
  BNCIO(1);
  return (stat);
}


x86 assembly (clang, -O0):
<PulseF1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x2e,%edi
call   1030 <BNCIO@plt>
mov    $0x1,%edi
call   1030 <BNCIO@plt>
mov    $0x1,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PulseF1>:
push   %rax
mov    $0x2e,%edi
call   1030 <BNCIO@plt>
mov    $0x1,%edi
call   1030 <BNCIO@plt>
mov    $0x1,%edi
call   1030 <BNCIO@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @PulseF1() {
%1 = tail call i32 @BNCIO(i32 46)
%2 = tail call i32 @BNCIO(i32 1)
%3 = tail call i32 @BNCIO(i32 1)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ http_error_page_destroy();
int /*<<< orphan*/ http_parse_destroy();
extern void http_exit() {
  http_error_page_destroy();
  http_parse_destroy();
}


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

x86 assembly (clang, -O2):
<http_exit>:
push   %rax
xor    %eax,%eax
call   1030 <http_error_page_destroy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <http_parse_destroy@plt>

LLVM IR (-O0):
define void @http_exit() {
%1 = call i32 (...) @http_error_page_destroy()
%2 = call i32 (...) @http_parse_destroy()
ret void
}

LLVM IR (-O2):
define void @http_exit() {
%1 = tail call i32 (...) @http_error_page_destroy()
%2 = tail call i32 (...) @http_parse_destroy()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ espcomm_delay_ms(int);
int /*<<< orphan*/ serialport_send_break();
int /*<<< orphan*/ serialport_set_dtr(int);
void board_wifio_rb() {
  serialport_set_dtr(0);
  espcomm_delay_ms(5);
  serialport_set_dtr(1);
  espcomm_delay_ms(5);
  serialport_set_dtr(0);
  serialport_send_break();
}


x86 assembly (clang, -O0):
<board_wifio_rb>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
mov    $0x1,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x0,%al
call   1050 <serialport_send_break@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_wifio_rb>:
push   %rax
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
mov    $0x1,%edi
call   1040 <serialport_set_dtr@plt>
mov    $0x5,%edi
call   1030 <espcomm_delay_ms@plt>
xor    %edi,%edi
call   1040 <serialport_set_dtr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <serialport_send_break@plt>

LLVM IR (-O0):
define void @board_wifio_rb() {
%1 = call i32 @serialport_set_dtr(i32 0)
%2 = call i32 @espcomm_delay_ms(i32 5)
%3 = call i32 @serialport_set_dtr(i32 1)
%4 = call i32 @espcomm_delay_ms(i32 5)
%5 = call i32 @serialport_set_dtr(i32 0)
%6 = call i32 (...) @serialport_send_break()
ret void
}

LLVM IR (-O2):
define void @board_wifio_rb() {
%1 = tail call i32 @serialport_set_dtr(i32 0)
%2 = tail call i32 @espcomm_delay_ms(i32 5)
%3 = tail call i32 @serialport_set_dtr(i32 1)
%4 = tail call i32 @espcomm_delay_ms(i32 5)
%5 = tail call i32 @serialport_set_dtr(i32 0)
%6 = tail call i32 (...) @serialport_send_break()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void IfaceInvitation() { printf("yamsh>"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"yamsh>\00"
define void @IfaceInvitation() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ENDIAN_REVERSE_32(int /*<<< orphan*/);
void __PUT_UINT32_WITH_REVERSE(uint32_t *addr, uint32_t val) {
  (*(uint32_t *)(((uint8_t *)(addr)) + (0))) = ENDIAN_REVERSE_32(val);
}


x86 assembly (clang, -O0):
<__PUT_UINT32_WITH_REVERSE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ENDIAN_REVERSE_32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__PUT_UINT32_WITH_REVERSE>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <ENDIAN_REVERSE_32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__PUT_UINT32_WITH_REVERSE(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @ENDIAN_REVERSE_32(i32 %5)
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @__PUT_UINT32_WITH_REVERSE(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @ENDIAN_REVERSE_32(i32 %1)
store i32 %3, i32* %0
ret void
}