xunge/DecIR huggingface dataset:
int jac_chain_nm4_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 2;
  if (n_out)
    *n_out = 2;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm4_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm4_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm4_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm4_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm4_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm4_init>:
test   %rdi,%rdi
je     110b <jac_chain_nm4_init+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm4_init+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm4_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm4_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @jac_chain_nm4_init(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 2, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 0, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @jac_chain_nm4_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
void tests_sigfpe_handler(int sig) {
  {}
}


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

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

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

LLVM IR (-O2):
define void @tests_sigfpe_handler(i32 %0) {
ret void
}
int f(int n) {
  if (n == 1) {
    return 1;
  }
  return 2 * f(n - 1) + 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <f+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1145 <f+0x35>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x1,%eax
cmp    $0x1,%edi
je     112c <f+0x1c>
push   %rax
add    $0xffffffff,%edi
call   1030 <f@plt>
add    %eax,%eax
add    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @f(i32 %9)
%11 = mul nsw i32 2, %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @f(i32 %6)
%8 = shl nsw i32 %7, 1
%9 = or i32 %8, 1
br label %3
}
void squeezechar(char *s, char c) {
  char *squeezed = s;
  for (; *s != '\0'; s++)
    if (*s != c)
      *squeezed++ = *s;
  *squeezed = '\0';
}


x86 assembly (clang, -O0):
<squeezechar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1166 <squeezechar+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1150 <squeezechar+0x50>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1155 <squeezechar+0x55>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <squeezechar+0x16>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<squeezechar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <squeezechar+0x28>
lea    0x1(%rdi),%rax
jmp    111b <squeezechar+0x1b>
nopl   0x0(%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1128 <squeezechar+0x28>
cmp    %sil,%cl
je     1110 <squeezechar+0x10>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <squeezechar+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @squeezechar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %15, %12 ], [ %3, %2 ]
%7 = phi i8* [ %13, %12 ], [ %0, %2 ]
%8 = phi i8* [ %14, %12 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
br label %12
12: ; preds = %5, %10
%13 = phi i8* [ %11, %10 ], [ %7, %5 ]
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ]
store i8 0, i8* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
size_t _sstream_next_po2(size_t len) {
  size_t curr = 2;
  while (1) {
    if (curr > len) {
      return curr;
    }
    curr = curr * 2;
  }
  abort();
}


x86 assembly (clang, -O0):
<_sstream_next_po2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1124 <_sstream_next_po2+0x24>
mov    -0x10(%rbp),%rax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_sstream_next_po2+0x10>

x86 assembly (clang, -O2):
<_sstream_next_po2>:
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jbe    1110 <_sstream_next_po2+0x10>
ret

LLVM IR (-O0):
define i64 @_sstream_next_po2(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 2, i64* %3
br label %4
4: ; preds = %1, %10
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i64, i64* %3
ret i64 %9
10: ; preds = %4
%11 = load i64, i64* %3
%12 = mul i64 %11, 2
store i64 %12, i64* %3
br label %4
}

LLVM IR (-O2):
define i64 @_sstream_next_po2(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 2, %1 ], [ %5, %2 ]
%4 = icmp ugt i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %6, label %2
6: ; preds = %2
ret i64 %3
}
void s3c2416_default_sdhci1(void) {}


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

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

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

LLVM IR (-O2):
define void @s3c2416_default_sdhci1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
void pinMode(int pin, char mode) { printf("pinMode %i-%c\n", pin, mode); }


x86 assembly (clang, -O0):
<pinMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed5(%rip),%rdi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"pinMode %i-%c\0A\00"
define void @pinMode(i32 %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i8 signext %1)
ret void
}
float fahrToC(int fahr) { return ((5.0 / 9.0) * (fahr - 32)); }


