xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void breakme(int line) {
  fprintf(stderr, "breakme function called from line %d\n", line);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<breakme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<breakme>:
push   %rbx
mov    %edi,%edx
mov    0x2eb6(%rip),%rbx
mov    (%rbx),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"breakme function called from line %d\0A\00"
define void @breakme(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"breakme function called from line %d\0A\00"
define void @breakme(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_brk();
void test_brk(void) { __builtin_arc_brk(); }


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

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

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

LLVM IR (-O2):
define void @test_brk() {
%1 = tail call i32 (...) @__builtin_arc_brk()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opt_store_str(char *, void *);
int opt_stop(char *arg, void *data) {
  if (arg)
    opt_store_str(arg, data);
  else if (data)
    *(int *)data = 1;
  return 1;
}


x86 assembly (clang, -O0):
<opt_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113d <opt_stop+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <opt_store_str@plt>
jmp    1157 <opt_stop+0x47>
cmpq   $0x0,-0x10(%rbp)
je     1152 <opt_stop+0x42>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1157 <opt_stop+0x47>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_stop>:
push   %rax
test   %rdi,%rdi
je     111d <opt_stop+0xd>
call   1030 <opt_store_str@plt>
jmp    1128 <opt_stop+0x18>
test   %rsi,%rsi
je     1128 <opt_stop+0x18>
movl   $0x1,(%rsi)
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opt_stop(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @opt_store_str(i8* %0, i8* %1)
br label %10
6: ; preds = %2
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = bitcast i8* %1 to i32*
store i32 1, i32* %9
br label %10
10: ; preds = %6, %8, %4
ret i32 1
}
int do_288() { return 288; }


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

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

LLVM IR (-O0):
define i32 @do_288() {
ret i32 288
}

LLVM IR (-O2):
define i32 @do_288() {
ret i32 288
}
char *dgettext(domainname, msgid) const char *domainname;
const char *msgid;
{ return libintl_dgettext(domainname, msgid); }


x86 assembly (clang, -O0):
<dgettext>:
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    $0x0,%al
call   1030 <libintl_dgettext@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @dgettext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @libintl_dgettext to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @dgettext(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @libintl_dgettext to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
double If_fun(a, b, c)
double a, b, c;
{
  if (a != a)
    return (a);
  if (a >= 0)
    return (b);
  else
    return (c);
}


x86 assembly (clang, -O0):
<If_fun>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    112e <If_fun+0x2e>
jp     112e <If_fun+0x2e>
jmp    113d <If_fun+0x3d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1168 <If_fun+0x68>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115e <If_fun+0x5e>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1168 <If_fun+0x68>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<If_fun>:
xorpd  %xmm3,%xmm3
cmpnlesd %xmm0,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm1,%xmm3
orpd   %xmm2,%xmm3
movapd %xmm0,%xmm1
cmpunordsd %xmm0,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @If_fun(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %5
%10 = fcmp une double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %5
store double %12, double* %4
br label %20
13: ; preds = %3
%14 = load double, double* %5
%15 = fcmp oge double %14, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load double, double* %6
store double %17, double* %4
br label %20
18: ; preds = %13
%19 = load double, double* %7
store double %19, double* %4
br label %20
20: ; preds = %18, %16, %11
%21 = load double, double* %4
ret double %21
}

LLVM IR (-O2):
define double @If_fun(double %0, double %1, double %2) {
%4 = fcmp uno double %0, 0.000000e+00
%5 = fcmp ult double %0, 0.000000e+00
%6 = select i1 %5, double %2, double %1
%7 = select i1 %4, double %0, double %6
ret double %7
}
/* Variables and functions */
int m_strcmp(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a[3] = "123";
  char b[3] = "123";
  int x;
  x = m_strcmp(b, a);
  printf("%d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xec2(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
lea    -0x7(%rbp),%rsi
call   1040 <m_strcmp@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x33,0x6(%rsp)
movw   $0x3231,0x4(%rsp)
movb   $0x33,0x2(%rsp)
movw   $0x3231,(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1040 <m_strcmp@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [3 x i8] c"123"
@__const.main.b = [3 x i8] c"123"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca [3 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [3 x i8]* %2 to i8*
%6 = bitcast [3 x i8]* %3 to i8*
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%9 = call i32 @m_strcmp(i8* %7, i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.b = [3 x i8] c"123"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @m_strcmp(i8* %4, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct crypto_ahash {
  int dummy;
};
struct chcr_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ crypto_ahash_tfm(struct crypto_ahash *);
struct chcr_context *crypto_tfm_ctx(int /*<<< orphan*/);
struct chcr_context *h_ctx(struct crypto_ahash *tfm) {
  return crypto_tfm_ctx(crypto_ahash_tfm(tfm));
}


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

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

LLVM IR (-O0):
%struct.chcr_context = type { i32 }
%struct.crypto_ahash = type { i32 }
define %struct.chcr_context* @h_ctx(%struct.crypto_ahash* %0) {
%2 = alloca %struct.crypto_ahash*
store %struct.crypto_ahash* %0, %struct.crypto_ahash** %2
%3 = load %struct.crypto_ahash*, %struct.crypto_ahash** %2
%4 = call i32 @crypto_ahash_tfm(%struct.crypto_ahash* %3)
%5 = call %struct.chcr_context* @crypto_tfm_ctx(i32 %4)
ret %struct.chcr_context* %5
}

LLVM IR (-O2):
%struct.chcr_context = type { i32 }
%struct.crypto_ahash = type { i32 }
define %struct.chcr_context* @h_ctx(%struct.crypto_ahash* %0) {
%2 = tail call i32 @crypto_ahash_tfm(%struct.crypto_ahash* %0)
%3 = tail call %struct.chcr_context* @crypto_tfm_ctx(i32 %2)
ret %struct.chcr_context* %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
bool strempty(const char *arg) {
  assert(arg);
  return arg[0] == '\0';
}


x86 assembly (clang, -O0):
<strempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strempty>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
xor    %eax,%eax
cmpb   $0x0,(%rbx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @strempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @strempty(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ error_msg_and_die(char *, int, char const *);
void error_opt_arg(int opt, const char *arg) {
  error_msg_and_die("Invalid -%c argument: '%s'", opt, arg);
}


x86 assembly (clang, -O0):
<error_opt_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <error_msg_and_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_opt_arg>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <error_msg_and_die@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Invalid -%c argument: '%s'\00"
define void @error_opt_arg(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 = call i32 @error_msg_and_die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Invalid -%c argument: '%s'\00"
define void @error_opt_arg(i32 %0, i8* %1) {
%3 = tail call i32 @error_msg_and_die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ specify_any_Gx(int);
int specify_G3(const char *the_title) {
  specify_any_Gx(3);
  return 0;
}


x86 assembly (clang, -O0):
<specify_G3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
call   1030 <specify_any_Gx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<specify_G3>:
push   %rax
mov    $0x3,%edi
call   1030 <specify_any_Gx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @specify_G3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @specify_any_Gx(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @specify_G3(i8* nocapture readnone %0) {
%2 = tail call i32 @specify_any_Gx(i32 3)
ret i32 0
}
double f2(double x) { return __builtin_log1p(x); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <log1p@plt>

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

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call double @log1p(double %0)
ret double %2
}
const char *mugglec_version() { return "?.?.?"; }


x86 assembly (clang, -O0):
<mugglec_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mugglec_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"?.?.?\00"
define i8* @mugglec_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"?.?.?\00"
define i8* @mugglec_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void rop3_34_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~S;
  stk1 = *D & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_34_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_34_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = or i32 %25, %31
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_34_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ quad;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
char const *inet_ntop(int /*<<< orphan*/, int /*<<< orphan*/ *, char *, int);
const char *numtoquad(uint32_t num) {
  static char quad[64];
  num = htonl(num);
  return inet_ntop(AF_INET, &num, quad, sizeof(quad));
}


x86 assembly (clang, -O0):
<numtoquad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
lea    0x2ef6(%rip),%rdx
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numtoquad>:
push   %rax
call   1040 <htonl@plt>
mov    %eax,0x4(%rsp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0x2f06(%rip),%rdx
lea    0x4(%rsp),%rsi
mov    $0x40,%ecx
call   1030 <inet_ntop@plt>
pop    %rcx
ret

LLVM IR (-O0):
@numtoquad.quad = internal global [64 x i8] zeroinitializer
@AF_INET = global i32 0
define i8* @numtoquad(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @htonl(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* @AF_INET
%6 = call i8* @inet_ntop(i32 %5, i32* %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @numtoquad.quad, i64 0, i64 0), i32 64)
ret i8* %6
}

LLVM IR (-O2):
@numtoquad.quad = internal global [64 x i8] zeroinitializer
@AF_INET = global i32 0
define i8* @numtoquad(i32 %0) {
%2 = alloca i32
%3 = tail call i32 @htonl(i32 %0)
store i32 %3, i32* %2
%4 = load i32, i32* @AF_INET
%5 = call i8* @inet_ntop(i32 %4, i32* %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @numtoquad.quad, i64 0, i64 0), i32 64)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ die(int, char *);
void die_if_null(void *t) {
  if (t == NULL)
    die(2, ("not enough memory"));
}


x86 assembly (clang, -O0):
<die_if_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1138 <die_if_null+0x28>
mov    $0x2,%edi
lea    0xecd(%rip),%rsi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_if_null>:
test   %rdi,%rdi
je     1116 <die_if_null+0x6>
ret
lea    0xee3(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"not enough memory\00"
define void @die_if_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @die(i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"not enough memory\00"
define void @die_if_null(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @die(i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *ZSTD_defaultAllocFunction(void *opaque, size_t size) {
  void *address = malloc(size);
  (void)opaque;
  return address;
}


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

x86 assembly (clang, -O2):
<ZSTD_defaultAllocFunction>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @ZSTD_defaultAllocFunction(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @ZSTD_defaultAllocFunction(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
char *strerror(int num) {
  char *p;
  switch (num) {
  default:
    p = "Unknown error";
    break;
  }
  return p;
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Unknown error\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %5 [
]
5: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %3
br label %6
6: ; preds = %5
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"Unknown error\00"
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("\n"
         "Usage : arawplayer <rawfile> [wavfile]\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"\0AUsage : arawplayer <rawfile> [wavfile]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"\0AUsage : arawplayer <rawfile> [wavfile]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stderr;
void print_char(long x) {
  if ((0 <= x) && (x <= 127)) {
    printf("%c", (char)x);
  } else {
    fprintf(stderr, "Unknown character code: %li", x);
  }
}


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jg     115b <print_char+0x3b>
cmpq   $0x7f,-0x8(%rbp)
jg     115b <print_char+0x3b>
mov    -0x8(%rbp),%rax
lea    0xeb2(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1174 <print_char+0x54>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
mov    %rdi,%rdx
cmp    $0x7f,%rdi
ja     1138 <print_char+0x18>
movsbl %dl,%esi
lea    0xecd(%rip),%rdi
jmp    1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@stderr = global i32 0
@.str.1 = [28 x i8] c"Unknown character code: %li\00"
define void @print_char(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 0, %3
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 127
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i64, i64* %2
%10 = trunc i64 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %16
12: ; preds = %5, %1
%13 = load i32, i32* @stderr
%14 = load i64, i64* %2
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@stderr = global i32 0
@.str.1 = [28 x i8] c"Unknown character code: %li\00"
define void @print_char(i64 %0) {
%2 = icmp ult i64 %0, 128
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i64 %0 to i8
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
br label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i64 %0)
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
scalar_t__ copysign(double, double);
long double copysignl(long double x, long double y) {
  return (long double)copysign((double)x, (double)y);
}


x86 assembly (clang, -O0):
<copysignl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
call   1030 <copysign@plt>
mov    %rax,-0x28(%rbp)
fildll -0x28(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignl>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
fstpl  (%rsp)
movsd  (%rsp),%xmm1
call   1030 <copysign@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call i64 @copysign(double %6, double %8)
%10 = sitofp i64 %9 to x86_fp80
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call i64 @copysign(double %3, double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int ft_putstr(char *str) {
  while (*str) {
    write(1, str, 1);
    str++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <ft_putstr+0x3a>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ft_putstr+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @write(i32 1, i8* %5, i32 1)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i32 0
}
int filho_dir(int i) { return 2 * i + 1; }


x86 assembly (clang, -O0):
<filho_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filho_dir>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @filho_dir(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void kol_board_puts(char *s) {
  unsigned i;
  i = 0;
  while (*(s + i)) {
    asm volatile("int $0x40" ::"a"(63), "b"(1), "c"(*(s + i)));
    i++;
  }
}


x86 assembly (clang, -O0):
<kol_board_puts>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1145 <kol_board_puts+0x45>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%cl
mov    $0x3f,%eax
mov    $0x1,%ebx
int    $0x40
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1110 <kol_board_puts+0x10>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_board_puts>:
push   %rbx
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <kol_board_puts+0x34>
mov    $0x1,%edx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3f,%eax
int    $0x40
mov    %edx,%eax
movzbl (%rdi,%rax,1),%ecx
add    $0x1,%edx
test   %cl,%cl
jne    1120 <kol_board_puts+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @kol_board_puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = load i32, i32* %3
%18 = add i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @kol_board_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 63, i32 1, i8 %5)
%7 = add i32 %6, 1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
double _asinacos(double, int);
double acos(double x) { return _asinacos(x, 1); }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <_asinacos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
mov    $0x1,%edi
jmp    1030 <_asinacos@plt>

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

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @_asinacos(double %0, i32 1)
ret double %2
}
/* Variables and functions */
long double f3_add(long double, long double, int);
long double __subtf3(long double a, long double b) { return f3_add(a, b, 1); }


x86 assembly (clang, -O0):
<__subtf3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x1,%edi
call   1030 <f3_add@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__subtf3>:
mov    $0x1,%edi
jmp    1030 <f3_add@plt>

LLVM IR (-O0):
define x86_fp80 @__subtf3(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @f3_add(x86_fp80 %5, x86_fp80 %6, i32 1)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @__subtf3(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @f3_add(x86_fp80 %0, x86_fp80 %1, i32 1)
ret x86_fp80 %3
}
int vli2int(const unsigned vli, const unsigned size) {
  if (!size)
    return 0;
  if ((vli << 1) < (1 << size))
    return vli + 1 - (1 << size);
  return vli;
}


x86 assembly (clang, -O0):
<vli2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <vli2int+0x20>
movl   $0x0,-0x4(%rbp)
jmp    115c <vli2int+0x5c>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jae    1156 <vli2int+0x56>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115c <vli2int+0x5c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vli2int>:
test   %esi,%esi
je     111c <vli2int+0x1c>
mov    %edi,%eax
lea    (%rax,%rax,1),%edi
mov    $0x1,%edx
mov    %esi,%ecx
shl    %cl,%edx
cmp    %edx,%edi
jae    111b <vli2int+0x1b>
sub    %edx,%eax
add    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vli2int(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = shl i32 %0, 1
%6 = shl nuw i32 1, %1
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = add i32 %0, 1
%10 = sub i32 %9, %6
br label %11
11: ; preds = %4, %2, %8
%12 = phi i32 [ %10, %8 ], [ 0, %2 ], [ %0, %4 ]
ret i32 %12
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *dvbmc_list_next(struct list const *, struct list const *);
struct list *dvbmc_list_head(const struct list *list) {
  return dvbmc_list_next(list, list);
}


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

x86 assembly (clang, -O2):
<dvbmc_list_head>:
mov    %rdi,%rsi
jmp    1030 <dvbmc_list_next@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @dvbmc_list_head(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call %struct.list* @dvbmc_list_next(%struct.list* %3, %struct.list* %4)
ret %struct.list* %5
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @dvbmc_list_head(%struct.list* %0) {
%2 = tail call %struct.list* @dvbmc_list_next(%struct.list* %0, %struct.list* %0)
ret %struct.list* %2
}
/* Type definitions */
struct vmfile {
  int dummy;
};

/* Variables and functions */
int vmfile_resize_if_full(struct vmfile *);
int /*<<< orphan*/ vmfile_unsafe_wseek(struct vmfile *, size_t);
int vmfile_wseek(struct vmfile *vmb, size_t by) {
  vmfile_unsafe_wseek(vmb, by);
  return vmfile_resize_if_full(vmb);
}


x86 assembly (clang, -O0):
<vmfile_wseek>:
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   1040 <vmfile_unsafe_wseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <vmfile_resize_if_full@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmfile_wseek>:
push   %rbx
mov    %rdi,%rbx
call   1040 <vmfile_unsafe_wseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <vmfile_resize_if_full@plt>

LLVM IR (-O0):
%struct.vmfile = type { i32 }
define i32 @vmfile_wseek(%struct.vmfile* %0, i64 %1) {
%3 = alloca %struct.vmfile*
%4 = alloca i64
store %struct.vmfile* %0, %struct.vmfile** %3
store i64 %1, i64* %4
%5 = load %struct.vmfile*, %struct.vmfile** %3
%6 = load i64, i64* %4
%7 = call i32 @vmfile_unsafe_wseek(%struct.vmfile* %5, i64 %6)
%8 = load %struct.vmfile*, %struct.vmfile** %3
%9 = call i32 @vmfile_resize_if_full(%struct.vmfile* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.vmfile = type { i32 }
define i32 @vmfile_wseek(%struct.vmfile* %0, i64 %1) {
%3 = tail call i32 @vmfile_unsafe_wseek(%struct.vmfile* %0, i64 %1)
%4 = tail call i32 @vmfile_resize_if_full(%struct.vmfile* %0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int kill(int /*<<< orphan*/, int);
int killpg_gosh(pid_t pid, int signal) { return kill(-pid, signal); }


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

x86 assembly (clang, -O2):
<killpg_gosh>:
neg    %edi
jmp    1030 <kill@plt>

LLVM IR (-O0):
define i32 @killpg_gosh(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 = sub nsw i32 0, %5
%7 = load i32, i32* %4
%8 = call i32 @kill(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @killpg_gosh(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
%4 = tail call i32 @kill(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
unsigned int BaudrateToBitPerSec(int);
unsigned int ComputeTransTime(unsigned int bytes, int baudrate) {
  double time = (bytes * 10.0) / BaudrateToBitPerSec(baudrate);
  return (unsigned int)(1000000.0 * time);
}


x86 assembly (clang, -O0):
<ComputeTransTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <BaudrateToBitPerSec@plt>
movsd  -0x18(%rbp),%xmm0
mov    %eax,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComputeTransTime>:
push   %rax
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xee0(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %esi,%edi
call   1030 <BaudrateToBitPerSec@plt>
mov    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xec1(%rip),%xmm1
cvttsd2si %xmm1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ComputeTransTime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = uitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+01
%9 = load i32, i32* %4
%10 = call i32 @BaudrateToBitPerSec(i32 %9)
%11 = uitofp i32 %10 to double
%12 = fdiv double %8, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = fmul double 1.000000e+06, %13
%15 = fptoui double %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @ComputeTransTime(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to double
%4 = fmul double %3, 1.000000e+01
%5 = tail call i32 @BaudrateToBitPerSec(i32 %1)
%6 = uitofp i32 %5 to double
%7 = fdiv double %4, %6
%8 = fmul double %7, 1.000000e+06
%9 = fptoui double %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int wait_for_i2c();
int /*<<< orphan*/ write_pci_config(int, int);
void wait_for_i2c_init(void) {
  uint8_t status = wait_for_i2c();
  if (status & (0x01 | 0x02 | 0x04 | 0x80))
    write_pci_config(0xb3, status & ~(0x04 | 0x80));
}


x86 assembly (clang, -O0):
<wait_for_i2c_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wait_for_i2c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x87,%eax
cmp    $0x0,%eax
je     1156 <wait_for_i2c_init+0x36>
mov    -0x4(%rbp),%esi
and    $0xffffff7b,%esi
mov    $0xb3,%edi
call   1040 <write_pci_config@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_i2c_init>:
push   %rax
xor    %eax,%eax
call   1030 <wait_for_i2c@plt>
test   $0x87,%al
je     113e <wait_for_i2c_init+0x1e>
and    $0xffffff7b,%eax
mov    $0xb3,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <write_pci_config@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_for_i2c_init() {
%1 = alloca i32
%2 = call i32 (...) @wait_for_i2c()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 135
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %1
%8 = and i32 %7, -133
%9 = call i32 @write_pci_config(i32 179, i32 %8)
br label %10
10: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @wait_for_i2c_init() {
%1 = tail call i32 (...) @wait_for_i2c()
%2 = and i32 %1, 135
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = and i32 %1, -133
%6 = tail call i32 @write_pci_config(i32 179, i32 %5)
br label %7
7: ; preds = %4, %0
ret void
}
/* Variables and functions */
int centeredDecagonal(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d centered decagonal number : %d", num, centeredDecagonal(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <centeredDecagonal@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <centeredDecagonal@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [34 x i8] c"%d centered decagonal number : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @centeredDecagonal(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [34 x i8] c"%d centered decagonal number : %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @centeredDecagonal(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}
ptnoise() { return (1); }


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

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

LLVM IR (-O0):
define i32 @ptnoise() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ptnoise() {
ret i32 1
}
/* Variables and functions */
int getsid(int /*<<< orphan*/);
int main(void) { return getsid(0); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getsid(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int sum(int, int);
void main() {
  int a;
  int b;
  int result = sum(a, b);
  if (result == a + b) {
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <main+0x2e>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <sum@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @sum(i32 undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_produce_consume();
int main(int argc, char **argv) {
  test_produce_consume();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_produce_consume()
ret i32 0
}