#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*/ convSint2long();
int /*<<< orphan*/ convSlong2doub();
int /*<<< orphan*/ convUint2long();
int /*<<< orphan*/ convUlong2doub();
void DoDoubConv(char type, char zunsign) {
  if (type == 2 || type == 3) {
    if (zunsign)
      convUint2long();
    else
      convSint2long();
  }
  if (zunsign)
    convUlong2doub();
  else
    convSlong2doub();
}


x86 assembly (clang, -O0):
<DoDoubConv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2,%eax
je     116e <DoDoubConv+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x3,%eax
jne    1190 <DoDoubConv+0x50>
cmpb   $0x0,-0x2(%rbp)
je     1184 <DoDoubConv+0x44>
mov    $0x0,%al
call   1050 <convUint2long@plt>
jmp    118b <DoDoubConv+0x4b>
mov    $0x0,%al
call   1030 <convSint2long@plt>
jmp    1190 <DoDoubConv+0x50>
cmpb   $0x0,-0x2(%rbp)
je     11a6 <DoDoubConv+0x66>
mov    $0x0,%al
call   1040 <convUlong2doub@plt>
jmp    11ad <DoDoubConv+0x6d>
mov    $0x0,%al
call   1060 <convSlong2doub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoDoubConv>:
push   %rax
and    $0xfe,%dil
cmp    $0x2,%dil
jne    1159 <DoDoubConv+0x19>
xor    %eax,%eax
test   %sil,%sil
je     1166 <DoDoubConv+0x26>
call   1050 <convUint2long@plt>
jmp    115e <DoDoubConv+0x1e>
test   %sil,%sil
je     116b <DoDoubConv+0x2b>
xor    %eax,%eax
pop    %rcx
jmp    1040 <convUlong2doub@plt>
call   1030 <convSint2long@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <convSlong2doub@plt>

LLVM IR (-O0):
define void @DoDoubConv(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 2
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %20
12: ; preds = %8, %2
%13 = load i8, i8* %4
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (...) @convUint2long()
br label %19
17: ; preds = %12
%18 = call i32 (...) @convSint2long()
br label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %19, %8
%21 = load i8, i8* %4
%22 = icmp ne i8 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @convUlong2doub()
br label %27
25: ; preds = %20
%26 = call i32 (...) @convSlong2doub()
br label %27
27: ; preds = %25, %23
ret void
}

LLVM IR (-O2):
define void @DoDoubConv(i8 signext %0, i8 signext %1) {
%3 = and i8 %0, -2
%4 = icmp eq i8 %3, 2
%5 = icmp eq i8 %1, 0
br i1 %4, label %6, label %11
6: ; preds = %2
br i1 %5, label %9, label %7
7: ; preds = %6
%8 = tail call i32 (...) @convUint2long()
br label %12
9: ; preds = %6
%10 = tail call i32 (...) @convSint2long()
br label %14
11: ; preds = %2
br i1 %5, label %14, label %12
12: ; preds = %7, %11
%13 = tail call i32 (...) @convUlong2doub()
br label %16
14: ; preds = %9, %11
%15 = tail call i32 (...) @convSlong2doub()
br label %16
16: ; preds = %14, %12
ret void
}