xunge/DecIR huggingface dataset:
unsigned short doubleToFixed(double value) {
  long longValue = (long)(value * 32768 + 0.5);
  return longValue < -32768  ? -32768
         : longValue > 32767 ? 32767
                             : (unsigned short)longValue;
}


x86 assembly (clang, -O0):
<doubleToFixed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffff8000,-0x10(%rbp)
ff
jge    114a <doubleToFixed+0x4a>
mov    $0xffff8000,%eax
mov    %eax,-0x14(%rbp)
jmp    1175 <doubleToFixed+0x75>
cmpq   $0x7fff,-0x10(%rbp)
jle    1165 <doubleToFixed+0x65>
mov    $0x7fff,%eax
mov    %eax,-0x18(%rbp)
jmp    116f <doubleToFixed+0x6f>
mov    -0x10(%rbp),%rax
movzwl %ax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleToFixed>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
minsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define zeroext i16 @doubleToFixed(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %4, double 3.276800e+04, double 5.000000e-01)
%6 = fptosi double %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp slt i64 %7, -32768
br i1 %8, label %9, label %10
9: ; preds = %1
br label %20
10: ; preds = %1
%11 = load i64, i64* %3
%12 = icmp sgt i64 %11, 32767
br i1 %12, label %13, label %14
13: ; preds = %10
br label %18
14: ; preds = %10
%15 = load i64, i64* %3
%16 = trunc i64 %15 to i16
%17 = zext i16 %16 to i32
br label %18
18: ; preds = %14, %13
%19 = phi i32 [ 32767, %13 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %9
%21 = phi i32 [ -32768, %9 ], [ %19, %18 ]
%22 = trunc i32 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @doubleToFixed(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.276800e+04, double 5.000000e-01)
%3 = fptosi double %2 to i64
%4 = icmp slt i64 %3, 32767
%5 = select i1 %4, i64 %3, i64 32767
%6 = icmp sgt i64 %5, -32768
%7 = select i1 %6, i64 %5, i64 -32768
%8 = trunc i64 %7 to i16
ret i16 %8
}
void array_o_dummy_free(void *obj) { return; }


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

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

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

LLVM IR (-O2):
define void @array_o_dummy_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zwave_sendClassCommand(unsigned int, int, int,
                                          unsigned char *, int);
void zwavecmd_basic_set(unsigned int id, unsigned char v) {
  unsigned char buf[1];
  buf[0] = v;
  zwave_sendClassCommand(id, 0x20, 0x1, buf, 1);
}


