#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*/ printf(char *, int, int);
scalar_t__ test_packet_processing();
scalar_t__ test_vector();
int main(int argc, char *argv[]) {
  int passed = 0;
  int failed = 0;
  (test_vector() ? ++passed : ++failed);
  ;
  (test_packet_processing() ? ++passed : ++failed);
  ;
  printf("Passed: %d\n"
         "Failed: %d\n",
         passed, failed);
  return failed;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <test_vector@plt>
cmp    $0x0,%rax
je     1173 <main+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117c <main+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <test_packet_processing@plt>
cmp    $0x0,%rax
je     119b <main+0x6b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a4 <main+0x74>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <test_vector@plt>
xor    %r14d,%r14d
xor    %ebp,%ebp
test   %rax,%rax
sete   %r14b
setne  %bpl
xor    %eax,%eax
call   1050 <test_packet_processing@plt>
mov    $0x2,%esi
sub    %r14d,%esi
lea    0x1(%r14),%ebx
test   %rax,%rax
cmove  %ebp,%esi
cmovne %r14d,%ebx
lea    0xe91(%rip),%rdi
mov    %ebx,%edx
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Passed: %d\0AFailed: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = call i64 (...) @test_vector()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
br label %16
13: ; preds = %2
%14 = load i32, i32* %7
%15 = add nsw i32 %14, 1
store i32 %15, i32* %7
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = call i64 (...) @test_packet_processing()
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %26
23: ; preds = %16
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %26
26: ; preds = %23, %20
%27 = phi i32 [ %22, %20 ], [ %25, %23 ]
%28 = load i32, i32* %6
%29 = load i32, i32* %7
%30 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %28, i32 %29)
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
@.str = [23 x i8] c"Passed: %d\0AFailed: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @test_vector()
%4 = icmp eq i64 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = zext i1 %4 to i32
%8 = tail call i64 (...) @test_packet_processing()
%9 = icmp eq i64 %8, 0
%10 = select i1 %4, i32 1, i32 2
%11 = select i1 %4, i32 2, i32 1
%12 = select i1 %9, i32 %6, i32 %10
%13 = select i1 %9, i32 %11, i32 %7
%14 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i32 %13
}