xunge/DecIR huggingface dataset:
find_word(long long n, long long len) { long long i; }


x86 assembly (clang, -O0):
<find_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @find_word(i64 %0, i64 %1) {
ret i32 undef
}
int io_get_attr(fd, io)
int fd;
struct termios *io;
{
  int res;
  res = tcgetattr(fd, io);
  if (res < 0)
    SePError("ioctl-get");
  return res;
}


x86 assembly (clang, -O0):
<io_get_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <tcgetattr@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1158 <io_get_attr+0x38>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <SePError@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_get_attr>:
push   %rbx
xor    %eax,%eax
call   1030 <tcgetattr@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    113c <io_get_attr+0x1c>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <SePError@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type opaque
@.str = [10 x i8] c"ioctl-get\00"
define i32 @io_get_attr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%6 = load i32, i32* %3
%7 = load %struct.termios*, %struct.termios** %4
%8 = call i32 (i32, %struct.termios*, ...) bitcast (i32 (...)* @tcgetattr to i32 (i32, %struct.termios*, ...)*)(i32 %6, %struct.termios* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @SePError to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.termios = type opaque
@.str = [10 x i8] c"ioctl-get\00"
define i32 @io_get_attr(i32 %0, %struct.termios* %1) {
%3 = tail call i32 (i32, %struct.termios*, ...) bitcast (i32 (...)* @tcgetattr to i32 (i32, %struct.termios*, ...)*)(i32 %0, %struct.termios* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @SePError to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
struct t_vehicle {
  int dummy;
};
struct t_creature {
  int dummy;
};

/* Variables and functions */
struct t_vehicle *getChaseVehicle(struct t_creature *e) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.t_vehicle = type { i32 }
%struct.t_creature = type { i32 }
define %struct.t_vehicle* @getChaseVehicle(%struct.t_creature* %0) {
%2 = alloca %struct.t_creature*
store %struct.t_creature* %0, %struct.t_creature** %2
ret %struct.t_vehicle* null
}

LLVM IR (-O2):
%struct.t_vehicle = type { i32 }
%struct.t_creature = type { i32 }
define noalias %struct.t_vehicle* @getChaseVehicle(%struct.t_creature* nocapture readnone %0) {
ret %struct.t_vehicle* null
}
void __attribute__((no)) HEX00_lexbaseInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_lexbaseInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ streamr250(char *, int);
void Pattern(char *cp, int cnt) { streamr250(cp, cnt); }


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

x86 assembly (clang, -O2):
<Pattern>:
jmp    1030 <streamr250@plt>

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

LLVM IR (-O2):
define void @Pattern(i8* %0, i32 %1) {
%3 = tail call i32 @streamr250(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
float sqrt(float);
float dist3d(float dx, float dy, float dz) {
  return sqrt(dx * dx + dy * dy + dz * dz);
}


x86 assembly (clang, -O0):
<dist3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist3d>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jb     1134 <dist3d+0x24>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
ret
movaps %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @dist3d(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = load float, float* %6
%14 = load float, float* %6
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
%16 = call float @sqrt(float %15)
ret float %16
}

LLVM IR (-O2):
define float @dist3d(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call float @sqrt(float %6)
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int UINT16_MAX;
int UINT8_MAX;
uint32_t mp_sizeof_strl(uint32_t len) {
  if (len <= 31) {
    return 1;
  } else if (len <= UINT8_MAX) {
    return 1 + sizeof(uint8_t);
  } else if (len <= UINT16_MAX) {
    return 1 + sizeof(uint16_t);
  } else {
    return 1 + sizeof(uint32_t);
  }
}


x86 assembly (clang, -O0):
<mp_sizeof_strl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jg     111d <mp_sizeof_strl+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1160 <mp_sizeof_strl+0x60>
mov    -0x8(%rbp),%eax
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%eax
jg     113b <mp_sizeof_strl+0x3b>
movl   $0x5,-0x4(%rbp)
jmp    1160 <mp_sizeof_strl+0x60>
mov    -0x8(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
jg     1159 <mp_sizeof_strl+0x59>
movl   $0x5,-0x4(%rbp)
jmp    1160 <mp_sizeof_strl+0x60>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_sizeof_strl>:
xor    %eax,%eax
cmp    $0x20,%edi
setge  %al
lea    0x1(,%rax,4),%eax
ret

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

LLVM IR (-O2):
@UINT8_MAX = global i32 0
@UINT16_MAX = global i32 0
define i32 @mp_sizeof_strl(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = select i1 %2, i32 1, i32 5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  int p;
  i = 1 + 9;
  j = 2 + 8;
  p = (i == j);
  assert(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fp;
  fp = fopen("test.txt", "w");
  if (fp != NULL) {
    fprintf(fp, "Testing...");
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <main+0x4a>
mov    -0x10(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     116d <main+0x3d>
mov    %rax,%rbx
lea    0xeb8(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [11 x i8] c"Testing...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [11 x i8] c"Testing...\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 10, i64 1, i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void noancopy(char *a, char *b) { strcpy(a, b); }


x86 assembly (clang, -O0):
<noancopy>:
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 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noancopy>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @noancopy(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ filter_set_acl(int);
int /*<<< orphan*/ mib_get(scalar_t__, void *);
int restart_acl(void) {
  unsigned char aclEnable;
  mib_get(0 + 70, (void *)&aclEnable);
  if (aclEnable == 1) {
    filter_set_acl(0);
    filter_set_acl(1);
  } else
    filter_set_acl(0);
  return 0;
}


x86 assembly (clang, -O0):
<restart_acl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x46,%edi
lea    -0x1(%rbp),%rsi
call   1040 <mib_get@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    1159 <restart_acl+0x39>
xor    %edi,%edi
call   1030 <filter_set_acl@plt>
mov    $0x1,%edi
call   1030 <filter_set_acl@plt>
jmp    1160 <restart_acl+0x40>
xor    %edi,%edi
call   1030 <filter_set_acl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restart_acl>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rsi
mov    $0x46,%edi
call   1040 <mib_get@plt>
mov    0xf(%rsp),%bl
xor    %edi,%edi
call   1030 <filter_set_acl@plt>
cmp    $0x1,%bl
jne    114e <restart_acl+0x2e>
mov    $0x1,%edi
call   1030 <filter_set_acl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @restart_acl() {
%1 = alloca i8
%2 = call i32 @mib_get(i64 70, i8* %1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @filter_set_acl(i32 0)
%8 = call i32 @filter_set_acl(i32 1)
br label %11
9: ; preds = %0
%10 = call i32 @filter_set_acl(i32 0)
br label %11
11: ; preds = %9, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @restart_acl() {
%1 = alloca i8
%2 = call i32 @mib_get(i64 70, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 1
%5 = call i32 @filter_set_acl(i32 0)
br i1 %4, label %6, label %8
6: ; preds = %0
%7 = call i32 @filter_set_acl(i32 1)
br label %8
8: ; preds = %0, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ task_deassert_flag(int, int);
void task_deassert_stopped(int id) { task_deassert_flag(id, (1 << 5)); }


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

x86 assembly (clang, -O2):
<task_deassert_stopped>:
mov    $0x20,%esi
jmp    1030 <task_deassert_flag@plt>

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

LLVM IR (-O2):
define void @task_deassert_stopped(i32 %0) {
%2 = tail call i32 @task_deassert_flag(i32 %0, i32 32)
ret void
}
/* Variables and functions */
int add_stuff(int, int, int);
int main(void) { return add_stuff(13, 14, 15); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0xd,%edi
mov    $0xe,%esi
mov    $0xf,%edx
jmp    1030 <add_stuff@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add_stuff(i32 13, i32 14, i32 15)
ret i32 %1
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t return_int32_0() { return -1073741825; }


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

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

LLVM IR (-O0):
define i32 @return_int32_0() {
ret i32 -1073741825
}

LLVM IR (-O2):
define i32 @return_int32_0() {
ret i32 -1073741825
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bits_clrb(uint8_t *vec, size_t size, uint8_t bit) {
  if (size <= (size_t)(bit >> 3))
    return -1;
  *(vec + (bit >> 3)) &= (uint8_t)(~(1 << (bit & 0x07)));
  return 1;
}


x86 assembly (clang, -O0):
<bits_clrb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
ja     1131 <bits_clrb+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <bits_clrb+0x5b>
mov    -0x1c(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_clrb>:
mov    %edx,%eax
sar    $0x3,%eax
movslq %eax,%r8
mov    $0xffffffff,%eax
cmp    %rsi,%r8
jae    1127 <bits_clrb+0x27>
and    $0x7,%dl
mov    $0xfffffffe,%eax
mov    %edx,%ecx
rol    %cl,%eax
and    %eax,(%rdi,%r8,4)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_clrb(i32* nocapture %0, i64 %1, i32 %2) {
%4 = ashr i32 %2, 3
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, %1
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = and i32 %2, 7
%9 = shl nuw nsw i32 1, %8
%10 = xor i32 %9, -1
%11 = getelementptr inbounds i32, i32* %0, i64 %5
%12 = load i32, i32* %11
%13 = and i32 %12, %10
store i32 %13, i32* %11
br label %14
14: ; preds = %3, %7
%15 = phi i32 [ 1, %7 ], [ -1, %3 ]
ret i32 %15
}
/* Type definitions */
struct timespec {
  long tv_sec;
  scalar_t__ tv_nsec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t timespec_to_ns(const struct timespec *ts) {
  return (ts->tv_sec * 1000000000L) + ts->tv_nsec;
}


x86 assembly (clang, -O0):
<timespec_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,(%rax),%rax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_ns>:
imul   $0x3b9aca00,(%rdi),%rax
add    0x8(%rdi),%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_ns(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_ns(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int trans_close_stream(void *id) {
  free(id);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @trans_close_stream(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
void print_tree(char *directory, int depth, char *preface) {}


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

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

LLVM IR (-O0):
define void @print_tree(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @print_tree(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int fs_read_uint8(int);
int skip_eol(int fd) {
  int d;
  do {
    d = fs_read_uint8(fd);
  } while (d >= 0 && d != 10);
  if (d >= 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<skip_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fs_read_uint8@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     113f <skip_eol+0x2f>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111b <skip_eol+0xb>
cmpl   $0x0,-0xc(%rbp)
jl     1160 <skip_eol+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <skip_eol+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_eol>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <fs_read_uint8@plt>
test   %eax,%eax
js     1130 <skip_eol+0x20>
cmp    $0xa,%eax
jne    1120 <skip_eol+0x10>
not    %eax
shr    $0x1f,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @skip_eol(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %3
%7 = call i32 @fs_read_uint8(i32 %6)
store i32 %7, i32* %4
br label %8
8: ; preds = %5
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br i1 %15, label %5, label %16
16: ; preds = %14
%17 = load i32, i32* %4
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 1, i32* %2
br label %21
20: ; preds = %16
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @skip_eol(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fs_read_uint8(i32 %0)
%4 = icmp sgt i32 %3, -1
%5 = icmp ne i32 %3, 10
%6 = and i1 %4, %5
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = xor i32 %3, -1
%9 = lshr i32 %8, 31
ret i32 %9
}
void foo450(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo450(i32 %0) {
ret void
}
void bsp_hw_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bsp_hw_init() {
ret void
}
void ASN1_PRINTABLE_new(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
uint16_t pbe16_to_h(void *v) {
  uint16_t u;
  memcpy(&u, v, sizeof(uint16_t));
  return be16toh(u);
}


x86 assembly (clang, -O0):
<pbe16_to_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <be16toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbe16_to_h>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <be16toh@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pbe16_to_h(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @be16toh(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pbe16_to_h(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @be16toh(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ tracecmd_free_list(char **);
void trace_util_free_plugin_options_list(char **list) {
  tracecmd_free_list(list);
}


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

x86 assembly (clang, -O2):
<trace_util_free_plugin_options_list>:
jmp    1030 <tracecmd_free_list@plt>

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

LLVM IR (-O2):
define void @trace_util_free_plugin_options_list(i8** %0) {
%2 = tail call i32 @tracecmd_free_list(i8** %0)
ret void
}
long wxy_to_index(int width, int x, int y) {
  return (long)x + ((long)y) * ((long)width);
}


x86 assembly (clang, -O0):
<wxy_to_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movslq -0x4(%rbp),%rdx
imul   %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wxy_to_index>:
movslq %esi,%rcx
movslq %edx,%rdx
movslq %edi,%rax
imul   %rdx,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @wxy_to_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = mul nsw i64 %10, %12
%14 = add nsw i64 %8, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @wxy_to_index(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = sext i32 %0 to i64
%7 = mul nsw i64 %5, %6
%8 = add nsw i64 %7, %4
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_lmatrix(long **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_lmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_lmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_lmatrix(i64** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64** %0, i64*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64**, i64*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds i64*, i64** %11, i64 %12
%14 = load i64*, i64** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds i64, i64* %14, i64 %15
%17 = getelementptr inbounds i64, i64* %16, i64 -1
%18 = bitcast i64* %17 to i8*
%19 = call i32 @free(i8* %18)
%20 = load i64**, i64*** %6
%21 = load i64, i64* %7
%22 = getelementptr inbounds i64*, i64** %20, i64 %21
%23 = getelementptr inbounds i64*, i64** %22, i64 -1
%24 = bitcast i64** %23 to i8*
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
define void @free_lmatrix(i64** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i64*, i64** %0, i64 %1
%7 = load i64*, i64** %6
%8 = getelementptr inbounds i64, i64* %7, i64 %3
%9 = getelementptr inbounds i64, i64* %8, i64 -1
%10 = bitcast i64* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds i64*, i64** %6, i64 -1
%13 = bitcast i64** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *dst, const char *src) {
  strcpy(dst + strlen(dst), src);
  return dst;
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ i2c_DisableStandardHSM(int);
void i2c1_DisableStandardHSM(void) { i2c_DisableStandardHSM(1); }


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

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

LLVM IR (-O0):
define void @i2c1_DisableStandardHSM() {
%1 = call i32 @i2c_DisableStandardHSM(i32 1)
ret void
}

LLVM IR (-O2):
define void @i2c1_DisableStandardHSM() {
%1 = tail call i32 @i2c_DisableStandardHSM(i32 1)
ret void
}
int set_bit(unsigned int nr, void *addr) {
  int mask, retval;
  unsigned char *ADDR = (unsigned char *)addr;
  ADDR += nr >> 3;
  mask = 1 << ((nr & 0x07));
  retval = mask & *ADDR;
  *ADDR |= mask;
  return retval;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%ecx
mov    %edi,%edx
shr    $0x3,%rdx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
movzbl (%rsi,%rdx,1),%edi
and    %edi,%eax
bts    %ecx,%edi
mov    %dil,(%rsi,%rdx,1)
ret

LLVM IR (-O0):
define i32 @set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i32, i32* %3
%10 = lshr i32 %9, 3
%11 = load i8*, i8** %7
%12 = zext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8* %13, i8** %7
%14 = load i32, i32* %3
%15 = and i32 %14, 7
%16 = shl i32 1, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %17, %20
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = load i8*, i8** %7
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @set_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = trunc i32 %7 to i8
%12 = or i8 %8, %11
store i8 %12, i8* %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void on_sigint(int signum) {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<on_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<on_sigint>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @on_sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @on_sigint(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_41uint32_reg(unsigned int val) {
  return ((val) & (0x41 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_41uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_41uint32_reg>:
test   $0x41,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_41uint32_reg(i32 %0) {
%2 = and i32 %0, 65
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int task(int task) { return task - 1; }


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

x86 assembly (clang, -O2):
<task>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @task(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Variables and functions */
double M_PI;
double sin(double);
double iterate(double x_n) { return (sin((0.7 * M_PI) / x_n)); }


x86 assembly (clang, -O0):
<iterate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mov    0x2ebc(%rip),%rax
mulsd  (%rax),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterate>:
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm1
mulsd  0xedd(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @iterate(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = fmul double 0x3FE6666666666666, %3
%5 = load double, double* %2
%6 = fdiv double %4, %5
%7 = call double @sin(double %6)
ret double %7
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @iterate(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, 0x3FE6666666666666
%4 = fdiv double %3, %0
%5 = tail call double @sin(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_10() { pic_send_EOI_normal(10); }


x86 assembly (clang, -O0):
<isr_irq_10>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <pic_send_EOI_normal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isr_irq_10>:
mov    $0xa,%edi
jmp    1030 <pic_send_EOI_normal@plt>

LLVM IR (-O0):
define void @isr_irq_10() {
%1 = call i32 @pic_send_EOI_normal(i32 10)
ret void
}

LLVM IR (-O2):
define void @isr_irq_10() {
%1 = tail call i32 @pic_send_EOI_normal(i32 10)
ret void
}
void INT_Excep_PERIB_INTB191(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB191() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void ft_putstr(char *str) { write(1, str, ft_strlen(str)); }


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ft_strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
char const *dcc_find_extension(char *);
const char *dcc_find_extension_const(const char *sfile) {
  char *sfile_nonconst = (char *)sfile;
  return dcc_find_extension(sfile_nonconst);
}


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

x86 assembly (clang, -O2):
<dcc_find_extension_const>:
jmp    1030 <dcc_find_extension@plt>

LLVM IR (-O0):
define i8* @dcc_find_extension_const(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @dcc_find_extension(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @dcc_find_extension_const(i8* %0) {
%2 = tail call i8* @dcc_find_extension(i8* %0)
ret i8* %2
}
void P(double a, double b, char *c, double d) { return; }


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @P(double %0, double %1, i8* %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i8*
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store i8* %2, i8** %7
store double %3, double* %8
ret void
}

LLVM IR (-O2):
define void @P(double %0, double %1, i8* nocapture %2, double %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inmidi_byte(int, int);
int libpd_midibyte(int port, int byte) {
  if (port < 0 || port > 0x0fff)
    return -1;
  if (byte < 0 || byte > 0xff)
    return -1;
  inmidi_byte(port, byte);
  return 0;
}


x86 assembly (clang, -O0):
<libpd_midibyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1135 <libpd_midibyte+0x25>
cmpl   $0xfff,-0x8(%rbp)
jle    1141 <libpd_midibyte+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <libpd_midibyte+0x66>
cmpl   $0x0,-0xc(%rbp)
jl     1158 <libpd_midibyte+0x48>
cmpl   $0xff,-0xc(%rbp)
jle    1164 <libpd_midibyte+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <libpd_midibyte+0x66>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <inmidi_byte@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libpd_midibyte>:
mov    $0xffffffff,%eax
cmp    $0xfff,%edi
ja     1131 <libpd_midibyte+0x21>
cmp    $0xff,%esi
ja     1131 <libpd_midibyte+0x21>
push   %rax
call   1030 <inmidi_byte@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @libpd_midibyte(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, 4095
%4 = icmp ugt i32 %1, 255
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @inmidi_byte(i32 %0, i32 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
bool less_msb(int x, int y) { return x < y && x < (x ^ y); }


x86 assembly (clang, -O0):
<less_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jge    112c <less_msb+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<less_msb>:
cmp    %esi,%edi
setl   %al
xor    %edi,%esi
cmp    %edi,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @less_msb(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
%13 = icmp slt i32 %9, %12
br label %14
14: ; preds = %8, %2
%15 = phi i1 [ false, %2 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @less_msb(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = xor i32 %1, %0
%5 = icmp sgt i32 %4, %0
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t ntoh16(uint16_t n) { return ntohs(n); }


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

x86 assembly (clang, -O2):
<ntoh16>:
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @ntoh16(i32 %0) {
%2 = tail call i32 @ntohs(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __SLEEP(int);
double omp_get_wtime();
void AIBV_plant_IMPL() {
  while (1) {
    double internalPeriodicStartTime = omp_get_wtime();
    double internalTimeDifference;
    internalTimeDifference = omp_get_wtime() - internalPeriodicStartTime;
    __SLEEP(500 - (internalTimeDifference * 1000));
  }
}


x86 assembly (clang, -O0):
<AIBV_plant_IMPL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <omp_get_wtime@plt>
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
mov    %rax,-0x28(%rbp)
movq   %rax,%xmm0
movsd  0xe8e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe85(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si %xmm0,%edi
call   1030 <__SLEEP@plt>
jmp    1128 <AIBV_plant_IMPL+0x8>

x86 assembly (clang, -O2):
<AIBV_plant_IMPL>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <omp_get_wtime@plt>
subsd  (%rsp),%xmm0
mulsd  0xeb0(%rip),%xmm0
addsd  0xeb0(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <__SLEEP@plt>
jmp    1130 <AIBV_plant_IMPL+0x10>

LLVM IR (-O0):
define void @AIBV_plant_IMPL() {
%1 = alloca double
%2 = alloca double
br label %3
3: ; preds = %0, %3
%4 = call double (...) @omp_get_wtime()
store double %4, double* %1
%5 = call double (...) @omp_get_wtime()
%6 = load double, double* %1
%7 = fsub double %5, %6
store double %7, double* %2
%8 = load double, double* %2
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e+03, double 5.000000e+02)
%11 = fptosi double %10 to i32
%12 = call i32 @__SLEEP(i32 %11)
br label %3
}

LLVM IR (-O2):
define void @AIBV_plant_IMPL() {
br label %1
1: ; preds = %0, %1
%2 = tail call double (...) @omp_get_wtime()
%3 = tail call double (...) @omp_get_wtime()
%4 = fsub double %3, %2
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e+03, double 5.000000e+02)
%7 = fptosi double %6 to i32
%8 = tail call i32 @__SLEEP(i32 %7)
br label %1
}
/* Variables and functions */
int recurse2b(int);
int recurse2a(int i) { return recurse2b(i + 1); }


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

x86 assembly (clang, -O2):
<recurse2a>:
add    $0x1,%edi
jmp    1030 <recurse2b@plt>

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

LLVM IR (-O2):
define i32 @recurse2a(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @recurse2b(i32 %2)
ret i32 %3
}