xunge/DecIR huggingface dataset:
int ValArrayDefaultCompareFn(const void *pleft, const void *pright) {
  const long double *left = pleft, *right = pright;
  return *left < *right ? -1 : (*left > *right ? 1 : 0);
}


x86 assembly (clang, -O0):
<ValArrayDefaultCompareFn>:
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
fldt   (%rax)
mov    -0x20(%rbp),%rax
fldt   (%rax)
fucomip %st(1),%st
fstp   %st(0)
jbe    1144 <ValArrayDefaultCompareFn+0x44>
jmp    1137 <ValArrayDefaultCompareFn+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    115f <ValArrayDefaultCompareFn+0x5f>
mov    -0x18(%rbp),%rax
fldt   (%rax)
mov    -0x20(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValArrayDefaultCompareFn>:
fldt   (%rdi)
fldt   (%rsi)
xor    %ecx,%ecx
fxch   %st(1)
fucomi %st(1),%st
seta   %cl
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ValArrayDefaultCompareFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to x86_fp80*
%4 = bitcast i8* %1 to x86_fp80*
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp olt x86_fp80 %5, %6
%8 = fcmp ogt x86_fp80 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct url {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fetchFreeURL(struct url *);
struct url *fetchParseURL(char const *);
int /*<<< orphan*/ *fetchPut(struct url *, char const *);
FILE *fetchPutURL(const char *URL, const char *flags) {
  struct url *u;
  FILE *f;
  if ((u = fetchParseURL(URL)) == NULL)
    return (NULL);
  f = fetchPut(u, flags);
  fetchFreeURL(u);
  return (f);
}


x86 assembly (clang, -O0):
<fetchPutURL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fetchParseURL@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1164 <fetchPutURL+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1186 <fetchPutURL+0x56>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fetchPut@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <fetchFreeURL@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetchPutURL>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <fetchParseURL@plt>
test   %rax,%rax
je     115f <fetchPutURL+0x2f>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <fetchPut@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1050 <fetchFreeURL@plt>
mov    %r14,%rax
jmp    1161 <fetchPutURL+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.url = type { i32 }
define i32* @fetchPutURL(i8* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.url*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call %struct.url* @fetchParseURL(i8* %8)
store %struct.url* %9, %struct.url** %6
%10 = icmp eq %struct.url* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32* null, i32** %3
br label %19
12: ; preds = %2
%13 = load %struct.url*, %struct.url** %6
%14 = load i8*, i8** %5
%15 = call i32* @fetchPut(%struct.url* %13, i8* %14)
store i32* %15, i32** %7
%16 = load %struct.url*, %struct.url** %6
%17 = call i32 @fetchFreeURL(%struct.url* %16)
%18 = load i32*, i32** %7
store i32* %18, i32** %3
br label %19
19: ; preds = %12, %11
%20 = load i32*, i32** %3
ret i32* %20
}

LLVM IR (-O2):
%struct.url = type { i32 }
define i32* @fetchPutURL(i8* %0, i8* %1) {
%3 = tail call %struct.url* @fetchParseURL(i8* %0)
%4 = icmp eq %struct.url* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32* @fetchPut(%struct.url* %3, i8* %1)
%7 = tail call i32 @fetchFreeURL(%struct.url* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32* [ %6, %5 ], [ null, %2 ]
ret i32* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int do_pk8pkey_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                  int /*<<< orphan*/, int, int /*<<< orphan*/ const *, char *,
                  int, int /*<<< orphan*/ *, void *);
int PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,
                              char *kstr, int klen, pem_password_cb *cb,
                              void *u) {
  return do_pk8pkey_fp(fp, x, 0, -1, enc, kstr, klen, cb, u);
}


x86 assembly (clang, -O0):
<PEM_write_PKCS8PrivateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <do_pk8pkey_fp@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_PKCS8PrivateKey>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %rdx,%r8
sub    $0x8,%rsp
xor    %edx,%edx
mov    $0xffffffff,%ecx
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <do_pk8pkey_fp@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PEM_write_PKCS8PrivateKey(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i8*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i8* %6, i8** %14
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = load i32*, i32** %13
%21 = load i8*, i8** %14
%22 = call i32 @do_pk8pkey_fp(i32* %15, i32* %16, i32 0, i32 -1, i32* %17, i8* %18, i32 %19, i32* %20, i8* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @PEM_write_PKCS8PrivateKey(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = tail call i32 @do_pk8pkey_fp(i32* %0, i32* %1, i32 0, i32 -1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f25(long j) {
  if ((j & ((1UL << (25)) - 1)) >= ((1UL << ((25) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1ffffff,%rax
cmp    $0x1000002,%rax
jb     1139 <f25+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f25>:
and    $0x1fffffe,%edi
cmp    $0x1000002,%edi
jae    111f <f25+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f25(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 33554431
%5 = icmp uge i64 %4, 16777218
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f25(i64 %0) {
%2 = and i64 %0, 33554430
%3 = icmp ugt i64 %2, 16777217
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
char base64_encode_value(char value_in) {
  static const char *encoding =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  if (value_in > 63)
    return '=';
  return encoding[(int)value_in];
}


x86 assembly (clang, -O0):
<base64_encode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x3f,%eax
jle    1120 <base64_encode_value+0x20>
movb   $0x3d,-0x1(%rbp)
jmp    1134 <base64_encode_value+0x34>
mov    0x2ef9(%rip),%rax
movsbl -0x2(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_value>:
mov    $0x3d,%al
cmp    $0x3f,%dil
jg     1116 <base64_encode_value+0x16>
movsbq %dil,%rax
lea    0xeed(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@base64_encode_value.encoding = internal global i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i32 0, i32 0)
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %5, 63
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 61, i8* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** @base64_encode_value.encoding
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
store i8 %14, i8* %2
br label %15
15: ; preds = %8, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = icmp sgt i8 %0, 63
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [65 x i8], [65 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 61, %1 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XwcDrawString() {
  printf("XwcDrawString called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"XwcDrawString called\00"
define i32 @XwcDrawString() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int llong_chars(long long);
int double_chars(double numb) {
  long long ll;
  ll = (long long)numb;
  return llong_chars(ll);
}


x86 assembly (clang, -O0):
<double_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <llong_chars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_chars>:
cvttsd2si %xmm0,%rdi
jmp    1030 <llong_chars@plt>

LLVM IR (-O0):
define i32 @double_chars(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @llong_chars(i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @double_chars(double %0) {
%2 = fptosi double %0 to i64
%3 = tail call i32 @llong_chars(i64 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fstr(char *, int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sysrq_trigger_oom() {
  printf("Above threshold limit, killing task and pausing for recovery\n");
  fstr("/proc/sysrq-trigger", NULL, "f");
  sleep(15);
}


x86 assembly (clang, -O0):
<sysrq_trigger_oom>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xf00(%rip),%rdx
call   1040 <fstr@plt>
mov    $0xf,%edi
call   1050 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysrq_trigger_oom>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0xec9(%rip),%rdx
xor    %esi,%esi
call   1040 <fstr@plt>
mov    $0xf,%edi
pop    %rax
jmp    1050 <sleep@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Above threshold limit, killing task and pausing for recovery\0A\00"
@.str.1 = [20 x i8] c"/proc/sysrq-trigger\00"
@.str.2 = [2 x i8] c"f\00"
define void @sysrq_trigger_oom() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @fstr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @sleep(i32 15)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"/proc/sysrq-trigger\00"
@.str.2 = [2 x i8] c"f\00"
@str = [61 x i8] c"Above threshold limit, killing task and pausing for recovery\00"
define void @sysrq_trigger_oom() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @fstr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 15)
ret void
}
int f(int c, int i) {
  int a1, a3, x1, x3, x;
  a1 = i * 16;
  x1 = c + a1;
  if (x1 > 6)
    i = i + 2;
  i = i + 2;
  a3 = i * 16;
  x3 = c + a3;
  x = x1 + x3;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jle    112f <f+0x2f>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shl    $0x4,%esi
lea    (%rsi,%rdi,1),%eax
lea    0x20(%rsi),%ecx
cmp    $0x7,%eax
cmovl  %esi,%ecx
add    %eax,%edi
lea    (%rcx,%rdi,1),%eax
add    $0x20,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %1, 4
%4 = add nsw i32 %3, %0
%5 = icmp sgt i32 %4, 6
%6 = add i32 %3, 32
%7 = select i1 %5, i32 %6, i32 %3
%8 = add i32 %0, 32
%9 = add i32 %8, %4
%10 = add i32 %9, %7
ret i32 %10
}
/* Variables and functions */
double time(int /*<<< orphan*/ *);
double realtime(void) { return time(NULL); }


x86 assembly (clang, -O0):
<realtime>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<realtime>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define double @realtime() {
%1 = call double @time(i32* null)
ret double %1
}

LLVM IR (-O2):
define double @realtime() {
%1 = tail call double @time(i32* null)
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int tcpnodelay(int sock) {
  int yes = 1;
  return setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&yes, sizeof(int));
}


x86 assembly (clang, -O0):
<tcpnodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpnodelay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @tcpnodelay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = bitcast i32* %3 to i8*
%8 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i8* %7, i32 4)
ret i32 %8
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @tcpnodelay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %3, i32 4)
ret i32 %6
}
/* Variables and functions */
int strcasecmp(char *, char *);
int cp_hash_compare_istring(void *s1, void *s2) {
  if (s1 == NULL && s2 == NULL)
    return 0;
  if (s1 == NULL || s2 == NULL)
    return -1;
  return strcasecmp((char *)s1, (char *)s2);
}


x86 assembly (clang, -O0):
<cp_hash_compare_istring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <cp_hash_compare_istring+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <cp_hash_compare_istring+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1174 <cp_hash_compare_istring+0x64>
cmpq   $0x0,-0x10(%rbp)
je     1158 <cp_hash_compare_istring+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <cp_hash_compare_istring+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <cp_hash_compare_istring+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_hash_compare_istring>:
xor    %eax,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     112e <cp_hash_compare_istring+0x1e>
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     112e <cp_hash_compare_istring+0x1e>
test   %rsi,%rsi
je     112e <cp_hash_compare_istring+0x1e>
jmp    1030 <strcasecmp@plt>
ret

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

LLVM IR (-O2):
define i32 @cp_hash_compare_istring(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = or i1 %3, %4
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcasecmp(i8* %0, i8* %1)
br label %10
10: ; preds = %6, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ -1, %6 ]
ret i32 %11
}
void gtk_tree_store_clear() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_store_clear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo4();
int foo3() {
  foo4();
  return 10;
}


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

x86 assembly (clang, -O2):
<foo3>:
push   %rax
xor    %eax,%eax
call   1030 <foo4@plt>
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo3() {
%1 = call i32 (...) @foo4()
ret i32 10
}

LLVM IR (-O2):
define i32 @foo3() {
%1 = tail call i32 (...) @foo4()
ret i32 10
}
double doublelog(double x, double r) {
  double d;
  d = 1.0 - x;
  return (r * x * x * d * d);
}


x86 assembly (clang, -O0):
<doublelog>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<doublelog>:
movsd  0xef8(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @doublelog(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fsub double 1.000000e+00, %6
store double %7, double* %5
%8 = load double, double* %4
%9 = load double, double* %3
%10 = fmul double %8, %9
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = load double, double* %5
%14 = fmul double %12, %13
%15 = load double, double* %5
%16 = fmul double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @doublelog(double %0, double %1) {
%3 = fsub double 1.000000e+00, %0
%4 = fmul double %0, %1
%5 = fmul double %4, %0
%6 = fmul double %3, %5
%7 = fmul double %3, %6
ret double %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t prv_equal_int32_fn(int32_t a, int32_t b) { return a == b ? -1 : 0; }


x86 assembly (clang, -O0):
<prv_equal_int32_fn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_equal_int32_fn>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
neg    %rax
ret

LLVM IR (-O0):
define i64 @prv_equal_int32_fn(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @prv_equal_int32_fn(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = sext i1 %3 to i64
ret i64 %4
}
/* Type definitions */
struct TCP_STREAM {
  int dummy;
};
struct TCPRECORD {
  int dummy;
};
struct NetFrame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ parse_aim_oscar(struct TCP_STREAM *, struct NetFrame *,
                                   unsigned char const *, unsigned int);
void parse_aim_oscar_to_server(struct TCPRECORD *sess,
                               struct TCP_STREAM *stream,
                               struct NetFrame *frame, const unsigned char *px,
                               unsigned length) {
  parse_aim_oscar(stream, frame, px, length);
}


x86 assembly (clang, -O0):
<parse_aim_oscar_to_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <parse_aim_oscar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_aim_oscar_to_server>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1030 <parse_aim_oscar@plt>

LLVM IR (-O0):
%struct.TCPRECORD = type { i32 }
%struct.TCP_STREAM = type { i32 }
%struct.NetFrame = type { i32 }
define void @parse_aim_oscar_to_server(%struct.TCPRECORD* %0, %struct.TCP_STREAM* %1, %struct.NetFrame* %2, i8* %3, i32 %4) {
%6 = alloca %struct.TCPRECORD*
%7 = alloca %struct.TCP_STREAM*
%8 = alloca %struct.NetFrame*
%9 = alloca i8*
%10 = alloca i32
store %struct.TCPRECORD* %0, %struct.TCPRECORD** %6
store %struct.TCP_STREAM* %1, %struct.TCP_STREAM** %7
store %struct.NetFrame* %2, %struct.NetFrame** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load %struct.TCP_STREAM*, %struct.TCP_STREAM** %7
%12 = load %struct.NetFrame*, %struct.NetFrame** %8
%13 = load i8*, i8** %9
%14 = load i32, i32* %10
%15 = call i32 @parse_aim_oscar(%struct.TCP_STREAM* %11, %struct.NetFrame* %12, i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.TCPRECORD = type { i32 }
%struct.TCP_STREAM = type { i32 }
%struct.NetFrame = type { i32 }
define void @parse_aim_oscar_to_server(%struct.TCPRECORD* nocapture readnone %0, %struct.TCP_STREAM* %1, %struct.NetFrame* %2, i8* %3, i32 %4) {
%6 = tail call i32 @parse_aim_oscar(%struct.TCP_STREAM* %1, %struct.NetFrame* %2, i8* %3, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t sdp_event_query_attribute_byte_get_attribute_id(const uint8_t *event) {
  return little_endian_read_16(event, 4);
}


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

x86 assembly (clang, -O2):
<sdp_event_query_attribute_byte_get_attribute_id>:
mov    $0x4,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @sdp_event_query_attribute_byte_get_attribute_id(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 4)
ret i32 %2
}
int test_imm_FEint16_mem(short *val) {
  return ((*val) & (0xFE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FEint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 254
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ postfix_to_infix(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char postfix[20];
  printf("Enter Postfix Expression: ");
  scanf("%s", postfix);
  postfix_to_infix(postfix);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <postfix_to_infix@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <postfix_to_infix@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter Postfix Expression: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @postfix_to_infix(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter Postfix Expression: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @postfix_to_infix(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_color(int /*<<< orphan*/);
default_color() { set_color(0); }


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

x86 assembly (clang, -O2):
<default_color>:
xor    %edi,%edi
jmp    1030 <set_color@plt>

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

LLVM IR (-O2):
define i32 @default_color() {
%1 = tail call i32 @set_color(i32 0)
ret i32 undef
}
void ArmSetHeight(int height) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ NID_dsa;
int jksengine_digests_final(int /*<<< orphan*/ *, unsigned char *,
                            int /*<<< orphan*/);
int jksengine_mddsa_final(EVP_MD_CTX *ctx, unsigned char *md) {
  ;
  return (jksengine_digests_final(ctx, md, NID_dsa));
}


x86 assembly (clang, -O0):
<jksengine_mddsa_final>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
call   1030 <jksengine_digests_final@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_mddsa_final>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <jksengine_digests_final@plt>

LLVM IR (-O0):
@NID_dsa = global i32 0
define i32 @jksengine_mddsa_final(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @NID_dsa
%8 = call i32 @jksengine_digests_final(i32* %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@NID_dsa = global i32 0
define i32 @jksengine_mddsa_final(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_dsa
%4 = tail call i32 @jksengine_digests_final(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
size_t strlen(char *);
scalar_t__ strlncpy(char *, size_t, char const *, size_t);
size_t strlncat(char *dst, size_t size, const char *src, size_t len) {
  size_t n = strlen(dst);
  if (size - n > 1)
    n += strlncpy(dst + n, size - n, src, len);
  return n;
}


x86 assembly (clang, -O0):
<strlncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x28(%rbp),%rax
cmp    $0x1,%rax
jbe    117c <strlncat+0x5c>
mov    -0x8(%rbp),%rdi
add    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
sub    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <strlncpy@plt>
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlncat>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r13
call   1030 <strlen@plt>
mov    %rax,%r12
sub    %rax,%rbx
cmp    $0x2,%rbx
jb     115d <strlncat+0x3d>
add    %r12,%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <strlncpy@plt>
add    %rax,%r12
mov    %r12,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @strlncat(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = sub i64 %1, %5
%7 = icmp ugt i64 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 %5
%10 = tail call i64 @strlncpy(i8* %9, i64 %6, i8* %2, i64 %3)
%11 = add i64 %10, %5
br label %12
12: ; preds = %8, %4
%13 = phi i64 [ %11, %8 ], [ %5, %4 ]
ret i64 %13
}
int default_key_cmpl_cb(const void *a, const void *b) {
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<default_key_cmpl_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1126 <default_key_cmpl_cb+0x26>
movl   $0x1,-0x4(%rbp)
jmp    114c <default_key_cmpl_cb+0x4c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1140 <default_key_cmpl_cb+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <default_key_cmpl_cb+0x4c>
jmp    1145 <default_key_cmpl_cb+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_key_cmpl_cb>:
cmp    %rsi,%rdi
sbb    %ecx,%ecx
cmp    %rsi,%rdi
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @default_key_cmpl_cb(i8* readnone %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
%4 = icmp ult i8* %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t ll_strlen(int8_t *s) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ll_strlen(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_bitmap2_120();
int /*<<< orphan*/ test_bitmap2_8192();
int main(int UNUSED_argc __attribute__((unused)),
         char *UNUSED_argv[] __attribute__((unused))) {
  assert(sizeof(long) == sizeof(uint64_t));
  test_bitmap2_120();
  test_bitmap2_8192();
  printf("All bitmap2 tests completed successfully.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <test_bitmap2_120@plt>
mov    $0x0,%al
call   1060 <test_bitmap2_8192@plt>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <test_bitmap2_120@plt>
xor    %eax,%eax
call   1060 <test_bitmap2_8192@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"All bitmap2 tests completed successfully.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @assert(i32 0)
%7 = call i32 (...) @test_bitmap2_120()
%8 = call i32 (...) @test_bitmap2_8192()
%9 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [42 x i8] c"All bitmap2 tests completed successfully.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
%4 = tail call i32 (...) @test_bitmap2_120()
%5 = tail call i32 (...) @test_bitmap2_8192()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_pipe(int p[]) {
  if (p[0] >= 0)
    close(p[0]);
  if (p[1] >= 0)
    close(p[1]);
}


x86 assembly (clang, -O0):
<close_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1134 <close_pipe+0x24>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jl     114e <close_pipe+0x3e>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_pipe>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
js     111f <close_pipe+0xf>
call   1030 <close@plt>
mov    0x4(%rbx),%edi
test   %edi,%edi
js     112c <close_pipe+0x1c>
pop    %rbx
jmp    1030 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @close_pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %7, %1
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = call i32 @close(i32 %20)
br label %22
22: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
define void @close_pipe(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %1
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @close(i32 %8)
br label %12
12: ; preds = %10, %6
ret void
}
/* Variables and functions */
size_t size_next(size_t);
size_t size_enough(size_t current, size_t required) {
  while (current < required)
    current = size_next(current);
  return current;
}


x86 assembly (clang, -O0):
<size_enough>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1140 <size_enough+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <size_next@plt>
mov    %rax,-0x8(%rbp)
jmp    1120 <size_enough+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_enough>:
push   %rbx
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    112d <size_enough+0x1d>
mov    %rsi,%rbx
nopl   0x0(%rax)
mov    %rax,%rdi
call   1030 <size_next@plt>
cmp    %rbx,%rax
jb     1120 <size_enough+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @size_enough(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
br i1 %3, label %4, label %8
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = tail call i64 @size_next(i64 %5)
%7 = icmp ult i64 %6, %1
br i1 %7, label %4, label %8
8: ; preds = %4, %2
%9 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %9
}
int test_imm_06int8_mem(signed char *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_06int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 6
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ test(int);
int main(int argc, char **argv) {
  for (int i = 0; i <= INT_MAX; ++i)
    test(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb1(%rip),%rcx
cmp    (%rcx),%eax
jg     1155 <main+0x45>
mov    -0x14(%rbp),%edi
call   1030 <test@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
cmpl   $0x0,(%r14)
js     113f <main+0x2f>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <test@plt>
cmp    (%r14),%ebx
jl     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MAX
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret i32 0
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @test(i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* @INT_MAX
%11 = icmp slt i32 %7, %10
br i1 %11, label %6, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
scalar_t__ pthread_self();
pid_t get_pid() {
  char **p = (char **)pthread_self();
  return p ? *(pid_t *)(p + 18) : getpid();
}


x86 assembly (clang, -O0):
<get_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <get_pid+0x30>
mov    -0x8(%rbp),%rax
mov    0x90(%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    115a <get_pid+0x3a>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pid>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
test   %rax,%rax
je     1135 <get_pid+0x15>
mov    0x90(%rax),%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <getpid@plt>

LLVM IR (-O0):
define i32 @get_pid() {
%1 = alloca i8**
%2 = call i64 (...) @pthread_self()
%3 = inttoptr i64 %2 to i8**
store i8** %3, i8*** %1
%4 = load i8**, i8*** %1
%5 = icmp ne i8** %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i8**, i8*** %1
%8 = getelementptr inbounds i8*, i8** %7, i64 18
%9 = bitcast i8** %8 to i32*
%10 = load i32, i32* %9
br label %13
11: ; preds = %0
%12 = call i32 (...) @getpid()
br label %13
13: ; preds = %11, %6
%14 = phi i32 [ %10, %6 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_pid() {
%1 = tail call i64 (...) @pthread_self()
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = inttoptr i64 %1 to i8**
%5 = getelementptr inbounds i8*, i8** %4, i64 18
%6 = bitcast i8** %5 to i32*
%7 = load i32, i32* %6
br label %10
8: ; preds = %0
%9 = tail call i32 (...) @getpid()
br label %10
10: ; preds = %8, %3
%11 = phi i32 [ %7, %3 ], [ %9, %8 ]
ret i32 %11
}
Init_sha2() {}


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

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

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

LLVM IR (-O2):
define i32 @Init_sha2() {
ret i32 undef
}