x86 assembly (clang, -O0):
<fahrToC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrToC>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fahrToC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = sitofp i32 %4 to double
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @fahrToC(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int /*<<< orphan*/ database_init_and_connect(int /*<<< orphan*/ *);
int main() {
  MYSQL *mysql;
  database_init_and_connect(mysql);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @database_init_and_connect(i32* undef)
ret i32 0
}
int substring(const char *s1, const char *s2) {
  while (*s1 == *s2) {
    if (!*(s1++))
      return 0;
    s2++;
  }
  if (*s1 == 0)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<substring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1157 <substring+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1146 <substring+0x46>
movl   $0x0,-0x4(%rbp)
jmp    117a <substring+0x7a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <substring+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1173 <substring+0x73>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <substring+0x7a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring>:
mov    (%rdi),%al
cmp    (%rsi),%al
jne    1124 <substring+0x24>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
test   %al,%al
je     112c <substring+0x2c>
movzbl (%rdi,%rcx,1),%eax
lea    0x1(%rcx),%rdx
cmp    (%rsi,%rcx,1),%al
mov    %rdx,%rcx
je     1110 <substring+0x10>
cmp    $0x1,%al
sbb    %eax,%eax
or     $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @substring(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %21, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = icmp eq i8 %18, 0
%20 = select i1 %19, i32 -1, i32 1
br label %21
21: ; preds = %6, %17
%22 = phi i32 [ %20, %17 ], [ 0, %6 ]
ret i32 %22
}
/* Type definitions */
typedef scalar_t__ GLshort;
typedef double GLdouble;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void shoveSshort(GLdouble value, int index, void *data) {
  assert(0.0 <= value && value < 32768.0);
  ((GLshort *)data)[index] = (GLshort)value;
}


x86 assembly (clang, -O0):
<shoveSshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     114e <shoveSshort+0x3e>
movsd  0xebd(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cvttsd2si -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shoveSshort>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
movsd  0xed0(%rip),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
cvttsd2si (%rsp),%rax
movslq %ebp,%rcx
mov    %rax,(%rbx,%rcx,8)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @shoveSshort(double %0, i32 %1, i8* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i8*
store double %0, double* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = fcmp ole double 0.000000e+00, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load double, double* %4
%11 = fcmp olt double %10, 3.276800e+04
br label %12
12: ; preds = %9, %3
%13 = phi i1 [ false, %3 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load double, double* %4
%17 = fptosi double %16 to i64
%18 = load i8*, i8** %6
%19 = bitcast i8* %18 to i64*
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %19, i64 %21
store i64 %17, i64* %22
ret void
}

LLVM IR (-O2):
define void @shoveSshort(double %0, i32 %1, i8* nocapture writeonly %2) {
%4 = fcmp oge double %0, 0.000000e+00
%5 = fcmp olt double %0, 3.276800e+04
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = fptosi double %0 to i64
%10 = bitcast i8* %2 to i64*
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i64, i64* %10, i64 %11
store i64 %9, i64* %12
ret void
}
_Noreturn void b() { g(); }


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

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

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

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @g()
ret void
}
int test_imm_49int16_mem(short *val) {
  return ((*val) & (-0x49 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_49int16_mem>:
movzwl (%rdi),%eax
test   $0xffb7,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_49int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -73
%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_49int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -73
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", argv[1]);
  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),%rax
mov    0x8(%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_WORM(struct list_head *);
uint8_t clear_3592_WORM(struct list_head *m) {
  ;
  return clear_WORM(m);
}


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

x86 assembly (clang, -O2):
<clear_3592_WORM>:
jmp    1030 <clear_WORM@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @clear_3592_WORM(%struct.list_head* %0) {
%2 = tail call i32 @clear_WORM(%struct.list_head* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Q_isfinite(float);
float atof(char const *);
float Q_atof(const char *str) {
  float f;
  f = atof(str);
  if (!Q_isfinite(f))
    return 0.0f;
  return f;
}


x86 assembly (clang, -O0):
<Q_atof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <Q_isfinite@plt>
cmp    $0x0,%eax
jne    115a <Q_atof+0x3a>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1164 <Q_atof+0x44>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_atof>:
push   %rax
call   1030 <atof@plt>
movss  %xmm0,0x4(%rsp)
call   1040 <Q_isfinite@plt>
xorps  %xmm0,%xmm0
test   %eax,%eax
je     113e <Q_atof+0x1e>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Q_atof(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call float @atof(i8* %5)
store float %6, float* %4
%7 = load float, float* %4
%8 = call i32 @Q_isfinite(float %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %1
store float 0.000000e+00, float* %2
br label %13
11: ; preds = %1
%12 = load float, float* %4
store float %12, float* %2
br label %13
13: ; preds = %11, %10
%14 = load float, float* %2
ret float %14
}

LLVM IR (-O2):
define float @Q_atof(i8* nocapture %0) {
%2 = tail call float @atof(i8* %0)
%3 = tail call i32 @Q_isfinite(float %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, float 0.000000e+00, float %2
ret float %5
}
/* Variables and functions */
int get_stcadc4(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_stcadc4(int a, int b, int mask) {
  int f, r;
  f = get_stcadc4(a, b, &r);
  f &= mask;
  printf("stcadc"
         " 4"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_stcadc4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1030 <get_stcadc4@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stcadc4>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <get_stcadc4@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"stcadc 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcadc4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_stcadc4(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"stcadc 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcadc4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_stcadc4(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
int open(const char *filename, int flags, int mode) {
  int fd = 0;
  asm("movl $5, %%eax \n\t"
      "movl %1, %%ebx \n\t"
      "movl %2, %%ecx \n\t"
      "movl %3, %%edx \n\t"
      "int $0x80 \n\t"
      "movl %%eax, %0 \n\t"
      : "=m"(fd)
      : "m"(filename), "m"(flags), "m"(mode));
  return fd;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x5,%eax
mov    -0x8(%rbp),%ebx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    %rdi,-0x8(%rsp)
mov    %esi,-0xc(%rsp)
mov    %edx,-0x10(%rsp)
movl   $0x0,-0x14(%rsp)
mov    $0x5,%eax
mov    -0x8(%rsp),%ebx
mov    -0xc(%rsp),%ecx
mov    -0x10(%rsp),%edx
int    $0x80
mov    %eax,-0x14(%rsp)
mov    -0x14(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%9 = load i32, i32* %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ kill_worker_thread();
int /*<<< orphan*/ stop_working();
void kill_worker() {
  stop_working();
  kill_worker_thread();
}


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

x86 assembly (clang, -O2):
<kill_worker>:
push   %rax
xor    %eax,%eax
call   1030 <stop_working@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <kill_worker_thread@plt>

LLVM IR (-O0):
define void @kill_worker() {
%1 = call i32 (...) @stop_working()
%2 = call i32 (...) @kill_worker_thread()
ret void
}

LLVM IR (-O2):
define void @kill_worker() {
%1 = tail call i32 (...) @stop_working()
%2 = tail call i32 (...) @kill_worker_thread()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int counter = 0;
  do {
    printf("\n %d => %c", counter, counter);
    counter++;
  } while (counter < 255);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jl     1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0A %d => %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %3
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 255
br i1 %11, label %3, label %12
12: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0A %d => %c\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 255
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
unsigned long get_XPointerMovedEvent_time(void *_p) {
  return (unsigned long)((XPointerMovedEvent *)_p)->time;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XPointerMovedEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
char *_expr_log(char *, int);
char *expr_log(char *string) { return _expr_log(string, 2); }


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

x86 assembly (clang, -O2):
<expr_log>:
mov    $0x2,%esi
jmp    1030 <_expr_log@plt>

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

LLVM IR (-O2):
define i8* @expr_log(i8* %0) {
%2 = tail call i8* @_expr_log(i8* %0, i32 2)
ret i8* %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t xs_getll(unsigned char *buf) {
  return (((uint64_t)buf[0]) << 56) | (((uint64_t)buf[1]) << 48) |
         (((uint64_t)buf[2]) << 40) | (((uint64_t)buf[3]) << 32) |
         (((uint64_t)buf[4]) << 24) | (((uint64_t)buf[5]) << 16) |
         (((uint64_t)buf[6]) << 8) | (((uint64_t)buf[7] << 0));
}


x86 assembly (clang, -O0):
<xs_getll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xs_getll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 56
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 48
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 40
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 32
%25 = or i32 %19, %24
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 4
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = shl i32 %29, 24
%31 = or i32 %25, %30
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i64 5
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = shl i32 %35, 16
%37 = or i32 %31, %36
%38 = load i8*, i8** %2
%39 = getelementptr inbounds i8, i8* %38, i64 6
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = shl i32 %41, 8
%43 = or i32 %37, %42
%44 = load i8*, i8** %2
%45 = getelementptr inbounds i8, i8* %44, i64 7
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = shl i32 %47, 0
%49 = or i32 %43, %48
ret i32 %49
}

LLVM IR (-O2):
define i32 @xs_getll(i8* nocapture readnone %0) {
ret i32 poison
}
int xmlUCSIsHangulSyllables(int code) {
  return (((code >= 0xAC00) && (code <= 0xD7AF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsHangulSyllables>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xac00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsHangulSyllables+0x26>
cmpl   $0xd7af,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsHangulSyllables>:
add    $0xffff5400,%edi
xor    %eax,%eax
cmp    $0x2bb0,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsHangulSyllables(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 44032
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 55215
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsHangulSyllables(i32 %0) {
%2 = add i32 %0, -44032
%3 = icmp ult i32 %2, 11184
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_142() {
  Assert_real((isqrt(142) == 11),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              715, ("Integer square root of 142 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_142>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8e,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2cb,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_142>:
push   %rax
mov    $0x8e,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2cb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 142 should be 11\00"
define void @t_sqrt_142() {
%1 = call i32 @isqrt(i32 142)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 715, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 142 should be 11\00"
define void @t_sqrt_142() {
%1 = tail call i32 @isqrt(i32 142)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 715, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "target1: argc != 2\n");
    exit(EXIT_FAILURE);
  }
  foo(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)
cmpl   $0x2,-0x8(%rbp)
je     1173 <main+0x43>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1142 <main+0x12>
mov    %rsi,%rdi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"target1: argc != 2\0A\00"
@EXIT_FAILURE = 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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = call i32 @foo(i8** %14)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"target1: argc != 2\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = tail call i32 @foo(i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
int16_t voip_readInt16(const void *p) {
  int16_t v;
  memcpy(&v, p, 2);
  return ntohs(v);
}


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

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

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

LLVM IR (-O2):
define i32 @voip_readInt16(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 2)
%5 = load i32, i32* %2
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}
extern long div_h_or_l_X_l_rem(long divh, long divl, long div, long *rem) {
  long dum2;
  __asm__("divl %2" : "=a"(dum2), "=d"(*rem) : "rm"(div), "0"(divl), "1"(divh));
  return dum2;
}


x86 assembly (clang, -O0):
<div_h_or_l_X_l_rem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
mov    %rcx,-0x30(%rbp)
divl   -0x30(%rbp)
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,-0x28(%rbp)
mov    %rdx,(%rax)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @div_h_or_l_X_l_rem(i64 %0, i64 %1, i64 %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64*
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64* %3, i64** %8
%10 = load i64*, i64** %8
%11 = load i64, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %5
%14 = call { i64, i64 } asm "divl $2", "={ax},={dx},rm,0,1,~{dirflag},~{fpsr},~{flags}"(i64 %11, i64 %12, i64 %13)
%15 = extractvalue { i64, i64 } %14, 0
%16 = extractvalue { i64, i64 } %14, 1
store i64 %15, i64* %9
store i64 %16, i64* %10
%17 = load i64, i64* %9
ret i64 %17
}

LLVM IR (-O2):
double round(double f) { return f >= 0 ? (int)(f + 0.5) : (int)(f - 0.5); }


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <round+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <round+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i32
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = fptosi double %11 to i32
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
%15 = sitofp i32 %14 to double
ret double %15
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq(int, unsigned char *, long long);
void vt100_DSR(int n) { vt100_EscSeq(6, (unsigned char *)"n", (long long)2); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x6,%edi
lea    0xed9(%rip),%rsi
mov    $0x2,%edx
call   1030 <vt100_EscSeq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
mov    $0x6,%edi
jmp    1030 <vt100_EscSeq@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"n\00"
define void @vt100_DSR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @vt100_EscSeq(i32 6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
define void @vt100_DSR(i32 %0) {
%2 = tail call i32 @vt100_EscSeq(i32 6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Variables and functions */
size_t recurring_length_2(int d, int *in_seq) {
  int n = 10;
  size_t k = 1;
  while (n != 0 && n != 1) {
    n = (n * 10) % d;
    ++k;
  }
  return k;
}


x86 assembly (clang, -O0):
<recurring_length_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movq   $0x1,-0x20(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x21(%rbp)
je     1133 <recurring_length_2+0x33>
cmpl   $0x1,-0x14(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1143 <recurring_length_2+0x43>
jmp    115f <recurring_length_2+0x5f>
imul   $0xa,-0x14(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <recurring_length_2+0x1a>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurring_length_2>:
mov    $0xa,%edx
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
cltd
idiv   %edi
add    $0x1,%rcx
cmp    $0x1,%edx
ja     1110 <recurring_length_2+0x10>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @recurring_length_2(i32 %0, i32* nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 1, %2 ], [ %8, %3 ]
%5 = phi i32 [ 10, %2 ], [ %7, %3 ]
%6 = mul nsw i32 %5, 10
%7 = srem i32 %6, %0
%8 = add i64 %4, 1
%9 = icmp ult i32 %7, 2
br i1 %9, label %10, label %3
10: ; preds = %3
ret i64 %8
}