#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
void foo(int (*callback)()) {
  for (int i = 0; i < 10; i++) {
    if (__VERIFIER_nondet_int())
      callback();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1156 <foo+0x46>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     1143 <foo+0x33>
mov    $0x0,%al
call   *-0x8(%rbp)
jmp    1148 <foo+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <foo+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1124 <foo+0x14>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1134 <foo+0x24>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1144 <foo+0x34>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1154 <foo+0x44>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1164 <foo+0x54>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1174 <foo+0x64>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1184 <foo+0x74>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     1194 <foo+0x84>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     11a4 <foo+0x94>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %rax,%rax
je     11b8 <foo+0xa8>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx
pop    %rbx
ret

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

LLVM IR (-O2):
define void @foo(i32 (...)* nocapture %0) {
%2 = tail call i64 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) %0()
br label %6
6: ; preds = %1, %4
%7 = tail call i64 (...) @__VERIFIER_nondet_int()
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) %0()
br label %11
11: ; preds = %9, %6
%12 = tail call i64 (...) @__VERIFIER_nondet_int()
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 (...) %0()
br label %16
16: ; preds = %14, %11
%17 = tail call i64 (...) @__VERIFIER_nondet_int()
%18 = icmp eq i64 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = tail call i32 (...) %0()
br label %21
21: ; preds = %19, %16
%22 = tail call i64 (...) @__VERIFIER_nondet_int()
%23 = icmp eq i64 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = tail call i32 (...) %0()
br label %26
26: ; preds = %24, %21
%27 = tail call i64 (...) @__VERIFIER_nondet_int()
%28 = icmp eq i64 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %26
%30 = tail call i32 (...) %0()
br label %31
31: ; preds = %29, %26
%32 = tail call i64 (...) @__VERIFIER_nondet_int()
%33 = icmp eq i64 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = tail call i32 (...) %0()
br label %36
36: ; preds = %34, %31
%37 = tail call i64 (...) @__VERIFIER_nondet_int()
%38 = icmp eq i64 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = tail call i32 (...) %0()
br label %41
41: ; preds = %39, %36
%42 = tail call i64 (...) @__VERIFIER_nondet_int()
%43 = icmp eq i64 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %41
%45 = tail call i32 (...) %0()
br label %46
46: ; preds = %44, %41
%47 = tail call i64 (...) @__VERIFIER_nondet_int()
%48 = icmp eq i64 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = tail call i32 (...) %0()
br label %51
51: ; preds = %49, %46
ret void
}