int create_file_if_needed(in_name, out_name, array)
char *in_name, *out_name;
short **array;
{
  if (is_a_tiff(in_name)) {
    create_tiff_file_if_needed(in_name, out_name, array);
  }
  if (is_a_bmp(in_name)) {
    create_bmp_file_if_needed(in_name, out_name, array);
  }
  return (1);
}


x86 assembly (clang, -O0):
<create_file_if_needed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <is_a_tiff@plt>
cmp    $0x0,%eax
je     117b <create_file_if_needed+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <create_tiff_file_if_needed@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <is_a_bmp@plt>
cmp    $0x0,%eax
je     11a2 <create_file_if_needed+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <create_bmp_file_if_needed@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_file_if_needed>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <is_a_tiff@plt>
test   %eax,%eax
je     1169 <create_file_if_needed+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <create_tiff_file_if_needed@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <is_a_bmp@plt>
test   %eax,%eax
je     1187 <create_file_if_needed+0x47>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <create_bmp_file_if_needed@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @create_file_if_needed(i8* %0, i8* %1, i16** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i16** %2, i16*** %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @is_a_tiff to i32 (i8*, ...)*)(i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i16**, i16*** %6
%14 = call i32 (i8*, i8*, i16**, ...) bitcast (i32 (...)* @create_tiff_file_if_needed to i32 (i8*, i8*, i16**, ...)*)(i8* %11, i8* %12, i16** %13)
br label %15
15: ; preds = %10, %3
%16 = load i8*, i8** %4
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @is_a_bmp to i32 (i8*, ...)*)(i8* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = load i16**, i16*** %6
%23 = call i32 (i8*, i8*, i16**, ...) bitcast (i32 (...)* @create_bmp_file_if_needed to i32 (i8*, i8*, i16**, ...)*)(i8* %20, i8* %21, i16** %22)
br label %24
24: ; preds = %19, %15
ret i32 1
}

LLVM IR (-O2):
define i32 @create_file_if_needed(i8* %0, i8* %1, i16** %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_a_tiff to i32 (i8*, ...)*)(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, i8*, i16**, ...) bitcast (i32 (...)* @create_tiff_file_if_needed to i32 (i8*, i8*, i16**, ...)*)(i8* %0, i8* %1, i16** %2)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_a_bmp to i32 (i8*, ...)*)(i8* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 (i8*, i8*, i16**, ...) bitcast (i32 (...)* @create_bmp_file_if_needed to i32 (i8*, i8*, i16**, ...)*)(i8* %0, i8* %1, i16** %2)
br label %13
13: ; preds = %11, %8
ret i32 1
}