#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 PR10379_g();
void PR10379_f(int *len) {
  int new_len;
  for (int i = 0; i < 42 && PR10379_g() == 0; i++) {
    if (PR10379_g() == 1)
      continue;
    if (PR10379_g() == 2)
      PR10379_f(&new_len);
    else if (PR10379_g() == 3)
      PR10379_f(&new_len);
    *len += new_len;
  }
}


x86 assembly (clang, -O0):
<PR10379_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x2a,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jge    1152 <PR10379_f+0x32>
mov    $0x0,%al
call   1040 <PR10379_g@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1162 <PR10379_f+0x42>
jmp    11cc <PR10379_f+0xac>
mov    $0x0,%al
call   1040 <PR10379_g@plt>
cmp    $0x1,%eax
jne    1177 <PR10379_f+0x57>
jmp    11be <PR10379_f+0x9e>
mov    $0x0,%al
call   1040 <PR10379_g@plt>
cmp    $0x2,%eax
jne    1195 <PR10379_f+0x75>
lea    -0xc(%rbp),%rdi
call   1030 <PR10379_f@plt>
jmp    11b3 <PR10379_f+0x93>
mov    $0x0,%al
call   1040 <PR10379_g@plt>
cmp    $0x3,%eax
jne    11ae <PR10379_f+0x8e>
lea    -0xc(%rbp),%rdi
call   1030 <PR10379_f@plt>
jmp    11b3 <PR10379_f+0x93>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <PR10379_f+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR10379_f>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x2a,%ebp
lea    0xc(%rsp),%r14
jmp    1153 <PR10379_f+0x33>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <PR10379_f@plt>
mov    0xc(%rsp),%eax
add    %eax,(%rbx)
add    $0xffffffff,%ebp
je     1184 <PR10379_f+0x64>
xor    %eax,%eax
call   1040 <PR10379_g@plt>
test   %eax,%eax
jne    1184 <PR10379_f+0x64>
xor    %eax,%eax
call   1040 <PR10379_g@plt>
cmp    $0x1,%eax
je     114e <PR10379_f+0x2e>
xor    %eax,%eax
call   1040 <PR10379_g@plt>
cmp    $0x2,%eax
je     1140 <PR10379_f+0x20>
xor    %eax,%eax
call   1040 <PR10379_g@plt>
cmp    $0x3,%eax
je     1140 <PR10379_f+0x20>
jmp    1148 <PR10379_f+0x28>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @PR10379_f(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %31, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 42
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i32 (...) @PR10379_g()
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %34
13: ; preds = %11
%14 = call i32 (...) @PR10379_g()
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
br label %31
17: ; preds = %13
%18 = call i32 (...) @PR10379_g()
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %21
20: ; preds = %17
br label %26
21: ; preds = %17
%22 = call i32 (...) @PR10379_g()
%23 = icmp eq i32 %22, 3
br i1 %23, label %24, label %25
24: ; preds = %21
br label %25
25: ; preds = %24, %21
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %3
%28 = load i32*, i32** %2
%29 = load i32, i32* %28
%30 = add nsw i32 %29, %27
store i32 %30, i32* %28
br label %31
31: ; preds = %26, %16
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %5
34: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @PR10379_f(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %1, %23
%5 = phi i32 [ 0, %1 ], [ %24, %23 ]
%6 = tail call i32 (...) @PR10379_g()
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %23, %4
ret void
9: ; preds = %4
%10 = tail call i32 (...) @PR10379_g()
%11 = icmp eq i32 %10, 1
br i1 %11, label %23, label %12
12: ; preds = %9
%13 = tail call i32 (...) @PR10379_g()
%14 = icmp eq i32 %13, 2
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = tail call i32 (...) @PR10379_g()
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15, %12
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %2
%21 = load i32, i32* %0
%22 = add nsw i32 %21, %20
store i32 %22, i32* %0
br label %23
23: ; preds = %9, %19
%24 = add nuw nsw i32 %5, 1
%25 = icmp eq i32 %24, 42
br i1 %25, label %8, label %4
}