#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 create_cascade_homotopy();
int create_homotopy();
int write_standard_start_system();
int write_standard_target_system();
int create_the_homotopy(int kind) {
  int fail;
  if (kind < 4)
    fail = create_homotopy();
  else if (kind == 4)
    fail = create_cascade_homotopy();
  else
    return 1;
  if (fail == 0) {
    fail = write_standard_target_system();
    fail = write_standard_start_system();
  }
  return fail;
}


x86 assembly (clang, -O0):
<create_the_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1164 <create_the_homotopy+0x24>
mov    $0x0,%al
call   1060 <create_homotopy@plt>
mov    %eax,-0xc(%rbp)
jmp    118e <create_the_homotopy+0x4e>
cmpl   $0x4,-0x8(%rbp)
jne    117d <create_the_homotopy+0x3d>
mov    $0x0,%al
call   1030 <create_cascade_homotopy@plt>
mov    %eax,-0xc(%rbp)
jmp    1189 <create_the_homotopy+0x49>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <create_the_homotopy+0x72>
jmp    118e <create_the_homotopy+0x4e>
cmpl   $0x0,-0xc(%rbp)
jne    11ac <create_the_homotopy+0x6c>
mov    $0x0,%al
call   1040 <write_standard_target_system@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <write_standard_start_system@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_the_homotopy>:
push   %rax
cmp    $0x3,%edi
jg     1153 <create_the_homotopy+0x13>
xor    %eax,%eax
call   1060 <create_homotopy@plt>
test   %eax,%eax
jne    1168 <create_the_homotopy+0x28>
jmp    116a <create_the_homotopy+0x2a>
mov    $0x1,%eax
cmp    $0x4,%edi
jne    1168 <create_the_homotopy+0x28>
xor    %eax,%eax
call   1030 <create_cascade_homotopy@plt>
test   %eax,%eax
je     116a <create_the_homotopy+0x2a>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <write_standard_target_system@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <write_standard_start_system@plt>

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

LLVM IR (-O2):
define i32 @create_the_homotopy(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @create_homotopy()
br label %9
5: ; preds = %1
%6 = icmp eq i32 %0, 4
br i1 %6, label %7, label %15
7: ; preds = %5
%8 = tail call i32 (...) @create_cascade_homotopy()
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %4, %3 ], [ %8, %7 ]
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i32 (...) @write_standard_target_system()
%14 = tail call i32 (...) @write_standard_start_system()
br label %15
15: ; preds = %9, %12, %5
%16 = phi i32 [ 1, %5 ], [ %14, %12 ], [ %10, %9 ]
ret i32 %16
}