x86 assembly (clang, -O0):
<zwavecmd_basic_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rcx
mov    $0x20,%esi
mov    $0x1,%r8d
mov    %r8d,%edx
call   1030 <zwave_sendClassCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_basic_set>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rcx
mov    $0x20,%esi
mov    $0x1,%edx
mov    $0x1,%r8d
call   1030 <zwave_sendClassCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @zwavecmd_basic_set(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [1 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i32, i32* %3
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%10 = call i32 @zwave_sendClassCommand(i32 %8, i32 32, i32 1, i8* %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @zwavecmd_basic_set(i32 %0, i8 zeroext %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = call i32 @zwave_sendClassCommand(i32 %0, i32 32, i32 1, i8* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_response_from_vpi();
int /*<<< orphan*/ send_command_to_vpi(int);
void jp2_reset_JTAG() {
  int i;
  ("\nreset(");
  send_command_to_vpi(0xb);
  get_response_from_vpi();
  (")\n");
}


x86 assembly (clang, -O0):
<jp2_reset_JTAG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb,%edi
call   1030 <send_command_to_vpi@plt>
mov    $0x0,%al
call   1040 <get_response_from_vpi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jp2_reset_JTAG>:
push   %rax
mov    $0xb,%edi
call   1030 <send_command_to_vpi@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_response_from_vpi@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0Areset(\00"
@.str.1 = [3 x i8] c")\0A\00"
define void @jp2_reset_JTAG() {
%1 = alloca i32
%2 = call i32 @send_command_to_vpi(i32 11)
%3 = call i32 (...) @get_response_from_vpi()
ret void
}

LLVM IR (-O2):
define void @jp2_reset_JTAG() {
%1 = tail call i32 @send_command_to_vpi(i32 11)
%2 = tail call i32 (...) @get_response_from_vpi()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_info(char *);
void pledge_wrapper(const char *promises) {
  log_info("not running OpenBSD, no pledge");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"not running OpenBSD, no pledge\00"
define void @pledge_wrapper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @log_info(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"not running OpenBSD, no pledge\00"
define void @pledge_wrapper(i8* nocapture readnone %0) {
%2 = tail call i32 @log_info(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ sat_oom(int /*<<< orphan*/, size_t);
void *sat_malloc(size_t len) {
  void *r = malloc(len ? len : 1);
  if (!r)
    sat_oom(0, len);
  return r;
}


x86 assembly (clang, -O0):
<sat_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <sat_malloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <sat_malloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
jmp    1152 <sat_malloc+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <sat_malloc+0x55>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <sat_oom@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
mov    $0x1,%edi
cmovne %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <sat_malloc+0x2a>
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <sat_oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @sat_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @sat_oom(i32 0, i64 %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void vibro_init() {}


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

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

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

LLVM IR (-O2):
define void @vibro_init() {
ret void
}
/* Variables and functions */
int LOG_CONS;
int /*<<< orphan*/ LOG_INFO;
int LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
void logInfoMessage(char *message) {
  openlog("dt228Yr4", LOG_PID | LOG_CONS, LOG_USER);
  syslog(LOG_INFO, "%s", message);
  closelog();
}


x86 assembly (clang, -O0):
<logInfoMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e84(%rip),%rax
or     (%rax),%esi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
lea    0xea2(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logInfoMessage>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    0x2e8e(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <closelog@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"dt228Yr4\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @logInfoMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_CONS
%5 = or i32 %3, %4
%6 = load i32, i32* @LOG_USER
%7 = call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* @LOG_INFO
%9 = load i8*, i8** %2
%10 = call i32 @syslog(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @closelog()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"dt228Yr4\00"
@LOG_PID = global i32 0
@LOG_CONS = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define void @logInfoMessage(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_CONS
%4 = or i32 %3, %2
%5 = load i32, i32* @LOG_USER
%6 = tail call i32 @openlog(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* @LOG_INFO
%8 = tail call i32 @syslog(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpop();
int /*<<< orphan*/ ol(char *);
callstk() {
  gpop();
  ol("jsr\t(x)");
}


x86 assembly (clang, -O0):
<callstk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gpop@plt>
lea    0xeca(%rip),%rdi
call   1040 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callstk>:
push   %rax
xor    %eax,%eax
call   1030 <gpop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <ol@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"jsr\09(x)\00"
define i32 @callstk() {
%1 = alloca i32
%2 = call i32 (...) @gpop()
%3 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"jsr\09(x)\00"
define i32 @callstk() {
%1 = tail call i32 (...) @gpop()
%2 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_abs(int /*<<< orphan*/);
scalar_t__ fn1();
scalar_t__ fn2(int, int);
scalar_t__ fn3(int);
int t6() {
  if (fn1() < 0 || fn2(2, 1) < 0 || fn3(2) < 0)
    return -1;
  fn1();
  fn2(92, 21);
  fn3(42);
  __builtin_abs(0);
  (void)0, fn1();
  return 0;
}


x86 assembly (clang, -O0):
<t6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fn1@plt>
cmp    $0x0,%rax
jl     1176 <t6+0x46>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <fn2@plt>
cmp    $0x0,%rax
jl     1176 <t6+0x46>
mov    $0x2,%edi
call   1040 <fn3@plt>
cmp    $0x0,%rax
jge    1182 <t6+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b0 <t6+0x80>
mov    $0x0,%al
call   1030 <fn1@plt>
mov    $0x5c,%edi
mov    $0x15,%esi
call   1050 <fn2@plt>
mov    $0x2a,%edi
call   1040 <fn3@plt>
mov    $0x0,%al
call   1030 <fn1@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t6>:
push   %rbx
xor    %eax,%eax
call   1030 <fn1@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
js     118e <t6+0x5e>
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <fn2@plt>
test   %rax,%rax
js     118e <t6+0x5e>
mov    $0x2,%edi
call   1040 <fn3@plt>
test   %rax,%rax
js     118e <t6+0x5e>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <fn1@plt>
mov    $0x5c,%edi
mov    $0x15,%esi
call   1050 <fn2@plt>
mov    $0x2a,%edi
call   1040 <fn3@plt>
xor    %eax,%eax
call   1030 <fn1@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @t6() {
%1 = alloca i32
%2 = call i64 (...) @fn1()
%3 = icmp slt i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = call i64 @fn2(i32 2, i32 1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i64 @fn3(i32 2)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %4, %0
store i32 -1, i32* %1
br label %16
11: ; preds = %7
%12 = call i64 (...) @fn1()
%13 = call i64 @fn2(i32 92, i32 21)
%14 = call i64 @fn3(i32 42)
%15 = call i64 (...) @fn1()
store i32 0, i32* %1
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @t6() {
%1 = tail call i64 (...) @fn1()
%2 = icmp slt i64 %1, 0
br i1 %2, label %14, label %3
3: ; preds = %0
%4 = tail call i64 @fn2(i32 2, i32 1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = tail call i64 @fn3(i32 2)
%8 = icmp slt i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = tail call i64 (...) @fn1()
%11 = tail call i64 @fn2(i32 92, i32 21)
%12 = tail call i64 @fn3(i32 42)
%13 = tail call i64 (...) @fn1()
br label %14
14: ; preds = %0, %3, %6, %9
%15 = phi i32 [ 0, %9 ], [ -1, %6 ], [ -1, %3 ], [ -1, %0 ]
ret i32 %15
}
void math_tan(void) {
  double d = luaL_check_number(1);
  lua_pushnumber(tan(((d)*3.14159265358979323846 / 180.0)));
}


x86 assembly (clang, -O0):
<math_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <luaL_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <tan@plt>
mov    $0x1,%al
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_tan>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <luaL_check_number@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xeb7(%rip),%xmm0
divsd  0xeb7(%rip),%xmm0
call   1050 <tan@plt>
mov    $0x1,%al
pop    %rcx
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_tan() {
%1 = alloca double
%2 = call i32 (i32, ...) bitcast (i32 (...)* @luaL_check_number to i32 (i32, ...)*)(i32 1)
%3 = sitofp i32 %2 to double
store double %3, double* %1
%4 = load double, double* %1
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = call double @tan(double %6)
%8 = call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %7)
ret void
}

LLVM IR (-O2):
define void @math_tan() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @luaL_check_number to i32 (i32, ...)*)(i32 1)
%2 = sitofp i32 %1 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = tail call double @tan(double %4)
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %5)
ret void
}
/* Variables and functions */
scalar_t__ pow(int, int);
float sqrt(scalar_t__);
float score(int changes[3], int y_target, int x_target) {
  float resultado =
      sqrt(pow(changes[1] - x_target, 2) + pow(changes[0] - y_target, 2));
  return resultado;
}


x86 assembly (clang, -O0):
<score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
sub    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
sub    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<score>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x4(%rdi),%edi
sub    %edx,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rbp
mov    (%rbx),%edi
sub    %r14d,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    %rax,%rbp
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @score(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = load i32, i32* %6
%12 = sub nsw i32 %10, %11
%13 = call i64 @pow(i32 %12, i32 2)
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = load i32, i32* %5
%18 = sub nsw i32 %16, %17
%19 = call i64 @pow(i32 %18, i32 2)
%20 = add nsw i64 %13, %19
%21 = call float @sqrt(i64 %20)
store float %21, float* %7
%22 = load float, float* %7
ret float %22
}

LLVM IR (-O2):
define float @score(i32* nocapture %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, %2
%7 = tail call i64 @pow(i32 %6, i32 2)
%8 = load i32, i32* %0
%9 = sub nsw i32 %8, %1
%10 = tail call i64 @pow(i32 %9, i32 2)
%11 = add nsw i64 %10, %7
%12 = tail call float @sqrt(i64 %11)
ret float %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_bit(unsigned int, int /*<<< orphan*/ *);
void write_bits(int n, unsigned int c, FILE *out) {
  for (int i = n; i >= 0; i--) {
    write_bit((c >> i) & 1, out);
  }
}


x86 assembly (clang, -O0):
<write_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1154 <write_bits+0x44>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%ecx
shr    %cl,%edi
and    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <write_bit@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <write_bits+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bits>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
js     1136 <write_bits+0x26>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebp,%edi
mov    %ebx,%ecx
shr    %cl,%edi
and    $0x1,%edi
mov    %r14,%rsi
call   1030 <write_bit@plt>
add    $0xffffffff,%ebx
jb     1120 <write_bits+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @write_bits(i32 %0, i32 %1, i32* %2) {
%4 = icmp sgt i32 %0, -1
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %11, %6 ], [ %0, %3 ]
%8 = lshr i32 %1, %7
%9 = and i32 %8, 1
%10 = tail call i32 @write_bit(i32 %9, i32* %2)
%11 = add nsw i32 %7, -1
%12 = icmp eq i32 %7, 0
br i1 %12, label %5, label %6
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t naive_ctz64(uint64_t x) {
  uint64_t m;
  uint32_t i;
  assert(x != 0);
  m = 1;
  i = 0;
  while ((x & m) == 0) {
    i++;
    m += m;
  }
  return i;
}


x86 assembly (clang, -O0):
<naive_ctz64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1164 <naive_ctz64+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113b <naive_ctz64+0x2b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naive_ctz64>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1030 <assert@plt>
test   $0x1,%bl
jne    113c <naive_ctz64+0x2c>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
add    $0x1,%rax
add    %ecx,%ecx
test   %ebx,%ecx
je     1130 <naive_ctz64+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @naive_ctz64(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %1, %7
%8 = phi i64 [ %10, %7 ], [ 0, %1 ]
%9 = phi i32 [ %11, %7 ], [ 1, %1 ]
%10 = add nuw nsw i64 %8, 1
%11 = shl nsw i32 %9, 1
%12 = and i32 %11, %0
%13 = icmp eq i32 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %1
%15 = phi i64 [ 0, %1 ], [ %10, %7 ]
ret i64 %15
}
/* Variables and functions */
int randomInteger(int, int);
int randomEven(int low, int high) {
  return 2 * randomInteger(low / 2, high / 2);
}


x86 assembly (clang, -O0):
<randomEven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <randomInteger@plt>
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomEven>:
push   %rax
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
mov    %esi,%eax
shr    $0x1f,%eax
add    %eax,%esi
sar    %esi
call   1030 <randomInteger@plt>
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randomEven(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 = sdiv i32 %5, 2
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 2
%9 = call i32 @randomInteger(i32 %6, i32 %8)
%10 = mul nsw i32 2, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @randomEven(i32 %0, i32 %1) {
%3 = sdiv i32 %0, 2
%4 = sdiv i32 %1, 2
%5 = tail call i32 @randomInteger(i32 %3, i32 %4)
%6 = shl nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void term_child() { exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<term_child>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<term_child>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @term_child() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @term_child() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stderr;
void die_with_error(const char *message) {
  fprintf(stderr, "%s%s\n", "DiSL-agent error: ", message);
  exit(10000);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
@.str.1 = [19 x i8] c"DiSL-agent error: \00"
define void @die_with_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 10000)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
@.str.1 = [19 x i8] c"DiSL-agent error: \00"
define void @die_with_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 10000)
unreachable
}
/* Type definitions */
struct Value {
  int dummy;
};
struct ParseState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PlatformExit();
void LibExit(struct ParseState *Parser, struct Value *ReturnValue,
             struct Value **Param, int NumArgs) {
  PlatformExit();
}


x86 assembly (clang, -O0):
<LibExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <PlatformExit@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
define void @LibExit(%struct.ParseState* %0, %struct.Value* %1, %struct.Value** %2, i32 %3) {
%5 = alloca %struct.ParseState*
%6 = alloca %struct.Value*
%7 = alloca %struct.Value**
%8 = alloca i32
store %struct.ParseState* %0, %struct.ParseState** %5
store %struct.Value* %1, %struct.Value** %6
store %struct.Value** %2, %struct.Value*** %7
store i32 %3, i32* %8
%9 = call i32 (...) @PlatformExit()
ret void
}

LLVM IR (-O2):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
define void @LibExit(%struct.ParseState* nocapture readnone %0, %struct.Value* nocapture readnone %1, %struct.Value** nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @PlatformExit()
ret void
}
int security_inode_permission(struct inode *inode, int mask,
                              struct nameidata *nd) {
  return 0;
}


x86 assembly (clang, -O0):
<security_inode_permission>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.nameidata = type opaque
define i32 @security_inode_permission(%struct.inode* %0, i32 %1, %struct.nameidata* %2) {
%4 = alloca %struct.inode*
%5 = alloca i32
%6 = alloca %struct.nameidata*
store %struct.inode* %0, %struct.inode** %4
store i32 %1, i32* %5
store %struct.nameidata* %2, %struct.nameidata** %6
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.nameidata = type opaque
define i32 @security_inode_permission(%struct.inode* nocapture readnone %0, i32 %1, %struct.nameidata* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Fatal(char *);
void OOM(void) { Fatal("Out of memory"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define void @OOM() {
%1 = call i32 @Fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define void @OOM() {
%1 = tail call i32 @Fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void Error(int err) { printf("faint %d\n", err); }


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

x86 assembly (clang, -O2):
<Error>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"faint %d\0A\00"
define void @Error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"faint %d\0A\00"
define void @Error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int main() {
  int cnt = 0;
  while (cnt < 100) {
    break;
    ++cnt;
  }
  while (cnt < 100) {
    {
      break;
      ++cnt;
    }
    ++cnt;
  }
  while (cnt < 100) {
    if (cnt == 0) {
      break;
      ++cnt;
    }
    ++cnt;
  }
  while (cnt < 100) {
    if (cnt == 0) {
      ++cnt;
    } else {
      break;
    }
    ++cnt;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1121 <main+0x21>
jmp    1121 <main+0x21>
jmp    1126 <main+0x26>
cmpl   $0x64,-0x8(%rbp)
jge    1135 <main+0x35>
jmp    1135 <main+0x35>
jmp    113a <main+0x3a>
cmpl   $0x64,-0x8(%rbp)
jge    1161 <main+0x61>
cmpl   $0x0,-0x8(%rbp)
jne    1153 <main+0x53>
jmp    1161 <main+0x61>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <main+0x3a>
jmp    1166 <main+0x66>
cmpl   $0x64,-0x8(%rbp)
jge    119b <main+0x9b>
cmpl   $0x0,-0x8(%rbp)
jne    1188 <main+0x88>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118d <main+0x8d>
jmp    119b <main+0x9b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x66>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void ft_tabdel(char **tab) {
  int i;
  i = 0;
  if (tab) {
    while (tab[i])
      free(tab[i++]);
    free(tab);
  }
}


x86 assembly (clang, -O0):
<ft_tabdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116f <ft_tabdel+0x5f>
jmp    1133 <ft_tabdel+0x23>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1166 <ft_tabdel+0x56>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1133 <ft_tabdel+0x23>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tabdel>:
test   %rdi,%rdi
je     1150 <ft_tabdel+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <ft_tabdel+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <ft_tabdel+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @ft_tabdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
%9 = add nuw nsw i64 %7, 1
tail call void @free(i8* %8)
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
br label %15
15: ; preds = %13, %1
ret void
}
int match(unsigned char *a, unsigned char *b, int l) {
  int i;
  for (i = 0; i < l; i++)
    if (a[i] != b[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1161 <match+0x61>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114e <match+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1168 <match+0x68>
jmp    1153 <match+0x53>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <match+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <match+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <match+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <match+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
void unpackstring(src, dest) int *src, *dest;
{
  int i, c;
  for (i = 0;; i++) {
    c = *(i + (unsigned char *)src);
    dest[i] = c;
    if (c == 0)
      break;
  }
}


x86 assembly (clang, -O0):
<unpackstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
cmpl   $0x0,-0x18(%rbp)
jne    1141 <unpackstring+0x41>
jmp    1154 <unpackstring+0x54>
jmp    1146 <unpackstring+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <unpackstring+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackstring>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %ecx,(%rsi,%rax,4)
add    $0x1,%rax
test   %ecx,%ecx
jne    1110 <unpackstring+0x10>
ret

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

LLVM IR (-O2):
define void @unpackstring(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = bitcast i32* %0 to i8*
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %8, i32* %9
%10 = icmp eq i8 %7, 0
%11 = add nuw i64 %5, 1
br i1 %10, label %12, label %4
12: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(int);
int /*<<< orphan*/ printf(char *);
int main() {
  fail(1);
  fail(2);
  fail(3);
  fail(4);
  printf("no failure\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <fail@plt>
mov    $0x2,%edi
call   1030 <fail@plt>
mov    $0x3,%edi
call   1030 <fail@plt>
mov    $0x4,%edi
call   1030 <fail@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <fail@plt>
mov    $0x2,%edi
call   1040 <fail@plt>
mov    $0x3,%edi
call   1040 <fail@plt>
mov    $0x4,%edi
call   1040 <fail@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"no failure\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fail(i32 1)
%3 = call i32 @fail(i32 2)
%4 = call i32 @fail(i32 3)
%5 = call i32 @fail(i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"no failure\00"
define i32 @main() {
%1 = tail call i32 @fail(i32 1)
%2 = tail call i32 @fail(i32 2)
%3 = tail call i32 @fail(i32 3)
%4 = tail call i32 @fail(i32 4)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
float __VERIFIER_nondet_float();
int main(void) {
  float a = __VERIFIER_nondet_float();
  if (a < 0) {
    return 0;
  }
  __VERIFIER_assert(a > 0);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_float@plt>
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1154 <main+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1174 <main+0x54>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_float@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1150 <main+0x30>
xor    %edi,%edi
ucomiss %xmm1,%xmm0
seta   %dil
movss  %xmm0,0xc(%rsp)
call   1030 <__VERIFIER_assert@plt>
cvttss2si 0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float (...) @__VERIFIER_nondet_float()
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %14
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp ogt float %8, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = call i32 @__VERIFIER_assert(i32 %10)
%12 = load float, float* %2
%13 = fptosi float %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @__VERIFIER_nondet_float()
%2 = fcmp olt float %1, 0.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = fcmp ogt float %1, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = tail call i32 @__VERIFIER_assert(i32 %5)
%7 = fptosi float %1 to i32
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ %7, %3 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printfArr(int arr[], int len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%d ", *(arr + i));
  }
}


x86 assembly (clang, -O0):
<printfArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printfArr+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printfArr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printfArr+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printfArr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @printfArr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printfArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void cl_arg_warning(const char *msg) { fprintf(stderr, "Warning: %s\n", msg); }


x86 assembly (clang, -O0):
<cl_arg_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_arg_warning>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @cl_arg_warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @cl_arg_warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}