xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LC_NUMERIC;
double atof(char const *);
char *setlocale(int /*<<< orphan*/, char const *);
double atof_nol(const char *nptr) {
  double res;
  const char *locale = setlocale(LC_NUMERIC, "C");
  res = atof(nptr);
  setlocale(LC_NUMERIC, locale);
  return res;
}


x86 assembly (clang, -O0):
<atof_nol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <setlocale@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1040 <setlocale@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atof_nol>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    0x2eb5(%rip),%r15
mov    (%r15),%edi
lea    0xec3(%rip),%rsi
call   1040 <setlocale@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    (%r15),%edi
mov    %rbx,%rsi
call   1040 <setlocale@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@LC_NUMERIC = global i32 0
@.str = [2 x i8] c"C\00"
define double @atof_nol(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i32, i32* @LC_NUMERIC
%6 = call i8* @setlocale(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %2
%8 = call double @atof(i8* %7)
store double %8, double* %3
%9 = load i32, i32* @LC_NUMERIC
%10 = load i8*, i8** %4
%11 = call i8* @setlocale(i32 %9, i8* %10)
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
@LC_NUMERIC = global i32 0
@.str = [2 x i8] c"C\00"
define double @atof_nol(i8* nocapture %0) {
%2 = load i32, i32* @LC_NUMERIC
%3 = tail call i8* @setlocale(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call double @atof(i8* %0)
%5 = load i32, i32* @LC_NUMERIC
%6 = tail call i8* @setlocale(i32 %5, i8* %3)
ret double %4
}
int check_val_ATTRint(int v) { return v; }


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

x86 assembly (clang, -O2):
<check_val_ATTRint>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @check_val_ATTRint(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int lin_rsk_create();
int init_raw_socket() { return lin_rsk_create(); }


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

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

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

LLVM IR (-O2):
define i32 @init_raw_socket() {
%1 = tail call i32 (...) @lin_rsk_create()
ret i32 %1
}
int setregid(int rgid, int egid) {}


x86 assembly (clang, -O0):
<setregid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setregid(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @setregid(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
void clearArgs(char *args[]) {
  int i;
  for (i = 0; i < 10; i++) {
    args[i] = NULL;
  }
}


x86 assembly (clang, -O0):
<clearArgs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1137 <clearArgs+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clearArgs+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearArgs>:
xorps  %xmm0,%xmm0
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clearArgs(i8** nocapture writeonly %0) {
%2 = bitcast i8** %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(char **);
int main(int argc, char *argv[]) {
  func(argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @func(i8** %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52_set_bsid(uint8_t *p_a52, uint8_t i_bsid) {
  p_a52[5] &= ~0xf8;
  p_a52[5] |= (i_bsid & 0xf8) << 3;
}


x86 assembly (clang, -O0):
<a52_set_bsid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
and    $0xffffff07,%ecx
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
and    $0xf8,%ecx
shl    $0x3,%ecx
mov    -0x8(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_set_bsid>:
mov    $0xffffff07,%eax
and    0x14(%rdi),%eax
shl    $0x3,%esi
and    $0x7c0,%esi
or     %eax,%esi
mov    %esi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @a52_set_bsid(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 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
%8 = and i32 %7, -249
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 248
%11 = shl i32 %10, 3
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 5
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @a52_set_bsid(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
%4 = load i32, i32* %3
%5 = and i32 %4, -249
%6 = shl i32 %1, 3
%7 = and i32 %6, 1984
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int *);
void c_exit_thread() {
  int ret1 = 100;
  pthread_exit(&ret1);
}


x86 assembly (clang, -O0):
<c_exit_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_exit_thread>:
push   %rax
movl   $0x64,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <pthread_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @c_exit_thread() {
%1 = alloca i32
store i32 100, i32* %1
%2 = call i32 @pthread_exit(i32* %1)
ret void
}

LLVM IR (-O2):
define void @c_exit_thread() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%3 = call i32 @pthread_exit(i32* %1)
ret void
}
/* Variables and functions */
int get_response(char *);
int /*<<< orphan*/ set_cr_noecho_mode();
int /*<<< orphan*/ tty_mode(int);
int main(int argc, char *argv[]) {
  int res;
  tty_mode(0);
  set_cr_noecho_mode();
  res = get_response("Do you want another transaction");
  tty_mode(1);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1050 <tty_mode@plt>
mov    $0x0,%al
call   1040 <set_cr_noecho_mode@plt>
lea    0xea5(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1050 <tty_mode@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1050 <tty_mode@plt>
xor    %eax,%eax
call   1040 <set_cr_noecho_mode@plt>
lea    0xeba(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1050 <tty_mode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @tty_mode(i32 0)
%8 = call i32 (...) @set_cr_noecho_mode()
%9 = call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %6
%10 = call i32 @tty_mode(i32 1)
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @tty_mode(i32 0)
%4 = tail call i32 (...) @set_cr_noecho_mode()
%5 = tail call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @tty_mode(i32 1)
ret i32 %5
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ test();
int main(int argc, char **argv) {
  if (test())
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test@plt>
cmp    $0x0,%rax
je     1148 <main+0x38>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <main+0x44>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test@plt>
test   %rax,%rax
jne    1126 <main+0x16>
mov    0x2eb4(%rip),%rax
jmp    112d <main+0x1d>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @test()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @EXIT_FAILURE
store i32 %9, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* @EXIT_SUCCESS
store i32 %11, i32* %3
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @test()
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* @EXIT_SUCCESS
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int minPathSum(int **, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int m[2][2] = {
      {1, 2},
      {1, 1},
  };
  printf("%d\n", minPathSum((int **)m, 2, 2));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1040 <minPathSum@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1040 <minPathSum@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.m = [2 x [2 x i32]] [[2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 1]]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [2 x [2 x i32]]
%2 = bitcast [2 x [2 x i32]]* %1 to i8*
%3 = bitcast [2 x [2 x i32]]* %1 to i32**
%4 = call i32 @minPathSum(i32** %3, i32 2, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_network_link_get_dns(int ifindex, char ***ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_link_get_dns>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_link_get_dns>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_link_get_dns(i32 %0, i8*** %1) {
%3 = alloca i32
%4 = alloca i8***
store i32 %0, i32* %3
store i8*** %1, i8**** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_link_get_dns(i32 %0, i8*** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int f33(int *);
int f34(int *p) { return f33(p); }


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

x86 assembly (clang, -O2):
<f34>:
jmp    1030 <f33@plt>

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

LLVM IR (-O2):
define i32 @f34(i32* %0) {
%2 = tail call i32 @f33(i32* %0)
ret i32 %2
}
int foo(int b, int j) {
  if (b) {
    int i;
    for (i = 0; i < 1000; ++i)
      ;
    j = 0;
  }
  return j;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <foo+0x42>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    113b <foo+0x3b>
jmp    112d <foo+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <foo+0x1b>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
store i32 0, i32* %5
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 1000
br i1 %11, label %12, label %16
12: ; preds = %9
br label %13
13: ; preds = %12
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %9
16: ; preds = %9
store i32 0, i32* %4
br label %17
17: ; preds = %16, %2
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 0
ret i32 %4
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void uDMAControlBaseSet(void *psControlTable) {

  ;
  ;
  (*((volatile unsigned long *)(0x400FF008))) = (uint32_t)psControlTable;
}


x86 assembly (clang, -O0):
<uDMAControlBaseSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400ff008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAControlBaseSet>:
mov    %rdi,0x400ff008
40
ret

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

LLVM IR (-O2):
define void @uDMAControlBaseSet(i8* %0) {
%2 = ptrtoint i8* %0 to i64
store volatile i64 %2, i64* inttoptr (i64 1074786312 to i64*)
ret void
}
/* Variables and functions */
void *needLargeZeroedMemResize(void *, size_t, size_t);
void *needMoreMem(void *old, size_t oldSize, size_t newSize) {
  return needLargeZeroedMemResize(old, oldSize, newSize);
}


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

x86 assembly (clang, -O2):
<needMoreMem>:
jmp    1030 <needLargeZeroedMemResize@plt>

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

LLVM IR (-O2):
define i8* @needMoreMem(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @needLargeZeroedMemResize(i8* %0, i64 %1, i64 %2)
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xbutton_x(void *_p) { return (int)((XEvent *)_p)->xbutton.x; }


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

x86 assembly (clang, -O2):
<get_XEvent_xbutton_x>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xbutton_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xbutton_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(const char *s, int fd) {
  if (!s)
    write(fd, "(null)", 6);
  else
    write(fd, s, ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <ft_putstr_fd+0x33>
mov    -0xc(%rbp),%edi
lea    0xebc(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
jmp    1178 <ft_putstr_fd+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %rdi,%rdi
je     113b <ft_putstr_fd+0x1b>
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
jmp    1149 <ft_putstr_fd+0x29>
lea    0xebe(%rip),%rsi
mov    %ebp,%edi
mov    $0x6,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
define void @ft_putstr_fd(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 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 @write(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i32 @ft_strlen(i8* %13)
%15 = call i32 @write(i32 %11, i8* %12, i32 %14)
br label %16
16: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %9
6: ; preds = %2
%7 = tail call i32 @ft_strlen(i8* %0)
%8 = tail call i32 @write(i32 %1, i8* %0, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
int my_isnan(double x) { return x != x; }


x86 assembly (clang, -O0):
<my_isnan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isnan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @my_isnan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @my_isnan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void TXC2_interrupt_event(void) {}


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

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

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

LLVM IR (-O2):
define void @TXC2_interrupt_event() {
ret void
}
unsigned long __maxindex(unsigned int height) {
  unsigned int tmp = height * 6;
  unsigned long index = (~0UL >> ((8 * sizeof(unsigned long)) - tmp - 1)) >> 1;
  if (tmp >= (8 * sizeof(unsigned long)))
    index = ~0UL;
  return index;
}


x86 assembly (clang, -O0):
<__maxindex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x6,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x40,%ecx
sub    %rax,%rcx
sub    $0x1,%rcx
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x40,%rax
jb     1144 <__maxindex+0x44>
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__maxindex>:
add    %edi,%edi
lea    (%rdi,%rdi,2),%edx
mov    $0x3f,%cl
sub    %dl,%cl
mov    $0xffffffffffffffff,%rsi
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
shr    %rax
cmp    $0x40,%edx
cmovae %rsi,%rax
ret

LLVM IR (-O0):
define i64 @__maxindex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = mul i32 %5, 6
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = sub i64 64, %8
%10 = sub i64 %9, 1
%11 = lshr i64 -1, %10
%12 = lshr i64 %11, 1
store i64 %12, i64* %4
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = icmp uge i64 %14, 64
br i1 %15, label %16, label %17
16: ; preds = %1
store i64 -1, i64* %4
br label %17
17: ; preds = %16, %1
%18 = load i64, i64* %4
ret i64 %18
}

LLVM IR (-O2):
define i64 @__maxindex(i32 %0) {
%2 = mul i32 %0, 6
%3 = zext i32 %2 to i64
%4 = sub nsw i64 63, %3
%5 = lshr i64 -1, %4
%6 = lshr i64 %5, 1
%7 = icmp ugt i32 %2, 63
%8 = select i1 %7, i64 -1, i64 %6
ret i64 %8
}
/* Type definitions */
struct timespec {
  double tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
double cd_os_timespec_double(const struct timespec *src) {
  return src->tv_sec + ((double)(src->tv_nsec)) / 1000000000.0;
}


x86 assembly (clang, -O0):
<cd_os_timespec_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm1
movsd  0xede(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_os_timespec_double>:
cvtsi2sdq 0x8(%rdi),%xmm0
divsd  0xef2(%rip),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
define double @cd_os_timespec_double(%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 double, double* %4
%6 = load %struct.timespec*, %struct.timespec** %2
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+09
%11 = fadd double %5, %10
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { double, i64 }
define double @cd_os_timespec_double(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = fdiv double %6, 1.000000e+09
%8 = fadd double %3, %7
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *fs_open(const char *path, const char *flags) {
  return fopen(path, flags);
}


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

x86 assembly (clang, -O2):
<fs_open>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i32* @fs_open(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* @fopen(i8* %5, i8* %6)
ret i32* %7
}

LLVM IR (-O2):
define noalias i32* @fs_open(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_bezier3(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 float);
__attribute__((always_)) struct vec3i *
psvec3i_bezier3(struct vec3i *result, struct vec3i *a, struct vec3i *b,
                struct vec3i *c, float p) {
  vec3i_bezier3((int32_t *)result, (int32_t *)a, (int32_t *)b, (int32_t *)c, p);
  return result;
}


x86 assembly (clang, -O0):
<psvec3i_bezier3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movss  -0x24(%rbp),%xmm0
call   1030 <vec3i_bezier3@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3i_bezier3>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3i_bezier3@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_bezier3(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2, %struct.vec3i* %3, float %4) {
%6 = alloca %struct.vec3i*
%7 = alloca %struct.vec3i*
%8 = alloca %struct.vec3i*
%9 = alloca %struct.vec3i*
%10 = alloca float
store %struct.vec3i* %0, %struct.vec3i** %6
store %struct.vec3i* %1, %struct.vec3i** %7
store %struct.vec3i* %2, %struct.vec3i** %8
store %struct.vec3i* %3, %struct.vec3i** %9
store float %4, float* %10
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = load %struct.vec3i*, %struct.vec3i** %7
%14 = bitcast %struct.vec3i* %13 to i32*
%15 = load %struct.vec3i*, %struct.vec3i** %8
%16 = bitcast %struct.vec3i* %15 to i32*
%17 = load %struct.vec3i*, %struct.vec3i** %9
%18 = bitcast %struct.vec3i* %17 to i32*
%19 = load float, float* %10
%20 = call i32 @vec3i_bezier3(i32* %12, i32* %14, i32* %16, i32* %18, float %19)
%21 = load %struct.vec3i*, %struct.vec3i** %6
ret %struct.vec3i* %21
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_bezier3(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2, %struct.vec3i* %3, float %4) {
%6 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%7 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%8 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%9 = getelementptr %struct.vec3i, %struct.vec3i* %3, i64 0, i32 0
%10 = tail call i32 @vec3i_bezier3(i32* %6, i32* %7, i32* %8, i32* %9, float %4)
ret %struct.vec3i* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf1(char *);
void exception_handler(int vec_no, int err_code, int eip, int cs, int eflags) {
  printf1("exception_handler\n");
}


x86 assembly (clang, -O0):
<exception_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <printf1@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"exception_handler\0A\00"
define void @exception_handler(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @printf1(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("\007");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 7)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int ishtmlspace(char chr) {
  return ((chr == ' ' || chr == '\t' || chr == '\n' || chr == '\r'));
}


x86 assembly (clang, -O0):
<ishtmlspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <ishtmlspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <ishtmlspace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <ishtmlspace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishtmlspace>:
cmp    $0x20,%dil
ja     1120 <ishtmlspace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <ishtmlspace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @ishtmlspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @ishtmlspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct rexSet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ constructorRexS(struct rexSet *);
void destructorRexS(struct rexSet *obj) { constructorRexS(obj); }


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

x86 assembly (clang, -O2):
<destructorRexS>:
jmp    1030 <constructorRexS@plt>

LLVM IR (-O0):
%struct.rexSet = type { i32 }
define void @destructorRexS(%struct.rexSet* %0) {
%2 = alloca %struct.rexSet*
store %struct.rexSet* %0, %struct.rexSet** %2
%3 = load %struct.rexSet*, %struct.rexSet** %2
%4 = call i32 @constructorRexS(%struct.rexSet* %3)
ret void
}

LLVM IR (-O2):
%struct.rexSet = type { i32 }
define void @destructorRexS(%struct.rexSet* %0) {
%2 = tail call i32 @constructorRexS(%struct.rexSet* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t sz) {
  void *q;
  assert(sz != 0);
  q = realloc(p, sz);
  if (q == NULL) {
    perror("xrealloc");
    abort();
  }
  return q;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1191 <xrealloc+0x51>
lea    0xe7b(%rip),%rdi
call   1060 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <realloc@plt>
test   %rax,%rax
je     1170 <xrealloc+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe89(%rip),%rdi
call   1060 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"xrealloc\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [9 x i8] c"xrealloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = icmp ne i64 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i8* @realloc(i8* %0, i64 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %2
ret i8* %6
}
void _DC_init_utils(void) {}


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

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

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

LLVM IR (-O2):
define void @_DC_init_utils() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, char const *, int);
void __assert_func(const char *file, int line, const char *func,
                   const char *expr) {
  (void)func;
  printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<__assert_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__assert_func>:
push   %rax
mov    %esi,%eax
mov    %rdi,%rdx
lea    0xed3(%rip),%rdi
mov    %rcx,%rsi
mov    %eax,%ecx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Assertion '%s' failed, at file %s:%d\0A\00"
define void @__assert_func(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"Assertion '%s' failed, at file %s:%d\0A\00"
define void @__assert_func(i8* %0, i32 %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0, i32 %1)
%6 = tail call i32 @exit(i32 1)
unreachable
}
void cpuid(unsigned long val, unsigned long *eax, unsigned long *ebx,
           unsigned long *ecx, unsigned long *edx) {
  __asm __volatile__("mov %%ebx, %%esi\n\t"
                     "cpuid\n\t"
                     "xchg %%ebx, %%esi"
                     : "=a"(*eax), "=S"(*ebx), "=c"(*ecx), "=d"(*edx)
                     : "0"(val));
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %ebx,%esi
cpuid
xchg   %esi,%ebx
mov    %rax,%r10
mov    -0x38(%rbp),%rax
mov    %rsi,%r8
mov    %rcx,%rsi
mov    -0x30(%rbp),%rcx
mov    %r10,(%r9)
mov    %r8,(%rdi)
mov    %rsi,(%rcx)
mov    %rdx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    %rcx,%r9
mov    %rdx,%r10
mov    %rsi,%r11
mov    %rdi,%rax
mov    %ebx,%esi
cpuid
xchg   %esi,%ebx
mov    %rax,(%r11)
mov    %rsi,(%r10)
mov    %rcx,(%r9)
mov    %rdx,(%r8)
ret

LLVM IR (-O0):
define void @cpuid(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** %7
%12 = load i64*, i64** %8
%13 = load i64*, i64** %9
%14 = load i64*, i64** %10
%15 = load i64, i64* %6
%16 = call { i64, i64, i64, i64 } asm sideeffect "mov %ebx, %esi\0A\09cpuid\0A\09xchg %ebx, %esi", "={ax},={si},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i64 %15)
%17 = extractvalue { i64, i64, i64, i64 } %16, 0
%18 = extractvalue { i64, i64, i64, i64 } %16, 1
%19 = extractvalue { i64, i64, i64, i64 } %16, 2
%20 = extractvalue { i64, i64, i64, i64 } %16, 3
store i64 %17, i64* %11
store i64 %18, i64* %12
store i64 %19, i64* %13
store i64 %20, i64* %14
ret void
}

LLVM IR (-O2):
define void @cpuid(i64 %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3, i64* nocapture writeonly %4) {
%6 = tail call { i64, i64, i64, i64 } asm sideeffect "mov %ebx, %esi\0A\09cpuid\0A\09xchg %ebx, %esi", "={ax},={si},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i64 %0)
%7 = extractvalue { i64, i64, i64, i64 } %6, 0
%8 = extractvalue { i64, i64, i64, i64 } %6, 1
%9 = extractvalue { i64, i64, i64, i64 } %6, 2
%10 = extractvalue { i64, i64, i64, i64 } %6, 3
store i64 %7, i64* %1
store i64 %8, i64* %2
store i64 %9, i64* %3
store i64 %10, i64* %4
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ errorf(char *, int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int);
void report_errno(char *where, int rc) {
  int e = errno;
  errorf("Got error %d in %s: (%d)%s", rc, where, e, strerror(e));
}


x86 assembly (clang, -O0):
<report_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    %eax,%r8d
lea    0xe95(%rip),%rdi
call   1030 <errorf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_errno>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2eb0(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1040 <strerror@plt>
lea    0xec0(%rip),%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <errorf@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [27 x i8] c"Got error %d in %s: (%d)%s\00"
define void @report_errno(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* @errno
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = load i32, i32* %5
%11 = call i32 @strerror(i32 %10)
%12 = call i32 @errorf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [27 x i8] c"Got error %d in %s: (%d)%s\00"
define void @report_errno(i8* %0, i32 %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @errorf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_mutex(int);
int pthread_mutex_lock(int /*<<< orphan*/);
int lock_fd(int fd) { return pthread_mutex_lock(get_mutex(fd)); }


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

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

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

LLVM IR (-O2):
define i32 @lock_fd(i32 %0) {
%2 = tail call i32 @get_mutex(i32 %0)
%3 = tail call i32 @pthread_mutex_lock(i32 %2)
ret i32 %3
}
/* Variables and functions */
size_t strxspn(char const *, char const *, int);
size_t strcspn(const char *s, const char *reject) {
  return strxspn(s, reject, 1);
}


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

x86 assembly (clang, -O2):
<strcspn>:
mov    $0x1,%edx
jmp    1030 <strxspn@plt>

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

LLVM IR (-O2):
define i64 @strcspn(i8* %0, i8* %1) {
%3 = tail call i64 @strxspn(i8* %0, i8* %1, i32 1)
ret i64 %3
}
void t2() {}


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

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

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

LLVM IR (-O2):
define void @t2() {
ret void
}
void perfstats_init(void) {}


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

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

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

LLVM IR (-O2):
define void @perfstats_init() {
ret void
}
int test_imm_CCuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xCC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CCuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 204
%6 = icmp ne i64 %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_CCuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 204
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const void *_fdt_offset_ptr(const void *fdt, int offset) {
  return (const char *)fdt + fdt_off_dt_struct(fdt) + offset;
}


x86 assembly (clang, -O0):
<_fdt_offset_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <fdt_off_dt_struct@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fdt_offset_ptr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <fdt_off_dt_struct@plt>
movslq %eax,%rcx
add    %rbx,%rcx
movslq %ebp,%rax
add    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @_fdt_offset_ptr(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fdt_off_dt_struct to i32 (i8*, ...)*)(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}