#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 getFileType(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sclPush(char *, char *);
int /*<<< orphan*/ tapPush(char *, char *);
int /*<<< orphan*/ trdPush(char *, char *);
void push(char *ipath, char *fpath) {
  int type = getFileType(ipath);
  switch (type) {
  case 3:
    tapPush(ipath, fpath);
    break;
  case 1:
    sclPush(ipath, fpath);
    break;
  case 2:
    trdPush(ipath, fpath);
    break;
  default:
    printf("Unknown image type\n");
    break;
  }
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getFileType@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     11b4 <push+0x64>
jmp    1180 <push+0x30>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     11c6 <push+0x76>
jmp    1191 <push+0x41>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
jne    11d8 <push+0x88>
jmp    11a2 <push+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <tapPush@plt>
jmp    11e4 <push+0x94>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <sclPush@plt>
jmp    11e4 <push+0x94>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <trdPush@plt>
jmp    11e4 <push+0x94>
lea    0xe21(%rip),%rdi
call   1060 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <getFileType@plt>
cmp    $0x1,%eax
je     1180 <push+0x30>
cmp    $0x2,%eax
je     1192 <push+0x42>
cmp    $0x3,%eax
jne    11a4 <push+0x54>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <tapPush@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <sclPush@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <trdPush@plt>
lea    0xe55(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Unknown image type\0A\00"
define void @push(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @getFileType(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
switch i32 %8, label %21 [
i32 3, label %9
i32 1, label %13
i32 2, label %17
]
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @tapPush(i8* %10, i8* %11)
br label %23
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @sclPush(i8* %14, i8* %15)
br label %23
17: ; preds = %2
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @trdPush(i8* %18, i8* %19)
br label %23
21: ; preds = %2
%22 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %17, %13, %9
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Unknown image type\00"
define void @push(i8* %0, i8* %1) {
%3 = tail call i32 @getFileType(i8* %0)
switch i32 %3, label %10 [
i32 3, label %4
i32 1, label %6
i32 2, label %8
]
4: ; preds = %2
%5 = tail call i32 @tapPush(i8* %0, i8* %1)
br label %12
6: ; preds = %2
%7 = tail call i32 @sclPush(i8* %0, i8* %1)
br label %12
8: ; preds = %2
%9 = tail call i32 @trdPush(i8* %0, i8* %1)
br label %12
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6, %4
ret void
}