xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_SETFD;
int O_NONBLOCK;
int O_RDONLY;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int);
int open(char const *, int);
int open_read(const char *fn) {
  int fd = open(fn, O_RDONLY | O_NONBLOCK);
  if (fd == -1)
    return -1;
  fcntl(fd, F_SETFD, 1);
  return fd;
}


x86 assembly (clang, -O0):
<open_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1160 <open_read+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <open_read+0x5c>
mov    -0x14(%rbp),%edi
mov    0x2e66(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
call   1030 <fcntl@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_read>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1154 <open_read+0x34>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
mov    $0x1,%edx
call   1030 <fcntl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFD = global i32 0
define i32 @open_read(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %6, %7
%9 = call i32 @open(i8* %5, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %18
13: ; preds = %1
%14 = load i32, i32* %4
%15 = load i32, i32* @F_SETFD
%16 = call i32 @fcntl(i32 %14, i32 %15, i32 1)
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFD = global i32 0
define i32 @open_read(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @F_SETFD
%9 = tail call i32 @fcntl(i32 %5, i32 %8, i32 1)
br label %10
10: ; preds = %1, %7
ret i32 %5
}
void RTTestIFailedRc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestIFailedRc() {
ret void
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
__attribute__((__weak__, __always___)) int
softboundmpx_strncmp(const char *s1, const char *s2, size_t n) {
  return strncmp(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<softboundmpx_strncmp>:
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_strncmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncmp(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundmpx_strncmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
void EC_GROUP_cmp(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_cmp() {
ret void
}
void mat4_imul_quat(float mat[4][4], const float q[4]) {
  mat4_mul_quat(mat, q, mat);
}


x86 assembly (clang, -O0):
<mat4_imul_quat>:
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    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <mat4_mul_quat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4_imul_quat>:
mov    %rdi,%rdx
xor    %eax,%eax
jmp    1030 <mat4_mul_quat@plt>

LLVM IR (-O0):
define void @mat4_imul_quat([4 x float]* %0, float* %1) {
%3 = alloca [4 x float]*
%4 = alloca float*
store [4 x float]* %0, [4 x float]** %3
store float* %1, float** %4
%5 = load [4 x float]*, [4 x float]** %3
%6 = load float*, float** %4
%7 = load [4 x float]*, [4 x float]** %3
%8 = call i32 ([4 x float]*, float*, [4 x float]*, ...) bitcast (i32 (...)* @mat4_mul_quat to i32 ([4 x float]*, float*, [4 x float]*, ...)*)([4 x float]* %5, float* %6, [4 x float]* %7)
ret void
}

LLVM IR (-O2):
define void @mat4_imul_quat([4 x float]* %0, float* %1) {
%3 = tail call i32 ([4 x float]*, float*, [4 x float]*, ...) bitcast (i32 (...)* @mat4_mul_quat to i32 ([4 x float]*, float*, [4 x float]*, ...)*)([4 x float]* %0, float* %1, [4 x float]* %0)
ret void
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void OsSleep(long ms) {
  struct timespec req, rem;
  req.tv_sec = ms / 1000L;
  req.tv_nsec = ms % 1000L;
  req.tv_nsec *= 1000000L;
  nanosleep(&req, &rem);
}


x86 assembly (clang, -O0):
<OsSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsSleep>:
sub    $0x28,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0xf4240,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @OsSleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = sdiv i64 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %6, i64* %7
%8 = load i64, i64* %2
%9 = srem i64 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %9, i64* %10
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%12 = load i64, i64* %11
%13 = mul nsw i64 %12, 1000000
store i64 %13, i64* %11
%14 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @OsSleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = sdiv i64 %0, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %6, i64* %7
%8 = srem i64 %0, 1000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%10 = mul nsw i64 %8, 1000000
store i64 %10, i64* %9
%11 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}
/* Variables and functions */
int toupper(char);
int bp_sw_aminoacid_number_func(int type, void *data, char *seq) {
  return (toupper(*seq) - 'A');
}


x86 assembly (clang, -O0):
<bp_sw_aminoacid_number_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
sub    $0x41,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_aminoacid_number_func>:
push   %rax
movsbl (%rdx),%edi
call   1030 <toupper@plt>
add    $0xffffffbf,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bp_sw_aminoacid_number_func(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = call i32 @toupper(i8 signext %8)
%10 = sub nsw i32 %9, 65
ret i32 %10
}

LLVM IR (-O2):
define i32 @bp_sw_aminoacid_number_func(i32 %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = tail call i32 @toupper(i8 signext %4)
%6 = add nsw i32 %5, -65
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ coro_yield(void *);
void *test2_producer(void *arg) {
  int i;
  for (i = 0; i < 10; i++)
    coro_yield((void *)&i);
  return NULL;
}


x86 assembly (clang, -O0):
<test2_producer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1144 <test2_producer+0x34>
lea    -0xc(%rbp),%rdi
call   1030 <coro_yield@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <test2_producer+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2_producer>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <coro_yield@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x9,%eax
jl     1130 <test2_producer+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @test2_producer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = bitcast i32* %3 to i8*
%9 = call i32 @coro_yield(i8* %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test2_producer(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %1, %4
%5 = call i32 @coro_yield(i8* %3)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = icmp slt i32 %6, 9
br i1 %8, label %4, label %9
9: ; preds = %4
ret i8* null
}
/* Variables and functions */
scalar_t__ EINVAL;
float atof(char const *);
scalar_t__ errno;
float parse_float(const char *s_float) {
  float n_float;
  n_float = atof(s_float);
  if (errno == EINVAL) {
    return -1.0f;
  }
  return n_float;
}


x86 assembly (clang, -O0):
<parse_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x14(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%rax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%rax
jne    1156 <parse_float+0x46>
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1160 <parse_float+0x50>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_float>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rax
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%rax
jne    112f <parse_float+0x1f>
movss  0xed2(%rip),%xmm0
ret
jmp    1030 <atof@plt>

LLVM IR (-O0):
@errno = global i64 0
@EINVAL = global i64 0
define float @parse_float(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call float @atof(i8* %5)
store float %6, float* %4
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINVAL
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store float -1.000000e+00, float* %2
br label %13
11: ; preds = %1
%12 = load float, float* %4
store float %12, float* %2
br label %13
13: ; preds = %11, %10
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
@errno = global i64 0
@EINVAL = global i64 0
define float @parse_float(i8* nocapture %0) {
%2 = load i64, i64* @errno
%3 = load i64, i64* @EINVAL
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call float @atof(i8* %0)
br label %7
7: ; preds = %1, %5
%8 = phi float [ %6, %5 ], [ -1.000000e+00, %1 ]
ret float %8
}
void rop3_248_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T | stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_248_0_0>:
and    (%rdi),%sil
or     %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_248_0_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** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_248_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = or i8 %5, %2
store i8 %6, i8* %0
ret void
}
int test01(const char *s2) { return __builtin_strcmp("abc", s2); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i32 @test01(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @test01(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %0)
ret i32 %2
}
void cc3000_hw_setup(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @cc3000_hw_setup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ le();
int /*<<< orphan*/ swap64(int /*<<< orphan*/);
uint64_t read64le(uint64_t *p) { return (le() ? *p : swap64(*p)); }


x86 assembly (clang, -O0):
<read64le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <le@plt>
cmp    $0x0,%rax
je     114b <read64le+0x2b>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <read64le+0x39>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <swap64@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read64le>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <le@plt>
mov    %rax,%rcx
mov    (%rbx),%eax
test   %rcx,%rcx
je     1137 <read64le+0x17>
pop    %rbx
ret
mov    %eax,%edi
pop    %rbx
jmp    1040 <swap64@plt>

LLVM IR (-O0):
define i32 @read64le(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i64 (...) @le()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
br label %12
8: ; preds = %1
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = call i32 @swap64(i32 %10)
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @read64le(i32* nocapture %0) {
%2 = tail call i64 (...) @le()
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* %0
br i1 %3, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @swap64(i32 %4)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ %4, %1 ]
ret i32 %8
}
int sys$forcex(unsigned int *pidadr, void *prcnam, unsigned int code) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(code);
    register long int _a2 asm("rsi") = (long)(prcnam);
    register long int _a1 asm("rdi") = (long)(pidadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(22), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$forcex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x16,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$forcex>:
mov    %edx,%edx
mov    $0x16,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$forcex"(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load i32*, i32** %4
%17 = ptrtoint i32* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 22, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @"sys$forcex"(i32* %0, i8* %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i32* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 22, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void motor_driver_standby(char p_option) {
  if (p_option > 0) {
    system("echo 0 > /sys/class/gpio/gpio49/value");
  } else {
    system("echo 1 > /sys/class/gpio/gpio49/value");
  }
}


x86 assembly (clang, -O0):
<motor_driver_standby>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jle    113c <motor_driver_standby+0x2c>
lea    0xece(%rip),%rdi
call   1030 <system@plt>
jmp    1148 <motor_driver_standby+0x38>
lea    0xee3(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motor_driver_standby>:
test   %dil,%dil
lea    0xee6(%rip),%rax
lea    0xf05(%rip),%rdi
cmovg  %rax,%rdi
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"echo 0 > /sys/class/gpio/gpio49/value\00"
@.str.1 = [38 x i8] c"echo 1 > /sys/class/gpio/gpio49/value\00"
define void @motor_driver_standby(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @system(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"echo 0 > /sys/class/gpio/gpio49/value\00"
@.str.1 = [38 x i8] c"echo 1 > /sys/class/gpio/gpio49/value\00"
define void @motor_driver_standby(i8 signext %0) {
%2 = icmp sgt i8 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deallocateKey(void *key) { free(key); }


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

x86 assembly (clang, -O2):
<deallocateKey>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deallocateKey(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void BotPreProcessAI() {}


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

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

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

LLVM IR (-O2):
define void @BotPreProcessAI() {
ret void
}
float sum(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sum(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @sum(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ F_DUPFD;
int __fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int __dup(int fd) { return __fcntl(fd, F_DUPFD, 0); }


x86 assembly (clang, -O0):
<__dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <__fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dup>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <__fcntl@plt>

LLVM IR (-O0):
@F_DUPFD = global i32 0
define i32 @__dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_DUPFD
%5 = call i32 @__fcntl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@F_DUPFD = global i32 0
define i32 @__dup(i32 %0) {
%2 = load i32, i32* @F_DUPFD
%3 = tail call i32 @__fcntl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ byteswap4(int /*<<< orphan*/);
float byteswap_float(float num) {
  uint32_t answer = byteswap4(*(uint32_t *)&num);
  return *(float *)&answer;
}


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

x86 assembly (clang, -O2):
<byteswap_float>:
push   %rax
movd   %xmm0,%edi
call   1030 <byteswap4@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @byteswap_float(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = bitcast float* %2 to i32*
%5 = load i32, i32* %4
%6 = call i32 @byteswap4(i32 %5)
store i32 %6, i32* %3
%7 = bitcast i32* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @byteswap_float(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @byteswap4(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ read(int, char *, int);
int file_reader(void *data, char *buf, int len) {
  int fd = (int)(long)data;
  ssize_t size = read(fd, buf, len);
  return (int)size;
}


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

x86 assembly (clang, -O2):
<file_reader>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @file_reader(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i64 @read(i32 %12, i8* %13, i32 %14)
store i64 %15, i64* %8
%16 = load i64, i64* %8
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @file_reader(i8* %0, i8* nocapture %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i64 @read(i32 %5, i8* %1, i32 %2)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ trans(char);
void uart_tx_string(char string[15]) {
  int a = 0;
  while (string[a] != '\0') {
    trans(string[a]);
    a += 1;
  }
}


x86 assembly (clang, -O0):
<uart_tx_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <uart_tx_string+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <trans@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uart_tx_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_tx_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_tx_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <trans@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_tx_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_tx_string(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 i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @trans(i8 signext %6)
%8 = add nuw i64 %5, 1
%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
}
int waitForFanfare() {
  int (*func)(void) = (int (*)(void))0x080A313D;
  return func();
}


x86 assembly (clang, -O0):
<waitForFanfare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80a313d,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForFanfare>:
mov    $0x80a313d,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @waitForFanfare() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 134885693 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret i32 %3
}

LLVM IR (-O2):
define i32 @waitForFanfare() {
%1 = tail call i32 inttoptr (i64 134885693 to i32 ()*)()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char itoc(int i) {
  static char c[1];
  sprintf(c, "%d", i);
  return c[0];
}


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f04(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
movsbl 0x2ef1(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
push   %rax
mov    %edi,%edx
lea    0x2f0f(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <sprintf@plt>
mov    0x2efd(%rip),%al
pop    %rcx
ret

LLVM IR (-O0):
@itoc.c = internal global [1 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define signext i8 @itoc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @itoc.c, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @itoc.c, i64 0, i64 0)
ret i8 %5
}

LLVM IR (-O2):
@itoc.c = internal global [1 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define signext i8 @itoc(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1 x i8], [1 x i8]* @itoc.c, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @itoc.c, i64 0, i64 0)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ unsigned_prune_ge1_Good(int /*<<< orphan*/, int);
void call_unsigned_prune_ge1_Good() { unsigned_prune_ge1_Good(0, 1); }


x86 assembly (clang, -O0):
<call_unsigned_prune_ge1_Good>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <unsigned_prune_ge1_Good@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_unsigned_prune_ge1_Good>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <unsigned_prune_ge1_Good@plt>

LLVM IR (-O0):
define void @call_unsigned_prune_ge1_Good() {
%1 = call i32 @unsigned_prune_ge1_Good(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @call_unsigned_prune_ge1_Good() {
%1 = tail call i32 @unsigned_prune_ge1_Good(i32 0, i32 1)
ret void
}
void del(int k, int *print_ptr, int *last_print, int *displ) {
  if (*last_print < 0)
    *last_print = displ[(*print_ptr) - 1] -= k;
  else
    *last_print = displ[(*print_ptr)++] = -k;
}


x86 assembly (clang, -O0):
<del>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1146 <del+0x46>
mov    -0x4(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
mov    (%rax,%rdx,4),%ecx
sub    %esi,%ecx
mov    %ecx,(%rax,%rdx,4)
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1168 <del+0x68>
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%edx
mov    %edx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %edx,%rdx
mov    %ecx,(%rax,%rdx,4)
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<del>:
cmpl   $0x0,(%rdx)
js     1117 <del+0x17>
neg    %edi
movslq (%rsi),%r8
lea    0x1(%r8),%eax
mov    %eax,(%rsi)
mov    %edi,(%rcx,%r8,4)
mov    %edi,(%rdx)
ret
movslq (%rsi),%rsi
mov    -0x4(%rcx,%rsi,4),%eax
sub    %edi,%eax
mov    %eax,-0x4(%rcx,%rsi,4)
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @del(i32 %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %3, i64 %10
%12 = load i32, i32* %11
%13 = sub nsw i32 %12, %0
store i32 %13, i32* %11
br label %20
14: ; preds = %4
%15 = sub nsw i32 0, %0
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i32, i32* %3, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %14, %7
%21 = phi i32 [ %15, %14 ], [ %13, %7 ]
store i32 %21, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int open(const char *url, int port) {
  printf("http::open() called!\n");
  return 1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [21 x i8] c"http::open() called!\00"
define i32 @open(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void main() {
  int a[10];
  if (a) {
    return;
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
cmp    $0x0,%rax
je     1117 <main+0x17>
jmp    111c <main+0x1c>
jmp    111c <main+0x1c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = icmp ne i32* %2, null
br i1 %3, label %4, label %5
4: ; preds = %0
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %4
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @UART_isr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tfp_printf(char *);
double pow(double x, double y) {
  tfp_printf("pow called, unimplemented!\n");
  return 0;
}


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <tfp_printf@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <tfp_printf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"pow called, unimplemented!\0A\00"
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @tfp_printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [28 x i8] c"pow called, unimplemented!\0A\00"
define double @pow(double %0, double %1) {
%3 = tail call i32 @tfp_printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void a_free(void *ptr) {
  if (ptr)
    free((char *)ptr - ((char *)ptr)[-1]);
}


x86 assembly (clang, -O0):
<a_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <a_free+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movsbl -0x1(%rax),%eax
movslq %eax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_free>:
test   %rdi,%rdi
je     1122 <a_free+0x12>
movsbq -0x1(%rdi),%rax
sub    %rax,%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @a_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sext i32 %10 to i64
%12 = sub i64 0, %11
%13 = getelementptr inbounds i8, i8* %6, i64 %12
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @a_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = sub nsw i64 0, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @free(i8* %8)
br label %10
10: ; preds = %3, %1
ret void
}
int ioctl_readtoc(unsigned char *b, unsigned char starttrack, int msf,
                  int maxlen, int single) {
  return 0;
}


x86 assembly (clang, -O0):
<ioctl_readtoc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ioctl_readtoc(i8* %0, i8 zeroext %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8 %1, i8* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @ioctl_readtoc(i8* nocapture readnone %0, i8 zeroext %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
void *ERR_PTR(long error_) { return (void *)error_; }


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

x86 assembly (clang, -O2):
<ERR_PTR>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ERR_PTR(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @ERR_PTR(i64 %0) {
%2 = inttoptr i64 %0 to i8*
ret i8* %2
}
/* Variables and functions */
long long fact(int);
long long int combination(int n, int r) {
  return fact(n) / (fact(r) * fact(n - r));
}


x86 assembly (clang, -O0):
<combination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fact@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
imul   %rdx,%rcx
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combination>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <fact@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1030 <fact@plt>
mov    %rax,%r15
sub    %ebp,%ebx
mov    %ebx,%edi
call   1030 <fact@plt>
mov    %rax,%rcx
imul   %r15,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1153 <combination+0x43>
mov    %r14,%rax
cqto
idiv   %rcx
jmp    115a <combination+0x4a>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @combination(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 = call i64 @fact(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @fact(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i64 @fact(i32 %11)
%13 = mul nsw i64 %8, %12
%14 = sdiv i64 %6, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @combination(i32 %0, i32 %1) {
%3 = tail call i64 @fact(i32 %0)
%4 = tail call i64 @fact(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i64 @fact(i32 %5)
%7 = mul nsw i64 %6, %4
%8 = sdiv i64 %3, %7
ret i64 %8
}
int my_strlen2(char *str) {
  int i;
  i = 0;
  while (*(str + i) != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen2+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen2>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen2+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen2(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equalsChars(const void *left, const void *right) {
  return strcmp((char *)left, (char *)right) == 0;
}


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

x86 assembly (clang, -O2):
<equalsChars>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equalsChars(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @equalsChars(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void wifi_evt_sme_interface_status(
    const struct wifi_msg_sme_interface_status_evt_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_sme_interface_status_evt_t = type opaque
define void @wifi_evt_sme_interface_status(%struct.wifi_msg_sme_interface_status_evt_t* %0) {
%2 = alloca %struct.wifi_msg_sme_interface_status_evt_t*
store %struct.wifi_msg_sme_interface_status_evt_t* %0, %struct.wifi_msg_sme_interface_status_evt_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_sme_interface_status_evt_t = type opaque
define void @wifi_evt_sme_interface_status(%struct.wifi_msg_sme_interface_status_evt_t* nocapture %0) {
ret void
}
void ft_swap(char **s1, char **s2) {
  char *temp;
  temp = *s1;
  *s1 = *s2;
  *s2 = temp;
}


x86 assembly (clang, -O0):
<ft_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @ft_swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @ft_swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int pthread_self();
int hw_get_current_thread_id() { return pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @hw_get_current_thread_id() {
%1 = call i32 (...) @pthread_self()
ret i32 %1
}

LLVM IR (-O2):
define i32 @hw_get_current_thread_id() {
%1 = tail call i32 (...) @pthread_self()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ outchar(char);
int /*<<< orphan*/ outclr();
int /*<<< orphan*/ outstrg(char const *);
void outsrc(const char *name) {
  outclr();
  outchar('S');
  outstrg(name);
}


x86 assembly (clang, -O0):
<outsrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <outclr@plt>
mov    $0x53,%edi
call   1040 <outchar@plt>
mov    -0x8(%rbp),%rdi
call   1050 <outstrg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsrc>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <outclr@plt>
mov    $0x53,%edi
call   1040 <outchar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <outstrg@plt>

LLVM IR (-O0):
define void @outsrc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @outclr()
%4 = call i32 @outchar(i8 signext 83)
%5 = load i8*, i8** %2
%6 = call i32 @outstrg(i8* %5)
ret void
}

LLVM IR (-O2):
define void @outsrc(i8* %0) {
%2 = tail call i32 (...) @outclr()
%3 = tail call i32 @outchar(i8 signext 83)
%4 = tail call i32 @outstrg(i8* %0)
ret void
}