xunge/DecIR huggingface dataset:
unsigned int aml_get_rtc_counter(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @aml_get_rtc_counter() {
ret i32 0
}

LLVM IR (-O2):
define i32 @aml_get_rtc_counter() {
ret i32 0
}
unsigned short ToU16(unsigned long a) {
  unsigned short out = (a >> 8) & 0xF800;
  out |= (a >> 5) & 0x07E0;
  out |= (a >> 3) & 0x001F;
  return out;
}


x86 assembly (clang, -O0):
<ToU16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xf800,%rax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
shr    $0x5,%rcx
and    $0x7e0,%rcx
movzwl -0xa(%rbp),%eax
or     %rcx,%rax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
shr    $0x3,%rcx
and    $0x1f,%rcx
movzwl -0xa(%rbp),%eax
or     %rcx,%rax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToU16>:
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf800,%ecx
mov    %edi,%eax
shr    $0x5,%eax
and    $0x7e0,%eax
or     %ecx,%eax
shr    $0x3,%edi
and    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @ToU16(i64 %0) {
%2 = alloca i64
%3 = alloca i16
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = lshr i64 %4, 8
%6 = and i64 %5, 63488
%7 = trunc i64 %6 to i16
store i16 %7, i16* %3
%8 = load i64, i64* %2
%9 = lshr i64 %8, 5
%10 = and i64 %9, 2016
%11 = load i16, i16* %3
%12 = zext i16 %11 to i64
%13 = or i64 %12, %10
%14 = trunc i64 %13 to i16
store i16 %14, i16* %3
%15 = load i64, i64* %2
%16 = lshr i64 %15, 3
%17 = and i64 %16, 31
%18 = load i16, i16* %3
%19 = zext i16 %18 to i64
%20 = or i64 %19, %17
%21 = trunc i64 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @ToU16(i64 %0) {
%2 = lshr i64 %0, 8
%3 = and i64 %2, 63488
%4 = lshr i64 %0, 5
%5 = and i64 %4, 2016
%6 = or i64 %3, %5
%7 = lshr i64 %0, 3
%8 = and i64 %7, 31
%9 = or i64 %6, %8
%10 = trunc i64 %9 to i16
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_NDELAY;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int main() {
  openlog("ZXTEST", LOG_NDELAY, LOG_USER);
  syslog(LOG_INFO, "%s", "zx test");
  closelog();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    0xea8(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
lea    0xe96(%rip),%rdx
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0xeb6(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
lea    0xea4(%rip),%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ZXTEST\00"
@LOG_NDELAY = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"zx test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_USER
%4 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = load i32, i32* @LOG_INFO
%6 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"ZXTEST\00"
@LOG_NDELAY = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"zx test\00"
define i32 @main() {
%1 = load i32, i32* @LOG_NDELAY
%2 = load i32, i32* @LOG_USER
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = load i32, i32* @LOG_INFO
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @closelog()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() { printf("%u", -1); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void main() { f(2); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @f(i32 2)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @f(i32 2)
ret void
}
int abs(int val) {
  if (val < 0)
    return -val;
  else
    return val;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sendbuf(char *);
void snewline() { sendbuf("\r\n"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @snewline() {
%1 = call i32 @sendbuf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @snewline() {
%1 = tail call i32 @sendbuf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct libgamma_partition_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libgamma_partition_state *);
int /*<<< orphan*/
libgamma_partition_destroy(struct libgamma_partition_state *);
__attribute__((__nonnull__)) void
libgamma_partition_free(struct libgamma_partition_state *restrict this__) {
  libgamma_partition_destroy(this__);
  free(this__);
}


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

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

LLVM IR (-O0):
%struct.libgamma_partition_state = type { i32 }
define void @libgamma_partition_free(%struct.libgamma_partition_state* noalias %0) {
%2 = alloca %struct.libgamma_partition_state*
store %struct.libgamma_partition_state* %0, %struct.libgamma_partition_state** %2
%3 = load %struct.libgamma_partition_state*, %struct.libgamma_partition_state** %2
%4 = call i32 @libgamma_partition_destroy(%struct.libgamma_partition_state* %3)
%5 = load %struct.libgamma_partition_state*, %struct.libgamma_partition_state** %2
%6 = call i32 @free(%struct.libgamma_partition_state* %5)
ret void
}

LLVM IR (-O2):
%struct.libgamma_partition_state = type { i32 }
define void @libgamma_partition_free(%struct.libgamma_partition_state* noalias %0) {
%2 = tail call i32 @libgamma_partition_destroy(%struct.libgamma_partition_state* %0)
%3 = tail call i32 @free(%struct.libgamma_partition_state* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmRadians3f_(float *);
void glmSinD3f_(float angle[3]) {
  glmRadians3f_(angle);
  glmSinD3f_(angle);
}


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

x86 assembly (clang, -O2):
<glmSinD3f_>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <glmRadians3f_@plt>
jmp    1120 <glmSinD3f_+0x10>

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

LLVM IR (-O2):
define void @glmSinD3f_(float* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @glmRadians3f_(float* %0)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *x) {
  fprintf(stderr, "Usage: %s -x|-t <file>\n", x);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s -x|-t <file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int stderr_putchar(int ch) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @stderr_putchar(i32 %0) {
ret i32 -1
}
void vector_multiply(double m, double u[], double w[]) {
  for (int i = 0; i < 3; i++)
    w[i] = m * u[i];
}


x86 assembly (clang, -O0):
<vector_multiply>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    114f <vector_multiply+0x4f>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1118 <vector_multiply+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_multiply>:
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsi)
mulsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

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

LLVM IR (-O2):
define void @vector_multiply(double %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = fmul double %4, %0
store double %5, double* %2
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fmul double %7, %0
%9 = getelementptr inbounds double, double* %2, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 2
%11 = load double, double* %10
%12 = fmul double %11, %0
%13 = getelementptr inbounds double, double* %2, i64 2
store double %12, double* %13
ret void
}
XUnionRectWithRegion() {}


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

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

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

LLVM IR (-O2):
define i32 @XUnionRectWithRegion() {
ret i32 undef
}
int do_584() { return 584; }


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

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

LLVM IR (-O0):
define i32 @do_584() {
ret i32 584
}

LLVM IR (-O2):
define i32 @do_584() {
ret i32 584
}
/* Variables and functions */
int sn_decode_crlf(char **, char *);
int sn_decode_len(char **, char *);
int sn_decode_int(char **p, char *end) {
  int len = sn_decode_len(p, end);
  if (len < 0)
    return len;
  int rc = sn_decode_crlf(p, end);
  if (rc < 0)
    return rc;
  return len;
}


x86 assembly (clang, -O0):
<sn_decode_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <sn_decode_len@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1155 <sn_decode_int+0x35>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <sn_decode_int+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <sn_decode_crlf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    117a <sn_decode_int+0x5a>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <sn_decode_int+0x60>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sn_decode_int>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <sn_decode_len@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1146 <sn_decode_int+0x26>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <sn_decode_crlf@plt>
test   %eax,%eax
cmovs  %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @sn_decode_int(i8** %0, i8* %1) {
%3 = tail call i32 @sn_decode_len(i8** %0, i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @sn_decode_crlf(i8** %0, i8* %1)
%7 = icmp slt i32 %6, 0
%8 = select i1 %7, i32 %6, i32 %3
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ %3, %2 ]
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int depth;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_depth(void *_p, int _v) {
  ((XWindowAttributes *)_p)->depth = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_depth>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_depth(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_depth(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int fun1144() { return 1144; }


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

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

LLVM IR (-O0):
define i32 @fun1144() {
ret i32 1144
}

LLVM IR (-O2):
define i32 @fun1144() {
ret i32 1144
}
int test_imm_FFint64_midword_reg(long long val) {
  return ((val >> 16) & (0xFF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FFint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xff,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FFint64_midword_reg>:
test   $0xff0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FFint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 255
%6 = icmp ne i64 %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_FFint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16711680
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __attribute__((weak)) tim3_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<tim3_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim3_isr = [9 x i8] c"tim3_isr\00"
define weak void @tim3_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.tim3_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim3_isr = [9 x i8] c"tim3_isr\00"
define weak void @tim3_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.tim3_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void negDelta(void) { printf("\nThere are two complex roots.\n"); }


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"\0AThere are two complex roots.\0A\00"
define void @negDelta() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"\0AThere are two complex roots.\00"
define void @negDelta() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned long sub4(unsigned long i) { return (i << 52) >> 52; }


x86 assembly (clang, -O0):
<sub4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x34,%rax
shr    $0x34,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub4>:
mov    %rdi,%rax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i64 @sub4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 52
%5 = lshr i64 %4, 52
ret i64 %5
}

LLVM IR (-O2):
define i64 @sub4(i64 %0) {
%2 = and i64 %0, 4095
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ rcu_barrier_sched();
void rcu_barrier(void) { rcu_barrier_sched(); }


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

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

LLVM IR (-O0):
define void @rcu_barrier() {
%1 = call i32 (...) @rcu_barrier_sched()
ret void
}

LLVM IR (-O2):
define void @rcu_barrier() {
%1 = tail call i32 (...) @rcu_barrier_sched()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snmp_disable_calllog();
int /*<<< orphan*/ snmp_disable_filelog();
int /*<<< orphan*/ snmp_disable_stderrlog();
int /*<<< orphan*/ snmp_disable_syslog();
void snmp_disable_log(void) {
  snmp_disable_syslog();
  snmp_disable_filelog();
  snmp_disable_stderrlog();
  snmp_disable_calllog();
}


x86 assembly (clang, -O0):
<snmp_disable_log>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <snmp_disable_syslog@plt>
mov    $0x0,%al
call   1040 <snmp_disable_filelog@plt>
mov    $0x0,%al
call   1050 <snmp_disable_stderrlog@plt>
mov    $0x0,%al
call   1060 <snmp_disable_calllog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<snmp_disable_log>:
push   %rax
xor    %eax,%eax
call   1030 <snmp_disable_syslog@plt>
xor    %eax,%eax
call   1040 <snmp_disable_filelog@plt>
xor    %eax,%eax
call   1050 <snmp_disable_stderrlog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <snmp_disable_calllog@plt>

LLVM IR (-O0):
define void @snmp_disable_log() {
%1 = call i32 (...) @snmp_disable_syslog()
%2 = call i32 (...) @snmp_disable_filelog()
%3 = call i32 (...) @snmp_disable_stderrlog()
%4 = call i32 (...) @snmp_disable_calllog()
ret void
}

LLVM IR (-O2):
define void @snmp_disable_log() {
%1 = tail call i32 (...) @snmp_disable_syslog()
%2 = tail call i32 (...) @snmp_disable_filelog()
%3 = tail call i32 (...) @snmp_disable_stderrlog()
%4 = tail call i32 (...) @snmp_disable_calllog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int, int);
char *net_receive(int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strncmp(char *, char *, int);
char *ftpexpect(int in, char *exp) {
  char *packet = net_receive(in);
  printf("%s", packet);
  if (strncmp(packet, exp, 4) != 0)
    die("Response", 1, in);
  return packet;
}


x86 assembly (clang, -O0):
<ftpexpect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <net_receive@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     119b <ftpexpect+0x5b>
mov    -0x4(%rbp),%edx
lea    0xe72(%rip),%rdi
mov    $0x1,%esi
call   1060 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftpexpect>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1050 <net_receive@plt>
mov    %rax,%rbx
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1188 <ftpexpect+0x48>
lea    0xe87(%rip),%rdi
mov    $0x1,%esi
mov    %ebp,%edx
call   1060 <die@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"Response\00"
define i8* @ftpexpect(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i8* @net_receive(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = call i64 @strncmp(i8* %10, i8* %11, i32 4)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* %3
%16 = call i32 @die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %15)
br label %17
17: ; preds = %14, %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"Response\00"
define i8* @ftpexpect(i32 %0, i8* %1) {
%3 = tail call i8* @net_receive(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i64 @strncmp(i8* %3, i8* %1, i32 4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %0)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
int LZ4_sizeofState(void) {
  return (((1 << (14 - 3)) + 4 + ((sizeof(void *) == 16) ? 4 : 0)) *
          sizeof(unsigned long long));
}


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

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

LLVM IR (-O0):
define i32 @LZ4_sizeofState() {
ret i32 16416
}

LLVM IR (-O2):
define i32 @LZ4_sizeofState() {
ret i32 16416
}
short *test_func_02(short *p, int *x) {
  int r = 0;
  r += *p++;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
<test_func_02>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
movswl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
movswl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_02>:
movswl (%rdi),%ecx
movswl 0x2(%rdi),%edx
lea    0x4(%rdi),%rax
add    %ecx,%edx
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define i16* @test_func_02(i16* %0, i32* %1) {
%3 = alloca i16*
%4 = alloca i32*
%5 = alloca i32
store i16* %0, i16** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i16*, i16** %3
%7 = getelementptr inbounds i16, i16* %6, i32 1
store i16* %7, i16** %3
%8 = load i16, i16* %6
%9 = sext i16 %8 to i32
%10 = load i32, i32* %5
%11 = add nsw i32 %10, %9
store i32 %11, i32* %5
%12 = load i16*, i16** %3
%13 = getelementptr inbounds i16, i16* %12, i32 1
store i16* %13, i16** %3
%14 = load i16, i16* %12
%15 = sext i16 %14 to i32
%16 = load i32, i32* %5
%17 = add nsw i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32*, i32** %4
store i32 %18, i32* %19
%20 = load i16*, i16** %3
ret i16* %20
}

LLVM IR (-O2):
define i16* @test_func_02(i16* %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %0
%5 = sext i16 %4 to i32
%6 = getelementptr inbounds i16, i16* %0, i64 2
%7 = load i16, i16* %3
%8 = sext i16 %7 to i32
%9 = add nsw i32 %8, %5
store i32 %9, i32* %1
ret i16* %6
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ *setlocale(int /*<<< orphan*/, char *);
void nocrash_setlocale() {
  if (setlocale(LC_ALL, NULL) == NULL) {
    int *p = NULL;
    *p = 42;
  }
  setlocale(LC_ALL, "");
  setlocale(LC_ALL, "C");
}


x86 assembly (clang, -O0):
<nocrash_setlocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setlocale@plt>
cmp    $0x0,%rax
jne    1146 <nocrash_setlocale+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <setlocale@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe95(%rip),%rsi
call   1030 <setlocale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_setlocale>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
call   1030 <setlocale@plt>
mov    (%rbx),%edi
lea    0xed7(%rip),%rsi
call   1030 <setlocale@plt>
mov    (%rbx),%edi
lea    0xec8(%rip),%rsi
pop    %rbx
jmp    1030 <setlocale@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define void @nocrash_setlocale() {
%1 = alloca i32*
%2 = load i32, i32* @LC_ALL
%3 = call i32* @setlocale(i32 %2, i8* null)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
store i32* null, i32** %1
%6 = load i32*, i32** %1
store i32 42, i32* %6
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* @LC_ALL
%9 = call i32* @setlocale(i32 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @LC_ALL
%11 = call i32* @setlocale(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define void @nocrash_setlocale() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32* @setlocale(i32 %1, i8* null)
%3 = icmp ne i32* %2, null
tail call void @llvm.assume(i1 %3)
%4 = load i32, i32* @LC_ALL
%5 = tail call i32* @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @LC_ALL
%7 = tail call i32* @setlocale(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void isNull(void *ptr) {
  if (ptr == NULL) {
    printf("%s        PASSED!\n%s", "\x1B[32m", "\x1B[0m");
  } else {
    printf("%s        NOT PASSED!\n        pointer is not null%s\n", "\x1B[31m",
           "\x1B[0m");
  }
}


x86 assembly (clang, -O0):
<isNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <isNull+0x36>
lea    0xed2(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xedf(%rip),%rdx
call   1030 <printf@plt>
jmp    1160 <isNull+0x50>
lea    0xed3(%rip),%rdi
lea    0xf01(%rip),%rsi
lea    0xec0(%rip),%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNull>:
test   %rdi,%rdi
je     112f <isNull+0x1f>
lea    0xf04(%rip),%rdi
lea    0xf32(%rip),%rsi
lea    0xef1(%rip),%rdx
jmp    1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0xed8(%rip),%rsi
lea    0xed7(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s PASSED!\0A%s\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [53 x i8] c"%s NOT PASSED!\0A pointer is not null%s\0A\00"
@.str.4 = [6 x i8] c"\1B[31m\00"
define void @isNull(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s PASSED!\0A%s\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [53 x i8] c"%s NOT PASSED!\0A pointer is not null%s\0A\00"
@.str.4 = [6 x i8] c"\1B[31m\00"
define void @isNull(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
int fun783() { return 783; }


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

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

LLVM IR (-O0):
define i32 @fun783() {
ret i32 783
}

LLVM IR (-O2):
define i32 @fun783() {
ret i32 783
}
int double_comparator(const void *pva, const void *pvb) {
  const double *pa = pva;
  const double *pb = pvb;
  double d = *pa - *pb;
  return (d < 0) ? -1 : (d > 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<double_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    114c <double_comparator+0x4c>
mov    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    1165 <double_comparator+0x65>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_comparator>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @double_comparator(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to double*
store double* %9, double** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
store double* %11, double** %6
%12 = load double*, double** %5
%13 = load double, double* %12
%14 = load double*, double** %6
%15 = load double, double* %14
%16 = fsub double %13, %15
store double %16, double* %7
%17 = load double, double* %7
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %2
br label %25
20: ; preds = %2
%21 = load double, double* %7
%22 = fcmp ogt double %21, 0.000000e+00
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
br label %25
25: ; preds = %20, %19
%26 = phi i32 [ -1, %19 ], [ %24, %20 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @double_comparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = fcmp olt double %7, 0.000000e+00
%9 = fcmp ogt double %7, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int ctz64(int /*<<< orphan*/);
int rightmost_1bit_idx(uint64_t x) { return ctz64(x); }


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

x86 assembly (clang, -O2):
<rightmost_1bit_idx>:
jmp    1030 <ctz64@plt>

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

LLVM IR (-O2):
define i32 @rightmost_1bit_idx(i32 %0) {
%2 = tail call i32 @ctz64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ testExponent();
void runTests() { testExponent(); }


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

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

LLVM IR (-O0):
define void @runTests() {
%1 = call i32 (...) @testExponent()
ret void
}

LLVM IR (-O2):
define void @runTests() {
%1 = tail call i32 (...) @testExponent()
ret void
}
void foo235(int p) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ EINTR;
struct group *__getgrent(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
struct group *fgetgrent(FILE *file) {
  if (file == NULL) {
    errno = EINTR;
    return NULL;
  }
  return __getgrent(fileno(file));
}


x86 assembly (clang, -O0):
<fgetgrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <fgetgrent+0x36>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    116a <fgetgrent+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
call   1040 <__getgrent@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetgrent>:
push   %rax
test   %rdi,%rdi
je     1133 <fgetgrent+0x13>
call   1030 <fileno@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <__getgrent@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    0x2e9d(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type { i32 }
@EINTR = global i32 0
@errno = global i32 0
define %struct.group* @fgetgrent(i32* %0) {
%2 = alloca %struct.group*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EINTR
store i32 %7, i32* @errno
store %struct.group* null, %struct.group** %2
br label %12
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @fileno(i32* %9)
%11 = call %struct.group* @__getgrent(i32 %10)
store %struct.group* %11, %struct.group** %2
br label %12
12: ; preds = %8, %6
%13 = load %struct.group*, %struct.group** %2
ret %struct.group* %13
}

LLVM IR (-O2):
%struct.group = type { i32 }
@EINTR = global i32 0
@errno = global i32 0
define %struct.group* @fgetgrent(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EINTR
store i32 %4, i32* @errno
br label %8
5: ; preds = %1
%6 = tail call i32 @fileno(i32* %0)
%7 = tail call %struct.group* @__getgrent(i32 %6)
br label %8
8: ; preds = %5, %3
%9 = phi %struct.group* [ null, %3 ], [ %7, %5 ]
ret %struct.group* %9
}
/* Variables and functions */
int /*<<< orphan*/ cosf(float);
float kill_denormal(int /*<<< orphan*/);
float cos_native(float f) { return kill_denormal(cosf(f)); }


x86 assembly (clang, -O0):
<cos_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
mov    %eax,%edi
call   1040 <kill_denormal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_native>:
push   %rax
call   1030 <cosf@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <kill_denormal@plt>

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

LLVM IR (-O2):
define float @cos_native(float %0) {
%2 = tail call i32 @cosf(float %0)
%3 = tail call float @kill_denormal(i32 %2)
ret float %3
}
void Prefetch_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @Prefetch_Handler() {
ret void
}
char *strcpy2(char *s1, const char *s2) {
  char *result = s1;
  while (*s2 != '\0')
    *s1++ = *s2++;
  *s1 = '\0';
  return result;
}


x86 assembly (clang, -O0):
<strcpy2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <strcpy2+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy2+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy2>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy2+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy2+0x20>
movb   $0x0,(%rdx)
ret

LLVM IR (-O0):
define i8* @strcpy2(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** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %12, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
%15 = load i8, i8* %13
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
store i8 %15, i8* %16
br label %7
18: ; preds = %7
%19 = load i8*, i8** %3
store i8 0, i8* %19
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @strcpy2(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int time_total_centiseconds(float);
int time_centiseconds(float t) { return time_total_centiseconds(t) % 100; }


x86 assembly (clang, -O0):
<time_centiseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <time_total_centiseconds@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_centiseconds>:
push   %rax
call   1030 <time_total_centiseconds@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @time_centiseconds(float %0) {
%2 = tail call i32 @time_total_centiseconds(float %0)
%3 = srem i32 %2, 100
ret i32 %3
}
void h_csq(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_csq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_csq>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_csq = [6 x i8] c"h_csq\00"
define void @h_csq(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.h_csq, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_csq = [6 x i8] c"h_csq\00"
define void @h_csq(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.h_csq, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, char);
void writecmos(char index, char data) {
  outb(0x70, index);
  outb(0x71, data);
}


x86 assembly (clang, -O0):
<writecmos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x70,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
mov    $0x71,%edi
movsbl -0x2(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writecmos>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x70,%edi
call   1030 <outb@plt>
mov    $0x71,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @writecmos(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @outb(i32 112, i8 signext %5)
%7 = load i8, i8* %4
%8 = call i32 @outb(i32 113, i8 signext %7)
ret void
}

LLVM IR (-O2):
define void @writecmos(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @outb(i32 112, i8 signext %0)
%4 = tail call i32 @outb(i32 113, i8 signext %1)
ret void
}
void sched_clock_postinit(void) {}


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

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

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

LLVM IR (-O2):
define void @sched_clock_postinit() {
ret void
}