xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swapc(uint32_t x, int c) {
  return c ? x >> 24 | x >> 8 & 0xff00 | x << 8 & 0xff0000 | x << 24 : x;
}


x86 assembly (clang, -O0):
<swapc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1146 <swapc+0x46>
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <swapc+0x4c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapc>:
mov    %edi,%eax
test   %esi,%esi
je     112a <swapc+0x2a>
mov    %eax,%ecx
sar    $0x18,%ecx
mov    %eax,%edx
shr    $0x8,%edx
and    $0xff00,%edx
mov    %eax,%esi
shl    $0x8,%esi
and    $0xff0000,%esi
shl    $0x18,%eax
or     %ecx,%eax
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @swapc(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %2
%8 = load i32, i32* %3
%9 = ashr i32 %8, 24
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %9, %12
%14 = load i32, i32* %3
%15 = shl i32 %14, 8
%16 = and i32 %15, 16711680
%17 = or i32 %13, %16
%18 = load i32, i32* %3
%19 = shl i32 %18, 24
%20 = or i32 %17, %19
br label %23
21: ; preds = %2
%22 = load i32, i32* %3
br label %23
23: ; preds = %21, %7
%24 = phi i32 [ %20, %7 ], [ %22, %21 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @swapc(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = ashr i32 %0, 24
%6 = lshr i32 %0, 8
%7 = and i32 %6, 65280
%8 = shl i32 %0, 8
%9 = and i32 %8, 16711680
%10 = shl i32 %0, 24
%11 = or i32 %10, %5
%12 = or i32 %11, %7
%13 = or i32 %12, %9
br label %14
14: ; preds = %2, %4
%15 = phi i32 [ %13, %4 ], [ %0, %2 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_STRING;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ DISPLAYTEXT_it;
ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, const unsigned char **in,
                             long len) {
  return (ASN1_STRING *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                      &DISPLAYTEXT_it);
}


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

x86 assembly (clang, -O2):
<d2i_DISPLAYTEXT>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@DISPLAYTEXT_it = global i32 0
define i32* @d2i_DISPLAYTEXT(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @DISPLAYTEXT_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@DISPLAYTEXT_it = global i32 0
define i32* @d2i_DISPLAYTEXT(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @DISPLAYTEXT_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void unsigned_char_div_signed_char_signed_int(unsigned char *LHS,
                                              signed int RHS) {
  (*LHS) /= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_div_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movzbl (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_div_signed_char_signed_int>:
movzbl (%rdi),%eax
xor    %edx,%edx
idiv   %esi
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_div_signed_char_signed_int(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 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = sdiv i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @unsigned_char_div_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int isspace(int);
int ISSPACE(int ch) { return isspace(ch); }


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

x86 assembly (clang, -O2):
<ISSPACE>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @ISSPACE(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
ret i32 %2
}
double min(double a, double b) { return a > b ? b : a; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <min+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <min+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
char *strcpy(char *to, const char *from) {
  char *save = to;
  for (; (*to = *from) != '\0'; ++from, ++to)
    ;
  return (save);
}


x86 assembly (clang, -O0):
<strcpy>:
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),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114e <strcpy+0x4e>
jmp    1131 <strcpy+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     111f <strcpy+0x1f>
mov    $0x1,%ecx
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRSETROP2_print(const char *contents) {
  core3_print("U_EMRSETROP2", "dwRop:", contents);
}


x86 assembly (clang, -O0):
<U_EMRSETROP2_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <core3_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRSETROP2_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <core3_print@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"U_EMRSETROP2\00"
@.str.1 = [7 x i8] c"dwRop:\00"
define void @U_EMRSETROP2_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core3_print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"U_EMRSETROP2\00"
@.str.1 = [7 x i8] c"dwRop:\00"
define void @U_EMRSETROP2_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(char *cmd) {
  printf("Usage: %s [-(1|2) host=h,port=p,format=(bin|dec|hex)] [-d]\n", cmd);
}


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

x86 assembly (clang, -O2):
<show_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: %s [-(1|2) host=h,port=p,format=(bin|dec|hex)] [-d]\0A\00"
define void @show_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Usage: %s [-(1|2) host=h,port=p,format=(bin|dec|hex)] [-d]\0A\00"
define void @show_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ flowd_crc32_start(int /*<<< orphan*/ *);
int /*<<< orphan*/ flowd_crc32_update(int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/, int /*<<< orphan*/ *);
u_int32_t flowd_crc32(const u_char *buf, u_int32_t size) {
  u_int32_t crc;
  flowd_crc32_start(&crc);
  flowd_crc32_update(buf, size, &crc);
  return (crc);
}


x86 assembly (clang, -O0):
<flowd_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <flowd_crc32_start@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <flowd_crc32_update@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flowd_crc32>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <flowd_crc32_start@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <flowd_crc32_update@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @flowd_crc32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 @flowd_crc32_start(i32* %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @flowd_crc32_update(i32* %7, i32 %8, i32* %5)
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @flowd_crc32(i32* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @flowd_crc32_start(i32* %3)
%6 = call i32 @flowd_crc32_update(i32* %0, i32 %1, i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_set_one(uintptr_t);
void fiat_p434_set_one(uint64_t out1[7]) {
  internal_fiat_p434_set_one((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p434_set_one>:
jmp    1030 <internal_fiat_p434_set_one@plt>

LLVM IR (-O0):
define void @fiat_p434_set_one(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p434_set_one(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p434_set_one(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p434_set_one(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t const);
int /*<<< orphan*/ stderr;
void *term_malloc(const size_t size) {
  void *ptr;
  if ((ptr = malloc(size)) == NULL) {
    fprintf(stderr, "Couldn't allocate memory - exiting.\n");
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<term_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1176 <term_malloc+0x46>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <term_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Couldn't allocate memory - exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @term_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Couldn't allocate memory - exiting.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @term_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ voronoi(float, float, float, float *, float *, int,
                           int /*<<< orphan*/);
float voronoi_F3S(float x, float y, float z) {
  float da[4], pa[12];
  voronoi(x, y, z, da, pa, 1, 0);
  return (2.0f * da[2] - 1.0f);
}


x86 assembly (clang, -O0):
<voronoi_F3S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  -0x18(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xea5(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voronoi_F3S>:
sub    $0x48,%rsp
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <voronoi@plt>
movss  0x8(%rsp),%xmm0
addss  %xmm0,%xmm0
addss  0xec6(%rip),%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define float @voronoi_F3S(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [4 x float]
%8 = alloca [12 x float]
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load float, float* %5
%11 = load float, float* %6
%12 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%13 = getelementptr inbounds [12 x float], [12 x float]* %8, i64 0, i64 0
%14 = call i32 @voronoi(float %9, float %10, float %11, float* %12, float* %13, i32 1, i32 0)
%15 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 2
%16 = load float, float* %15
%17 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %16, float -1.000000e+00)
ret float %17
}

LLVM IR (-O2):
define float @voronoi_F3S(float %0, float %1, float %2) {
%4 = alloca [4 x float]
%5 = alloca [12 x float]
%6 = bitcast [4 x float]* %4 to i8*
%7 = bitcast [12 x float]* %5 to i8*
%8 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%9 = getelementptr inbounds [12 x float], [12 x float]* %5, i64 0, i64 0
%10 = call i32 @voronoi(float %0, float %1, float %2, float* %8, float* %9, i32 1, i32 0)
%11 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 2
%12 = load float, float* %11
%13 = call float @llvm.fmuladd.f32(float %12, float 2.000000e+00, float -1.000000e+00)
ret float %13
}
short seqno_minus(unsigned short s1, unsigned short s2) {
  return (short)((s1 - s2) & 0xFFFF);
}


x86 assembly (clang, -O0):
<seqno_minus>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    %ecx,%eax
and    $0xffff,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqno_minus>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define signext i16 @seqno_minus(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = and i32 %9, 65535
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @seqno_minus(i16 zeroext %0, i16 zeroext %1) {
%3 = sub i16 %0, %1
ret i16 %3
}
int checkColumn(int c, int board[3][3]) {
  int colState = 0;
  for (int i = 0; i < 3; i++)
    colState += board[c][i];
  if (colState == 3)
    return 1;
  if (colState == -3)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<checkColumn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    114d <checkColumn+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1119 <checkColumn+0x19>
cmpl   $0x3,-0x14(%rbp)
jne    1163 <checkColumn+0x63>
movl   $0x1,-0x4(%rbp)
jmp    1180 <checkColumn+0x80>
cmpl   $0xfffffffd,-0x14(%rbp)
jne    1179 <checkColumn+0x79>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <checkColumn+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkColumn>:
movslq %edi,%rax
lea    (%rax,%rax,2),%rax
mov    0x4(%rsi,%rax,4),%ecx
add    (%rsi,%rax,4),%ecx
add    0x8(%rsi,%rax,4),%ecx
xor    %edx,%edx
cmp    $0xfffffffd,%ecx
sete   %dl
neg    %edx
cmp    $0x3,%ecx
mov    $0x1,%eax
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @checkColumn(i32 %0, [3 x i32]* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 %3, i64 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 %3, i64 1
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 %3, i64 2
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = icmp eq i32 %11, -3
%13 = sext i1 %12 to i32
%14 = icmp eq i32 %11, 3
%15 = select i1 %14, i32 1, i32 %13
ret i32 %15
}
/* Variables and functions */
int proxy(int);
int foo(int i) {
  if (i > 0)
    return proxy(1);
  else if (i < 0)
    return proxy(-1);
  else
    return proxy(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1137 <foo+0x27>
mov    $0x1,%edi
call   1030 <proxy@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <foo+0x4d>
cmpl   $0x0,-0x8(%rbp)
jge    1153 <foo+0x43>
mov    $0xffffffff,%edi
call   1030 <proxy@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <foo+0x4d>
xor    %edi,%edi
call   1030 <proxy@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
sar    $0x1f,%eax
test   %edi,%edi
mov    $0x1,%edi
cmovle %eax,%edi
jmp    1030 <proxy@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = ashr i32 %0, 31
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %2, i32 1
%5 = tail call i32 @proxy(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ api1(int, int);
void update_surface(int sid) { api1(1002, sid); }


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

x86 assembly (clang, -O2):
<update_surface>:
mov    %edi,%esi
mov    $0x3ea,%edi
jmp    1030 <api1@plt>

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

LLVM IR (-O2):
define void @update_surface(i32 %0) {
%2 = tail call i32 @api1(i32 1002, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_int();
int /*<<< orphan*/ init_repl();
int /*<<< orphan*/ repl_loop();
int repl() {
  init_repl();
  init_int();
  repl_loop();
}


x86 assembly (clang, -O0):
<repl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <init_repl@plt>
mov    $0x0,%al
call   1040 <init_int@plt>
mov    $0x0,%al
call   1050 <repl_loop@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repl>:
push   %rax
xor    %eax,%eax
call   1030 <init_repl@plt>
xor    %eax,%eax
call   1040 <init_int@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <repl_loop@plt>

LLVM IR (-O0):
define i32 @repl() {
%1 = alloca i32
%2 = call i32 (...) @init_repl()
%3 = call i32 (...) @init_int()
%4 = call i32 (...) @repl_loop()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @repl() {
%1 = tail call i32 (...) @init_repl()
%2 = tail call i32 (...) @init_int()
%3 = tail call i32 (...) @repl_loop()
ret i32 undef
}
void ff_hevc_put_hevc_bi_w_qpel_v12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v12_12_sse4() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int dashf(const char *file) {
  if (file == NULL)
    return 0;
  struct stat st;
  return (stat(file, &st) == 0 && S_ISREG(st.st_mode));
}


x86 assembly (clang, -O0):
<dashf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <dashf+0x23>
movl   $0x0,-0x4(%rbp)
jmp    117f <dashf+0x5f>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    1174 <dashf+0x54>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dashf>:
test   %rdi,%rdi
je     113d <dashf+0x1d>
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1140 <dashf+0x20>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dashf(i8* %0) {
%2 = alloca %struct.stat
%3 = icmp eq i8* %0, null
br i1 %3, label %16, label %4
4: ; preds = %1
%5 = bitcast %struct.stat* %2 to i8*
%6 = call i64 @stat(i8* %0, %struct.stat* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISREG(i32 %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %4
%15 = phi i32 [ 0, %4 ], [ %13, %8 ]
br label %16
16: ; preds = %1, %14
%17 = phi i32 [ %15, %14 ], [ 0, %1 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
void *malloc(size_t const);
int /*<<< orphan*/ stderr;
void *xmalloc(const size_t size) {
  void *ptr;
  (0) ? (ptr = NULL) : (ptr = malloc(size));
  if (ptr == NULL) {
    fputs("*** libast: Fatal: Memory allocation failed. Abort. ***\n", stderr);
    abort();
  } else
    return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <xmalloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"*** libast: Fatal: Memory allocation failed. Abort. ***\0A\00"
@stderr = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fputs(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [57 x i8] c"*** libast: Fatal: Memory allocation failed. Abort. ***\0A\00"
@stderr = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ construct_bridge(char *);
int set_security_bridge(int radio, int vap_id) {
  char bridge[16] = {0};
  construct_bridge(bridge);
  return 0;
}


x86 assembly (clang, -O0):
<set_security_bridge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
call   1030 <construct_bridge@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_security_bridge>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <construct_bridge@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @set_security_bridge(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [16 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast [16 x i8]* %5 to i8*
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%8 = call i32 @construct_bridge(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @set_security_bridge(i32 %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @construct_bridge(i8* %4)
ret i32 0
}
/* Type definitions */
typedef int u_short;
typedef int u_char;

/* Variables and functions */
void __putshort(register u_short s, register u_char *msgp) {
  msgp[1] = s;
  msgp[0] = s >> 8;
}


x86 assembly (clang, -O0):
<__putshort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__putshort>:
mov    %edi,0x4(%rsi)
sar    $0x8,%edi
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__putshort(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %0, i32* %3
%4 = ashr i32 %0, 8
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tst_module_unload_(void (*)(), char const *);
void tst_module_unload(void(cleanup_fn)(void), const char *mod_name) {
  tst_module_unload_(cleanup_fn, mod_name);
}


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

x86 assembly (clang, -O2):
<tst_module_unload>:
jmp    1030 <tst_module_unload_@plt>

LLVM IR (-O0):
define void @tst_module_unload(void ()* %0, i8* %1) {
%3 = alloca void ()*
%4 = alloca i8*
store void ()* %0, void ()** %3
store i8* %1, i8** %4
%5 = load void ()*, void ()** %3
%6 = bitcast void ()* %5 to void (...)*
%7 = load i8*, i8** %4
%8 = call i32 @tst_module_unload_(void (...)* %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @tst_module_unload(void ()* %0, i8* %1) {
%3 = bitcast void ()* %0 to void (...)*
%4 = tail call i32 @tst_module_unload_(void (...)* %3, i8* %1)
ret void
}
/* Type definitions */
struct bgen_genotype {
  int dummy;
};

/* Variables and functions */
int bgen_genotype_read(struct bgen_genotype *, double *);
int bgen_genotype_read64(struct bgen_genotype *genotype,
                         double *probabilities) {
  return bgen_genotype_read(genotype, probabilities);
}


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

x86 assembly (clang, -O2):
<bgen_genotype_read64>:
jmp    1030 <bgen_genotype_read@plt>

LLVM IR (-O0):
%struct.bgen_genotype = type { i32 }
define i32 @bgen_genotype_read64(%struct.bgen_genotype* %0, double* %1) {
%3 = alloca %struct.bgen_genotype*
%4 = alloca double*
store %struct.bgen_genotype* %0, %struct.bgen_genotype** %3
store double* %1, double** %4
%5 = load %struct.bgen_genotype*, %struct.bgen_genotype** %3
%6 = load double*, double** %4
%7 = call i32 @bgen_genotype_read(%struct.bgen_genotype* %5, double* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.bgen_genotype = type { i32 }
define i32 @bgen_genotype_read64(%struct.bgen_genotype* %0, double* %1) {
%3 = tail call i32 @bgen_genotype_read(%struct.bgen_genotype* %0, double* %1)
ret i32 %3
}
/* Variables and functions */
int gcd(int, int);
int lcm(int a, int b) { return ((a * b) / gcd(a, b)); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = sdiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
void foo781(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo781(i32 %0) {
ret void
}
/* Variables and functions */
size_t utils_base64GetSize(size_t dataLen) {
  size_t result_len;
  result_len = 4 * (dataLen / 3);
  if (dataLen % 3)
    result_len += 4;
  return result_len;
}


x86 assembly (clang, -O0):
<utils_base64GetSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
je     1142 <utils_base64GetSize+0x42>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_base64GetSize>:
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mov    %rdi,%rax
mul    %rcx
add    %rdx,%rdx
and    $0xfffffffffffffffc,%rdx
imul   %rcx,%rdi
lea    0x4(%rdx),%rax
movabs $0x5555555555555556,%rcx
55 55 55
cmp    %rcx,%rdi
cmovb  %rdx,%rax
ret

LLVM IR (-O0):
define i64 @utils_base64GetSize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 3
%6 = mul i64 4, %5
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = urem i64 %7, 3
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = add i64 %11, 4
store i64 %12, i64* %3
br label %13
13: ; preds = %10, %1
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @utils_base64GetSize(i64 %0) {
%2 = udiv i64 %0, 3
%3 = shl i64 %2, 2
%4 = urem i64 %0, 3
%5 = icmp eq i64 %4, 0
%6 = add i64 %3, 4
%7 = select i1 %5, i64 %3, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ findandjump(int, char *);
void xlbrklevel(void) { findandjump(0x0080, "no previous break level"); }


x86 assembly (clang, -O0):
<xlbrklevel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
lea    0xee0(%rip),%rsi
call   1030 <findandjump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlbrklevel>:
lea    0xee9(%rip),%rsi
mov    $0x80,%edi
jmp    1030 <findandjump@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"no previous break level\00"
define void @xlbrklevel() {
%1 = call i32 @findandjump(i32 128, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"no previous break level\00"
define void @xlbrklevel() {
%1 = tail call i32 @findandjump(i32 128, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int has_AVX2();
int has_POPCNT();
int get_cpuid() { return has_POPCNT() | has_AVX2(); }


x86 assembly (clang, -O0):
<get_cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <has_POPCNT@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <has_AVX2@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpuid>:
push   %rbx
xor    %eax,%eax
call   1040 <has_POPCNT@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <has_AVX2@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_cpuid() {
%1 = call i32 (...) @has_POPCNT()
%2 = call i32 (...) @has_AVX2()
%3 = or i32 %1, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_cpuid() {
%1 = tail call i32 (...) @has_POPCNT()
%2 = tail call i32 (...) @has_AVX2()
%3 = or i32 %2, %1
ret i32 %3
}
/* Variables and functions */
float cosf(float);
float num_cos(float a) { return cosf(a); }


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

x86 assembly (clang, -O2):
<num_cos>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @num_cos(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
void mvVecScale4(float *v, float factor) {
  v[0] *= factor;
  v[1] *= factor;
  v[2] *= factor;
  v[3] *= factor;
}


x86 assembly (clang, -O0):
<mvVecScale4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulss  0xc(%rax),%xmm0
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecScale4>:
movups (%rdi),%xmm1
shufps $0x0,%xmm0,%xmm0
mulps  %xmm1,%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mvVecScale4(float* nocapture %0, float %1) {
%3 = bitcast float* %0 to <4 x float>*
%4 = load <4 x float>, <4 x float>* %3
%5 = insertelement <4 x float> poison, float %1, i64 0
%6 = shufflevector <4 x float> %5, <4 x float> poison, <4 x i32> zeroinitializer
%7 = fmul <4 x float> %4, %6
%8 = bitcast float* %0 to <4 x float>*
store <4 x float> %7, <4 x float>* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int pthread_rwlockattr_destroy(int /*<<< orphan*/ *);
int my_pthread_rwlockattr_destroy(pthread_rwlockattr_t *__attr) {
  int ret;
  pthread_rwlockattr_t *realattr = (pthread_rwlockattr_t *)*(int *)__attr;
  ret = pthread_rwlockattr_destroy(realattr);
  free(realattr);
  return ret;
}


x86 assembly (clang, -O0):
<my_pthread_rwlockattr_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_rwlockattr_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @my_pthread_rwlockattr_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_rwlockattr_destroy(i32* %9)
store i32 %10, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @free(i32* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_pthread_rwlockattr_destroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @pthread_rwlockattr_destroy(i32* %4)
%6 = tail call i32 @free(i32* %4)
ret i32 %5
}
int add(int x, int y) {
  int i = 0;
  int j = 10;
  return (x + y);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int int_add(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<int_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @int_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ safe_realloc(char **, scalar_t__);
scalar_t__ strlen(char *);
void mutt_str_adjust(char **p) {
  if (!p || !*p)
    return;
  safe_realloc(p, strlen(*p) + 1);
}


x86 assembly (clang, -O0):
<mutt_str_adjust>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <mutt_str_adjust+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114a <mutt_str_adjust+0x2a>
jmp    116e <mutt_str_adjust+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <safe_realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_str_adjust>:
push   %rbx
test   %rdi,%rdi
je     1143 <mutt_str_adjust+0x23>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1143 <mutt_str_adjust+0x23>
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <safe_realloc@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mutt_str_adjust(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strlen(i8* %4)
%8 = add nsw i64 %7, 1
%9 = tail call i32 @safe_realloc(i8** %0, i64 %8)
br label %10
10: ; preds = %1, %3, %6
ret void
}