#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 *, ...);
void printDou(const char *str, const double val, int isln) {
  if (str != NULL) {
    printf("%s", str);
  } else {
  }
  printf("%f", val);
  if (isln == 1) {
    printf("\n");
  } else {
  }
}


x86 assembly (clang, -O0):
<printDou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <printDou+0x36>
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114b <printDou+0x3b>
jmp    114b <printDou+0x3b>
movsd  -0x10(%rbp),%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    117b <printDou+0x6b>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1180 <printDou+0x70>
jmp    1180 <printDou+0x70>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDou>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
test   %rdi,%rdi
je     1149 <printDou+0x29>
mov    %rdi,%rsi
lea    0xeca(%rip),%rdi
xor    %eax,%eax
movsd  %xmm0,0x8(%rsp)
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
lea    0xeb3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmp    $0x1,%ebx
jne    116b <printDou+0x4b>
mov    $0xa,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @printDou(i8* %0, double %1, i32 %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca i32
store i8* %0, i8** %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %13
12: ; preds = %3
br label %13
13: ; preds = %12, %9
%14 = load double, double* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %14)
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %21
20: ; preds = %13
br label %21
21: ; preds = %20, %18
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%f\00"
define void @printDou(i8* %0, double %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %3, %5
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %1)
%9 = icmp eq i32 %2, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @putchar(i32 10)
br label %12
12: ; preds = %7, %10
ret void
}