#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 dobldobl_assign_labels(int, int);
int quaddobl_assign_labels(int, int);
int standard_assign_labels(int, int);
int assign_labels(int n, int nbsols, int precision) {
  if (precision == 0)
    return standard_assign_labels(n, nbsols);
  if (precision == 1)
    return dobldobl_assign_labels(n, nbsols);
  if (precision == 2)
    return quaddobl_assign_labels(n, nbsols);
  return -1;
}


x86 assembly (clang, -O0):
<assign_labels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    115e <assign_labels+0x2e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <standard_assign_labels@plt>
mov    %eax,-0x4(%rbp)
jmp    119f <assign_labels+0x6f>
cmpl   $0x1,-0x10(%rbp)
jne    117b <assign_labels+0x4b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <dobldobl_assign_labels@plt>
mov    %eax,-0x4(%rbp)
jmp    119f <assign_labels+0x6f>
cmpl   $0x2,-0x10(%rbp)
jne    1198 <assign_labels+0x68>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <quaddobl_assign_labels@plt>
mov    %eax,-0x4(%rbp)
jmp    119f <assign_labels+0x6f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_labels>:
cmp    $0x2,%edx
je     1143 <assign_labels+0x13>
cmp    $0x1,%edx
je     1148 <assign_labels+0x18>
test   %edx,%edx
jne    114d <assign_labels+0x1d>
jmp    1030 <standard_assign_labels@plt>
jmp    1050 <quaddobl_assign_labels@plt>
jmp    1040 <dobldobl_assign_labels@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @assign_labels(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @standard_assign_labels(i32 %11, i32 %12)
store i32 %13, i32* %4
br label %29
14: ; preds = %3
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 @dobldobl_assign_labels(i32 %18, i32 %19)
store i32 %20, i32* %4
br label %29
21: ; preds = %14
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = call i32 @quaddobl_assign_labels(i32 %25, i32 %26)
store i32 %27, i32* %4
br label %29
28: ; preds = %21
store i32 -1, i32* %4
br label %29
29: ; preds = %28, %24, %17, %10
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @assign_labels(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %10 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
]
4: ; preds = %3
%5 = tail call i32 @standard_assign_labels(i32 %0, i32 %1)
br label %10
6: ; preds = %3
%7 = tail call i32 @dobldobl_assign_labels(i32 %0, i32 %1)
br label %10
8: ; preds = %3
%9 = tail call i32 @quaddobl_assign_labels(i32 %0, i32 %1)
br label %10
10: ; preds = %3, %8, %6, %4
%11 = phi i32 [ %5, %4 ], [ %7, %6 ], [ %9, %8 ], [ -1, %3 ]
ret i32 %11
}