#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 */
int /*<<< orphan*/ abort();
unsigned long func1(unsigned long, unsigned long);
unsigned long func2(unsigned long, unsigned long);
unsigned long func3(unsigned long, unsigned long);
unsigned long long func4(unsigned long long, unsigned long long);
unsigned long long func5(unsigned long long, unsigned long long);
unsigned long long func6(unsigned long long, unsigned long long);
int main(void) {
  int fail = 0;
  if (func1(7UL, 3UL) != 2UL) {
    ++fail;
  }
  if (func2(7UL, 3UL) != 2UL) {
    ++fail;
  }
  if (func3(7UL, 3UL) != 2UL) {
    ++fail;
  }
  if (func4(7ULL, 3ULL) != 2ULL) {
    ++fail;
  }
  if (func5(7ULL, 3ULL) != 2ULL) {
    ++fail;
  }
  if (func6(7ULL, 3ULL) != 2ULL) {
    ++fail;
  }
  if (fail)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1050 <func1@plt>
cmp    $0x2,%rax
je     11a8 <main+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1080 <func2@plt>
cmp    $0x2,%rax
je     11ca <main+0x5a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1030 <func3@plt>
cmp    $0x2,%rax
je     11ec <main+0x7c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1070 <func4@plt>
cmp    $0x2,%rax
je     120e <main+0x9e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1040 <func5@plt>
cmp    $0x2,%rax
je     1230 <main+0xc0>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1090 <func6@plt>
cmp    $0x2,%rax
je     1252 <main+0xe2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1263 <main+0xf3>
mov    $0x0,%al
call   1060 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x7,%edi
mov    $0x3,%esi
call   1050 <func1@plt>
xor    %ebx,%ebx
cmp    $0x2,%rax
setne  %bl
mov    $0x7,%edi
mov    $0x3,%esi
call   1080 <func2@plt>
lea    0x1(%rbx),%ebp
cmp    $0x2,%rax
cmove  %ebx,%ebp
mov    $0x7,%edi
mov    $0x3,%esi
call   1030 <func3@plt>
xor    %ebx,%ebx
cmp    $0x2,%rax
setne  %bl
add    %ebp,%ebx
mov    $0x7,%edi
mov    $0x3,%esi
call   1070 <func4@plt>
xor    %ebp,%ebp
cmp    $0x2,%rax
setne  %bpl
add    %ebx,%ebp
mov    $0x7,%edi
mov    $0x3,%esi
call   1040 <func5@plt>
xor    %ebx,%ebx
cmp    $0x2,%rax
setne  %bl
add    %ebp,%ebx
mov    $0x7,%edi
mov    $0x3,%esi
call   1090 <func6@plt>
xor    %ecx,%ecx
cmp    $0x2,%rax
setne  %cl
neg    %ecx
cmp    %ecx,%ebx
jne    121a <main+0xaa>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1060 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 @func1(i64 7, i64 3)
%4 = icmp ne i64 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %0
%9 = call i64 @func2(i64 7, i64 3)
%10 = icmp ne i64 %9, 2
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %8
%15 = call i64 @func3(i64 7, i64 3)
%16 = icmp ne i64 %15, 2
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %14
%21 = call i64 @func4(i64 7, i64 3)
%22 = icmp ne i64 %21, 2
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %20
%27 = call i64 @func5(i64 7, i64 3)
%28 = icmp ne i64 %27, 2
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %32
32: ; preds = %29, %26
%33 = call i64 @func6(i64 7, i64 3)
%34 = icmp ne i64 %33, 2
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %38
38: ; preds = %35, %32
%39 = load i32, i32* %2
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (...) @abort()
unreachable
43: ; preds = %38
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @func1(i64 7, i64 3)
%2 = icmp ne i64 %1, 2
%3 = zext i1 %2 to i32
%4 = tail call i64 @func2(i64 7, i64 3)
%5 = icmp eq i64 %4, 2
%6 = select i1 %2, i32 2, i32 1
%7 = select i1 %5, i32 %3, i32 %6
%8 = tail call i64 @func3(i64 7, i64 3)
%9 = icmp ne i64 %8, 2
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = tail call i64 @func4(i64 7, i64 3)
%13 = icmp ne i64 %12, 2
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %11, %14
%16 = tail call i64 @func5(i64 7, i64 3)
%17 = icmp ne i64 %16, 2
%18 = zext i1 %17 to i32
%19 = add nuw nsw i32 %15, %18
%20 = tail call i64 @func6(i64 7, i64 3)
%21 = icmp ne i64 %20, 2
%22 = sext i1 %21 to i32
%23 = icmp eq i32 %19, %22
br i1 %23, label %26, label %24
24: ; preds = %0
%25 = tail call i32 (...) @abort()
unreachable
26: ; preds = %0
ret i32 0
}