xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t __strleneq(const char *str) {
  const char *s;
  for (s = str; *s != '\0'; ++s)
    if (*s == '=')
      return (0);
  return (s - str);
}


x86 assembly (clang, -O0):
<__strleneq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <__strleneq+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    113d <__strleneq+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1162 <__strleneq+0x62>
jmp    1142 <__strleneq+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <__strleneq+0x10>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strleneq>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1125 <__strleneq+0x25>
cmp    $0x3d,%cl
je     1123 <__strleneq+0x23>
add    $0x1,%rax
jmp    1110 <__strleneq+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @__strleneq(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 61, label %11
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
br label %11
11: ; preds = %2, %7
%12 = phi i64 [ %10, %7 ], [ 0, %2 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void checkNotNull(void *p, const char *message) {
  if (!p) {
    fprintf(stderr, "Fatal error: %s\n", message);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkNotNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1162 <checkNotNull+0x42>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkNotNull>:
test   %rdi,%rdi
je     1126 <checkNotNull+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal error: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @checkNotNull(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
int isEmpty(char *str) { return str[0] == '\n'; }


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
xor    %eax,%eax
cmpb   $0xa,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @isEmpty(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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isEmpty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRC2_set(void) { return U_WMRCORENONE_set("U_WMRC2"); }


x86 assembly (clang, -O0):
<U_WMRC2_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC2\00"
define i8* @U_WMRC2_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC2\00"
define i8* @U_WMRC2_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int __rt_sigaction(int signum, const struct sigaction *act,
                   struct sigaction *oldact, long nr) {
  return 0;
}


x86 assembly (clang, -O0):
<__rt_sigaction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sigaction = type opaque
define i32 @__rt_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2, i64 %3) {
%5 = alloca i32
%6 = alloca %struct.sigaction*
%7 = alloca %struct.sigaction*
%8 = alloca i64
store i32 %0, i32* %5
store %struct.sigaction* %1, %struct.sigaction** %6
store %struct.sigaction* %2, %struct.sigaction** %7
store i64 %3, i64* %8
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type opaque
define i32 @__rt_sigaction(i32 %0, %struct.sigaction* nocapture readnone %1, %struct.sigaction* nocapture readnone %2, i64 %3) {
ret i32 0
}
unsigned int unsignedint_ignoring_signedlonglongint(unsigned int x,
                                                    signed long long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @unsignedint_ignoring_signedlonglongint(i32 returned %0, i64 %1) {
ret i32 %0
}
__attribute__((no)) long
trampoline_code_heap_fill(unsigned long n1, unsigned long n2, unsigned long n3,
                          unsigned long n4, unsigned long n5) {
  long ret;
  register unsigned long r8 __asm__("r8") = n5;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0xA8"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       : "D"(n1), "S"(n2), "d"(n3), "c"(n4), "r"(r8)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<trampoline_code_heap_fill>:
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    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x38(%rbp),%r8
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100a8
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_code_heap_fill>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100a8
ret

LLVM IR (-O0):
define i64 @trampoline_code_heap_fill(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
%11 = alloca i64
%12 = 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
%13 = load i64, i64* %10
store i64 %13, i64* %12
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = load i64, i64* %8
%17 = load i64, i64* %9
%18 = load i64, i64* %12
%19 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xA8\0A\091:\0A\09", "={ax},{di},{si},{dx},{cx},{r8},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %14, i64 %15, i64 %16, i64 %17, i64 %18)
store i64 %19, i64* %11
%20 = load i64, i64* %11
ret i64 %20
}

LLVM IR (-O2):
define i64 @trampoline_code_heap_fill(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xA8\0A\091:\0A\09", "={ax},{di},{si},{dx},{cx},{r8},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, contador = 0;
  scanf("%d", &n);
  while (contador < n) {
    printf("Eu adoro programar\n");
    contador = contador + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <main+0x4c>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1161 <main+0x41>
xor    %ebp,%ebp
lea    0xebf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [19 x i8] c"Eu adoro programar\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ 0, %0 ]
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %1
%11 = icmp slt i32 %9, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
double poly3(double x, double c) { return x * (1 - x * (0.5 - x * c)); }


x86 assembly (clang, -O0):
<poly3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xec3(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe94(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly3>:
mulsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeec(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @poly3(double %0, double %1) {
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double 5.000000e-01)
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  if (argc == 2 && strcmp(argv[1], "--version") == 0) {
    printf("OTHER_EXEC_VERSION_HEADER 3.2.1 VERSION_FOOTER\n");
  }
  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)
jne    116a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    116a <main+0x4a>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1147 <main+0x27>
mov    0x8(%rsi),%rdi
lea    0xecf(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1147 <main+0x27>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"--version\00"
@.str.1 = [48 x i8] c"OTHER_EXEC_VERSION_HEADER 3.2.1 VERSION_FOOTER\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 i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %8, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"--version\00"
@str = [47 x i8] c"OTHER_EXEC_VERSION_HEADER 3.2.1 VERSION_FOOTER\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %4, %2
ret i32 0
}
int atomic_compare_and_swap_bool(int *ptr, int oldValue, int newValue) {
  return __sync_bool_compare_and_swap(ptr, oldValue, newValue);
}


x86 assembly (clang, -O0):
<atomic_compare_and_swap_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_compare_and_swap_bool>:
mov    %esi,%eax
xor    %ecx,%ecx
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atomic_compare_and_swap_bool(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = cmpxchg i32* %7, i32 %8, i32 %9 seq_cst seq_cst
%11 = extractvalue { i32, i1 } %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @atomic_compare_and_swap_bool(i32* nocapture %0, i32 %1, i32 %2) {
%4 = cmpxchg i32* %0, i32 %1, i32 %2 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
int memChkMax(int size) { return size > (1024 - 64) ? 0 : 1; }


x86 assembly (clang, -O0):
<memChkMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x3c0,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memChkMax>:
xor    %eax,%eax
cmp    $0x3c1,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @memChkMax(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 960
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 0, i32 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @memChkMax(i32 %0) {
%2 = icmp slt i32 %0, 961
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef unsigned int FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(unsigned int *);
int read_uint32_from_file(unsigned int *, int /*<<< orphan*/ *);
int read_unsigned_int_from_file(FILE *f, unsigned int *num) {
  assert(f);
  assert(num);
  return read_uint32_from_file(f, (uint32_t *)num);
}


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

x86 assembly (clang, -O2):
<read_unsigned_int_from_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <read_uint32_from_file@plt>

LLVM IR (-O0):
define i32 @read_unsigned_int_from_file(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = call i32 @assert(i32* %5)
%7 = load i32*, i32** %4
%8 = call i32 @assert(i32* %7)
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = call i32 @read_uint32_from_file(i32* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @read_unsigned_int_from_file(i32* %0, i32* %1) {
%3 = tail call i32 @assert(i32* %0)
%4 = tail call i32 @assert(i32* %1)
%5 = tail call i32 @read_uint32_from_file(i32* %0, i32* %1)
ret i32 %5
}
/* Variables and functions */
float strtold(char const *, char **);
float strtof(const char *nptr, char **endptr) { return strtold(nptr, endptr); }


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

x86 assembly (clang, -O2):
<strtof>:
jmp    1030 <strtold@plt>

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

LLVM IR (-O2):
define float @strtof(i8* %0, i8** nocapture %1) {
%3 = tail call float @strtold(i8* %0, i8** %1)
ret float %3
}
int test_imm_B7uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xB7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B7uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 183
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t Give_i(unsigned int, unsigned int);
int iDrawPoint(unsigned char A[], unsigned int ix, unsigned int iy,
               unsigned char iColor) {
  A[Give_i(ix, iy)] = iColor;
  return 0;
}


x86 assembly (clang, -O0):
<iDrawPoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x21(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <Give_i@plt>
mov    -0x21(%rbp),%dl
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %dl,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iDrawPoint>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <Give_i@plt>
mov    %bpl,(%rbx,%rax,1)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @iDrawPoint(i8* %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%9 = load i8, i8* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i64 @Give_i(i32 %11, i32 %12)
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8 %9, i8* %14
ret i32 0
}

LLVM IR (-O2):
define i32 @iDrawPoint(i8* nocapture writeonly %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = tail call i64 @Give_i(i32 %1, i32 %2)
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %3, i8* %6
ret i32 0
}
/* Variables and functions */
scalar_t__ _IO_printf(char *, int, double, double);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  int ret = 42;
  while (ret == 42)
    ret += _IO_printf("hello world: %d %f %f\n", ret, 1.0 / 0.0, 3.5);
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
jne    1171 <main+0x51>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
movsd  0xeae(%rip),%xmm0
movsd  0xeae(%rip),%xmm1
call   1030 <_IO_printf@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x2a,%esi
movsd  0xec0(%rip),%xmm0
movsd  0xec0(%rip),%xmm1
call   1030 <_IO_printf@plt>
test   %eax,%eax
je     1130 <main+0x10>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"hello world: %d %f %f\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 42
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i64 @_IO_printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, double 0x7FF0000000000000, double 3.500000e+00)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"hello world: %d %f %f\0A\00"
@stdout = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i64 @_IO_printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 42, double 0x7FF0000000000000, double 3.500000e+00)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  int z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x < y) {
    if (x < z) {
      x = x + 1;
    } else {
      z = z + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1171 <main+0x61>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <main+0x53>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
unsigned int bytestream_get_be32(const uint8_t **b) {
  (*b) += 4;
  return (((uint32_t)((const uint8_t *)(*b - 4))[0] << 24) |
          (((const uint8_t *)(*b - 4))[1] << 16) |
          (((const uint8_t *)(*b - 4))[2] << 8) |
          ((const uint8_t *)(*b - 4))[3]);
}


x86 assembly (clang, -O0):
<bytestream_get_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0xc(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
or     -0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytestream_get_be32>:
mov    (%rdi),%rcx
lea    0x10(%rcx),%rax
mov    %rax,(%rdi)
mov    (%rcx),%eax
mov    0x4(%rcx),%edx
shl    $0x18,%eax
shl    $0x10,%edx
or     %eax,%edx
mov    0x8(%rcx),%eax
shl    $0x8,%eax
or     %edx,%eax
or     0xc(%rcx),%eax
ret

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

LLVM IR (-O2):
define i32 @bytestream_get_be32(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 4
store i32* %3, i32** %0
%4 = load i32, i32* %2
%5 = shl i32 %4, 24
%6 = getelementptr inbounds i32, i32* %2, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = or i32 %8, %5
%10 = getelementptr inbounds i32, i32* %2, i64 2
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = getelementptr inbounds i32, i32* %2, i64 3
%15 = load i32, i32* %14
%16 = or i32 %13, %15
ret i32 %16
}
/* Variables and functions */
void *ams_alloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *ams_calloc(size_t size) {
  void *p = NULL;
  p = ams_alloc(size);
  if (p)
    (void)memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<ams_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ams_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <ams_calloc+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ams_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <ams_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <ams_calloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ams_calloc(i64 %0) {
%2 = tail call i8* @ams_alloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wcstr;
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ mbstowcs(int /*<<< orphan*/ *, char const *, int);
int wcswidth(int /*<<< orphan*/ *, int);
__attribute__((unused)) int utf8_scrlen(const char *s) {
  assert(s);
  wchar_t wcstr[512];
  mbstowcs(wcstr, s, sizeof(wcstr) / sizeof(*wcstr));
  return wcswidth(wcstr, sizeof(wcstr) / sizeof(*wcstr));
}


x86 assembly (clang, -O0):
<utf8_scrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x200,%edx
call   1040 <mbstowcs@plt>
lea    -0x810(%rbp),%rdi
mov    $0x200,%esi
call   1030 <wcswidth@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_scrlen>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1040 <mbstowcs@plt>
mov    %r14,%rdi
mov    $0x200,%esi
call   1030 <wcswidth@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @utf8_scrlen(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i32]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @assert(i8* %4)
%6 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @mbstowcs(i32* %6, i8* %7, i32 512)
%9 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 0
%10 = call i32 @wcswidth(i32* %9, i32 512)
ret i32 %10
}

LLVM IR (-O2):
define i32 @utf8_scrlen(i8* %0) {
%2 = alloca [512 x i32]
%3 = tail call i32 @assert(i8* %0)
%4 = bitcast [512 x i32]* %2 to i8*
%5 = getelementptr inbounds [512 x i32], [512 x i32]* %2, i64 0, i64 0
%6 = call i32 @mbstowcs(i32* %5, i8* %0, i32 512)
%7 = call i32 @wcswidth(i32* %5, i32 512)
ret i32 %7
}
void path_014_expected_4(int a, int b, int c) {
  if (a) {
    return;
  } else {
    if (b) {
      return;
    } else {
      if (c) {
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<path_014_expected_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111c <path_014_expected_4+0x1c>
jmp    1149 <path_014_expected_4+0x49>
cmpl   $0x0,-0x8(%rbp)
je     112b <path_014_expected_4+0x2b>
jmp    1149 <path_014_expected_4+0x49>
cmpl   $0x0,-0xc(%rbp)
je     113a <path_014_expected_4+0x3a>
jmp    113f <path_014_expected_4+0x3f>
jmp    113f <path_014_expected_4+0x3f>
jmp    1144 <path_014_expected_4+0x44>
jmp    1149 <path_014_expected_4+0x49>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @path_014_expected_4(i32 %0, i32 %1, i32 %2) {
ret void
}
unsigned bar(unsigned c, unsigned d) { return (c & 0xff00) == (d & 0xff00); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %esi,%edi
xor    %eax,%eax
test   $0xff00,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bar(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 = and i32 %5, 65280
%7 = load i32, i32* %4
%8 = and i32 %7, 65280
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = and i32 %3, 65280
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stack__destructor(struct stack *);
void stack_ops_free(struct stack *stack) {
  printf("stack::free()\n");
  stack__destructor(stack);
}


x86 assembly (clang, -O0):
<stack_ops_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <stack__destructor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_ops_free>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <stack__destructor@plt>

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

LLVM IR (-O2):
%struct.stack = type { i32 }
@str = [14 x i8] c"stack::free()\00"
define void @stack_ops_free(%struct.stack* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @stack__destructor(%struct.stack* %0)
ret void
}
void glScalef(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glScalef() {
ret void
}
/* Variables and functions */
int readline(char *, size_t);
int strtol(char *, int /*<<< orphan*/ *, int);
int readnum(char *buf, size_t buf_size, int *num) {
  int retval = readline(buf, buf_size);
  if (retval != 0)
    *num = 0;
  else
    *num = strtol(&buf[0], NULL, 10);
  return retval;
}


x86 assembly (clang, -O0):
<readnum>:
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
call   1030 <readline@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     115d <readnum+0x3d>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    1177 <readnum+0x57>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readnum>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <readline@plt>
mov    %eax,%ebp
xor    %eax,%eax
test   %ebp,%ebp
jne    1146 <readnum+0x26>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,(%r14)
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @readnum(i8* %0, i64 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @readline(i8* %0, i64 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 10)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
store i32 %9, i32* %2
ret i32 %4
}
int max(int a, int b) { return a >= b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf(char *, char const *);
int /*<<< orphan*/ stress_check_capability(int /*<<< orphan*/);
int stress_ramfs_supported(const char *name) {
  if (!stress_check_capability((0))) {
    pr_inf("%s: ramfs stressor will be skipped, "
           "need to be running with CAP_SYS_ADMIN "
           "rights for this stressor\n",
           name);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stress_ramfs_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <stress_check_capability@plt>
cmp    $0x0,%eax
jne    1158 <stress_ramfs_supported+0x38>
mov    -0x10(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <pr_inf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <stress_ramfs_supported+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_ramfs_supported>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %edi,%edi
call   1030 <stress_check_capability@plt>
test   %eax,%eax
jne    1147 <stress_ramfs_supported+0x27>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1040 <pr_inf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [100 x i8] c"%s: ramfs stressor will be skipped, need to be running with CAP_SYS_ADMIN rights for this stressor\0A\00"
define i32 @stress_ramfs_supported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @stress_check_capability(i32 0)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @pr_inf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [100 x i8] c"%s: ramfs stressor will be skipped, need to be running with CAP_SYS_ADMIN rights for this stressor\0A\00"
define i32 @stress_ramfs_supported(i8* %0) {
%2 = tail call i32 @stress_check_capability(i32 0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pr_inf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
void RTPipeWrite(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPipeWrite() {
ret void
}
char *getnick(char *tp) {
  int i;
  for (i = 0; tp[i] != '!'; i++)
    ;
  tp[i] = '\0';
  return tp + 1;
}


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

x86 assembly (clang, -O2):
<getnick>:
mov    %rdi,%rax
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
cmpb   $0x21,0x1(%rax,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1110 <getnick+0x10>
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @getnick(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 33
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %11
}
void gtk_widget_queue_draw_area() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_queue_draw_area() {
ret void
}
ISR(TIMER1_COMPA_vect) {

#pragma message("System time on timer1 not active")
}


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

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

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

LLVM IR (-O2):
define i32 @ISR(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fn3(int, int);
int /*<<< orphan*/ fn4(int, int);
int main() {
  fn3(36, 25);
  fn4(98, 117);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x24,%edi
mov    $0x19,%esi
call   1030 <fn3@plt>
mov    $0x62,%edi
mov    $0x75,%esi
call   1040 <fn4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x24,%edi
mov    $0x19,%esi
call   1030 <fn3@plt>
mov    $0x62,%edi
mov    $0x75,%esi
call   1040 <fn4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fn3(i32 36, i32 25)
%3 = call i32 @fn4(i32 98, i32 117)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fn3(i32 36, i32 25)
%2 = tail call i32 @fn4(i32 98, i32 117)
ret i32 0
}