xunge/DecIR huggingface dataset:
int main(void) {
  int x = 1;
  int a[++x];
  if (x != 2)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     114b <main+0x3b>
call   1030 <abort@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @walk_path()
%2 = tail call i32 (...) @print_path()
ret i32 0
}
cmd_unset(var) char *var;
{ unset_variable(var); }


x86 assembly (clang, -O0):
<cmd_unset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <unset_variable@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmd_unset(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @unset_variable to i32 (i8*, ...)*)(i8* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @cmd_unset(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unset_variable to i32 (i8*, ...)*)(i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
int /*<<< orphan*/ nrt_debug_print(char *, void *, void *);
void nrt_internal_dtor_safe(void *ptr, size_t size, void *info) {
  if (0) {
    nrt_debug_print("nrt_internal_dtor_safe %p, %p\n", ptr, info);
  };
  memset(ptr, 0xDE, ((size) < (256)) ? (size) : (256));
}


x86 assembly (clang, -O0):
<nrt_internal_dtor_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x100,-0x10(%rbp)
jae    1147 <nrt_internal_dtor_safe+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1155 <nrt_internal_dtor_safe+0x45>
mov    $0x100,%eax
mov    %rax,-0x28(%rbp)
jmp    1155 <nrt_internal_dtor_safe+0x45>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0xde,%esi
call   1030 <memset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrt_internal_dtor_safe>:
cmp    $0x100,%rsi
mov    $0x100,%edx
cmovb  %rsi,%rdx
mov    $0xde,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @nrt_internal_dtor_safe(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = icmp ult i64 %8, 256
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %13
12: ; preds = %3
br label %13
13: ; preds = %12, %10
%14 = phi i64 [ %11, %10 ], [ 256, %12 ]
%15 = call i32 @memset(i8* %7, i32 222, i64 %14)
ret void
}

LLVM IR (-O2):
define void @nrt_internal_dtor_safe(i8* %0, i64 %1, i8* nocapture readnone %2) {
%4 = icmp ult i64 %1, 256
%5 = select i1 %4, i64 %1, i64 256
%6 = tail call i32 @memset(i8* %0, i32 222, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(int /*<<< orphan*/);
void printa(char *msg[]) {
  while (*msg)
    puts(*msg++);
}


x86 assembly (clang, -O0):
<printa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1148 <printa+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <puts@plt>
jmp    111c <printa+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printa>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <printa+0x21>
add    $0x8,%rbx
call   1030 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <printa+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printa(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = ptrtoint i8* %5 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @puts(i32 %9)
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int current_month();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int month = current_month();
  printf("current month: %d\n", month);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <current_month@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <current_month@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"current month: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @current_month()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"current month: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @current_month()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err_quit(char *);
scalar_t__ writen(int, char *, int);
void Writen(int fd, char *str, int len) {
  if (writen(fd, str, len) < 0)
    err_quit("writen");
}


x86 assembly (clang, -O0):
<Writen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <writen@plt>
cmp    $0x0,%rax
jge    1157 <Writen+0x37>
lea    0xeae(%rip),%rdi
call   1030 <err_quit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Writen>:
push   %rax
call   1040 <writen@plt>
test   %rax,%rax
js     112d <Writen+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_quit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"writen\00"
define void @Writen(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i64 @writen(i32 %7, i8* %8, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @err_quit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"writen\00"
define void @Writen(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @writen(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_quit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned char);
bool timer(bool s, unsigned char sec) {
  sleep(sec);
  return s;
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edi
call   1030 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @timer(i32 returned %0, i8 zeroext %1) {
%3 = tail call i32 @sleep(i8 zeroext %1)
ret i32 %0
}
/* Variables and functions */
int getopt_internal(int, char *const *, char const *, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ *, int /*<<< orphan*/);
int getopt(int argc, char *const argv[], const char *optstring) {
  return getopt_internal(argc, argv, optstring, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <getopt_internal@plt>

LLVM IR (-O0):
define i32 @getopt(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 i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @getopt_internal(i32 %7, i8** %8, i8* %9, i32* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, i32* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *mfsrealloc(void *ptr, size_t size) {
  void *pptr = realloc(ptr, size);
  if (pptr == NULL) {
    free(ptr);
  }
  return pptr;
}


x86 assembly (clang, -O0):
<mfsrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <mfsrealloc+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfsrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <mfsrealloc+0x1c>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @mfsrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int test_imm_01int8_mem(signed char *val) {
  return ((*val) & (-0x01 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_01int8_mem>:
cmpb   $0x0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_01int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_AEuint8_mem(unsigned char *val) {
  return ((*val) & (-0xAE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AEuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 82
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct tftphdr {
  int dummy;
};

/* Variables and functions */
struct tftphdr *rw_init(int);
struct tftphdr *r_init(void) {
  return rw_init(1);
}


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

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

LLVM IR (-O0):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @r_init() {
%1 = call %struct.tftphdr* @rw_init(i32 1)
ret %struct.tftphdr* %1
}

LLVM IR (-O2):
%struct.tftphdr = type { i32 }
define %struct.tftphdr* @r_init() {
%1 = tail call %struct.tftphdr* @rw_init(i32 1)
ret %struct.tftphdr* %1
}
/* Variables and functions */
double atan(double);
double math__Float__atan(double self) {
  double var;
  double var1;
  var1 = atan(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<math__Float__atan>:
jmp    1030 <atan@plt>

LLVM IR (-O0):
define double @math__Float__atan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @atan(double %5)
store double %6, double* %4
%7 = load double, double* %4
store double %7, double* %3
br label %8
8: ; preds = %1
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @math__Float__atan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128Timer3P__CompareA__default__fired();
void HplAtm128Timer3P__CompareA__fired(void) {
  HplAtm128Timer3P__CompareA__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128Timer3P__CompareA__fired() {
%1 = tail call i32 (...) @HplAtm128Timer3P__CompareA__default__fired()
ret void
}
double ighmm_rand_get_xstepphi() { return 0.001; }


x86 assembly (clang, -O0):
<ighmm_rand_get_xstepphi>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ighmm_rand_get_xstepphi>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ighmm_rand_get_xstepphi() {
ret double 1.000000e-03
}

LLVM IR (-O2):
define double @ighmm_rand_get_xstepphi() {
ret double 1.000000e-03
}
unsigned char reverse_byte(unsigned char _x) {
  unsigned char y = 0x00;
  unsigned int i;
  for (i = 0; i < 8; i++) {
    y <<= 1;
    y |= _x & 1;
    _x >>= 1;
  }
  return y;
}


x86 assembly (clang, -O0):
<reverse_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jae    1151 <reverse_byte+0x51>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x1,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <reverse_byte+0x15>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_byte>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @reverse_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %2
store i8 0, i8* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %4
%7 = icmp ult i32 %6, 8
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = and i32 %14, 1
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = or i32 %17, %15
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = ashr i32 %21, 1
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
br label %24
24: ; preds = %8
%25 = load i32, i32* %4
%26 = add i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i8, i8* %3
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @reverse_byte(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
__attribute__((visibility("default"))) double
swps3_factorFromThreshold(double threshold, double singleGapCost) {
  (void)singleGapCost;
  return 256.0 / threshold;
}


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

x86 assembly (clang, -O2):
<swps3_factorFromThreshold>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @swps3_factorFromThreshold(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fdiv double 2.560000e+02, %6
ret double %7
}

LLVM IR (-O2):
define double @swps3_factorFromThreshold(double %0, double %1) {
%3 = fdiv double 2.560000e+02, %0
ret double %3
}
float wave_square(float i) { return i < 0.5f ? -1.0f : 1.0f; }


x86 assembly (clang, -O0):
<wave_square>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
movss  0xee2(%rip),%xmm1
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_square>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
lea    0xeed(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @wave_square(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 5.000000e-01
%5 = zext i1 %4 to i64
%6 = select i1 %4, float -1.000000e+00, float 1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @wave_square(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
%3 = select i1 %2, float -1.000000e+00, float 1.000000e+00
ret float %3
}
/* Variables and functions */
double EvalAngCor_alpha0_2plus_0plus_11520_L2(double);
double funcAngCor_alpha0_2plus_0plus_11520_L2(double *x, double *par) {
  double result;
  result = par[0] * EvalAngCor_alpha0_2plus_0plus_11520_L2(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngCor_alpha0_2plus_0plus_11520_L2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngCor_alpha0_2plus_0plus_11520_L2@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngCor_alpha0_2plus_0plus_11520_L2>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngCor_alpha0_2plus_0plus_11520_L2@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngCor_alpha0_2plus_0plus_11520_L2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngCor_alpha0_2plus_0plus_11520_L2(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngCor_alpha0_2plus_0plus_11520_L2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngCor_alpha0_2plus_0plus_11520_L2(double %4)
%6 = fmul double %3, %5
ret double %6
}
void rt2x00crypto_tx_remove_iv(struct sk_buff *skb,
                               struct txentry_desc *txdesc) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.sk_buff = type opaque
%struct.txentry_desc = type opaque
define void @rt2x00crypto_tx_remove_iv(%struct.sk_buff* %0, %struct.txentry_desc* %1) {
%3 = alloca %struct.sk_buff*
%4 = alloca %struct.txentry_desc*
store %struct.sk_buff* %0, %struct.sk_buff** %3
store %struct.txentry_desc* %1, %struct.txentry_desc** %4
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
%struct.txentry_desc = type opaque
define void @rt2x00crypto_tx_remove_iv(%struct.sk_buff* nocapture %0, %struct.txentry_desc* nocapture %1) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *xxmalloc(size_t size) { return (malloc(size)); }


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

x86 assembly (clang, -O2):
<xxmalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xxmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ mtainted(char *);
int /*<<< orphan*/ system(int /*<<< orphan*/);
void test(char *s) { (void)system(mtainted(s)); }


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

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

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

LLVM IR (-O2):
define void @test(i8* %0) {
%2 = tail call i32 @mtainted(i8* %0)
%3 = tail call i32 @system(i32 %2)
ret void
}
/* Variables and functions */
void ptr_glXWaitGL();
extern void glXWaitGL(void) { return ptr_glXWaitGL(); }


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

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

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

LLVM IR (-O2):
define void @glXWaitGL() {
tail call void (...) @ptr_glXWaitGL()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("\n\rThis utility is used to prefix a header to the patch code!\n\r");
  printf("For loading into the bootcode and the integrity crc header!\n\r");
  printf("    - patch_hdr [patch binary] [load address]\n\r");
  printf("\n\r   e.g. patch_hdr patch.bin 0x8e0000\n\r");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf71(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"\0A\0DThis utility is used to prefix a header to the patch code!\0A\0D\00"
@.str.1 = [62 x i8] c"For loading into the bootcode and the integrity crc header!\0A\0D\00"
@.str.2 = [48 x i8] c" - patch_hdr [patch binary] [load address]\0A\0D\00"
@.str.3 = [41 x i8] c"\0A\0D e.g. patch_hdr patch.bin 0x8e0000\0A\0D\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"\0A\0DThis utility is used to prefix a header to the patch code!\0A\0D\00"
@.str.1 = [62 x i8] c"For loading into the bootcode and the integrity crc header!\0A\0D\00"
@.str.2 = [48 x i8] c" - patch_hdr [patch binary] [load address]\0A\0D\00"
@.str.3 = [41 x i8] c"\0A\0D e.g. patch_hdr patch.bin 0x8e0000\0A\0D\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int ligneVide(char *str) {
  if (str[0] == '\n' || str[0] == '\r') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ligneVide>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1128 <ligneVide+0x28>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1134 <ligneVide+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <ligneVide+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ligneVide>:
mov    (%rdi),%al
cmp    $0xa,%al
sete   %cl
cmp    $0xd,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @ligneVide(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
%4 = icmp eq i8 %2, 13
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "error: fatal: out of memory: %s\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119e <xmalloc+0x5e>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe75(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     114d <xmalloc+0xd>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"error: fatal: out of memory: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* @errno
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"error: fatal: out of memory: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int ds1621_write_value(int, int, int);
int swap16(int);
int ds1621_set_TH(int dev_fd, float temp) {
  int reg;
  int rc;
  reg = (int)temp;
  reg = swap16(reg);
  rc = ds1621_write_value(dev_fd, 0xA1, reg);
  return (rc);
}


x86 assembly (clang, -O0):
<ds1621_set_TH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <swap16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xa1,%esi
call   1040 <ds1621_write_value@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1621_set_TH>:
push   %rbx
mov    %edi,%ebx
cvttss2si %xmm0,%edi
call   1030 <swap16@plt>
mov    %ebx,%edi
mov    $0xa1,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <ds1621_write_value@plt>

LLVM IR (-O0):
define i32 @ds1621_set_TH(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fptosi float %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @swap16(i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = call i32 @ds1621_write_value(i32 %11, i32 161, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @ds1621_set_TH(i32 %0, float %1) {
%3 = fptosi float %1 to i32
%4 = tail call i32 @swap16(i32 %3)
%5 = tail call i32 @ds1621_write_value(i32 %0, i32 161, i32 %4)
ret i32 %5
}
int f() {
  int ret;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ dst;

/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void memset_bad3() {
  int arr[1];
  int *dst = &arr[0];
  memset(dst, 0, sizeof(dst));
}


x86 assembly (clang, -O0):
<memset_bad3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_bad3>:
push   %rax
lea    0x4(%rsp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @memset_bad3() {
%1 = alloca [1 x i32]
%2 = alloca i32*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @memset(i32* %4, i32 0, i32 8)
ret void
}

LLVM IR (-O2):
define void @memset_bad3() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(int *x) { printf("%d\n", x[3]); }


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

x86 assembly (clang, -O2):
<foo>:
mov    0xc(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @foo(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort_safe_block();
int sched_yield();
int /*<<< orphan*/ tap_error_errno_at(char *, int, char *, int);
int safe_sched_yield() {
  int err = sched_yield();
  if (err) {
    tap_error_errno_at(("sched_yield()"), (err),
                       "/scratch/repos/new/home/jordi_armengol_estape/"
                       "c-scraper/outputs/2022-01-22/02-19-57/repos/picotm/"
                       "picotm/refs/heads/master/tests/libsafeblk/safe_sched.c",
                       30);
    abort_safe_block();
  }
  return err;
}


x86 assembly (clang, -O0):
<safe_sched_yield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <sched_yield@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116e <safe_sched_yield+0x3e>
mov    -0x4(%rbp),%esi
lea    0xeaa(%rip),%rdi
lea    0xeb1(%rip),%rdx
mov    $0x1e,%ecx
call   1040 <tap_error_errno_at@plt>
mov    $0x0,%al
call   1030 <abort_safe_block@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_sched_yield>:
push   %rbx
xor    %eax,%eax
call   1050 <sched_yield@plt>
mov    %eax,%ebx
test   %eax,%eax
je     115f <safe_sched_yield+0x2f>
lea    0xebb(%rip),%rdi
lea    0xec2(%rip),%rdx
mov    %ebx,%esi
mov    $0x1e,%ecx
call   1040 <tap_error_errno_at@plt>
xor    %eax,%eax
call   1030 <abort_safe_block@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"sched_yield()\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/picotm/picotm/refs/heads/master/tests/libsafeblk/safe_sched.c\00"
define i32 @safe_sched_yield() {
%1 = alloca i32
%2 = call i32 (...) @sched_yield()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @tap_error_errno_at(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 30)
%8 = call i32 (...) @abort_safe_block()
br label %9
9: ; preds = %5, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"sched_yield()\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/picotm/picotm/refs/heads/master/tests/libsafeblk/safe_sched.c\00"
define i32 @safe_sched_yield() {
%1 = tail call i32 (...) @sched_yield()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @tap_error_errno_at(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 30)
%5 = tail call i32 (...) @abort_safe_block()
br label %6
6: ; preds = %3, %0
ret i32 %1
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int /*<<< orphan*/ getresuid(int *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  uid_t rid;
  uid_t eid;
  uid_t sid;
  getresuid(&rid, &eid, &sid);
  printf("%d %d %d\n", rid, eid, sid);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <getresuid@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @getresuid(i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}
int test_imm_22uint16_reg(unsigned short val) {
  return ((val) & (0x22 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_22uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x22,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_22uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 34
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stderr;
int vfprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int er_default_vprintf(char *format, va_list ap) {
  return vfprintf(stderr, format, ap);
}


x86 assembly (clang, -O0):
<er_default_vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<er_default_vprintf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define i32 @er_default_vprintf(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
float ANTweenTimingFunctionSineIn(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionSineIn(float time, float duration) {
  return ANTweenTimingFunctionSineIn(time, 0, 1, duration);
}


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

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

LLVM IR (-O0):
define float @ANTweenProgressTimingFunctionSineIn(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 = call float @ANTweenTimingFunctionSineIn(float %5, i32 0, i32 1, float %6)
ret float %7
}

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionSineIn(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionSineIn(float %0, i32 0, i32 1, float %1)
ret float %3
}
/* Variables and functions */
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int plinth_stdin_getc() { return fgetc(stdin); }


x86 assembly (clang, -O0):
<plinth_stdin_getc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<plinth_stdin_getc>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @plinth_stdin_getc() {
%1 = load i32, i32* @stdin
%2 = call i32 @fgetc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @plinth_stdin_getc() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fgetc(i32 %1)
ret i32 %2
}
double tanh_func(x)
double x;
{ return 1.0 - (1.0 / 15.0) * x * x + (2.0 / 315.0) * x * x * x * x; }


x86 assembly (clang, -O0):
<tanh_func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @tanh_func(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x3FB1111111111111, %3
%5 = load double, double* %2
%6 = fneg double %4
%7 = call double @llvm.fmuladd.f64(double %6, double %5, double 1.000000e+00)
%8 = load double, double* %2
%9 = fmul double 0x3F7A01A01A01A01A, %8
%10 = load double, double* %2
%11 = fmul double %9, %10
%12 = load double, double* %2
%13 = fmul double %11, %12
%14 = load double, double* %2
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double %7)
ret double %15
}

LLVM IR (-O2):
define double @tanh_func(double %0) {
%2 = fmul double %0, 0xBFB1111111111111
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fmul double %0, 0x3F7A01A01A01A01A
%5 = fmul double %4, %0
%6 = fmul double %5, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %3)
ret double %7
}