#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 dta2dtr();
int dtr2dta();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strstr(char *, char *);
int main(int argc, char *argv[]) {
  if (strstr(argv[0], "dtr2dta"))
    return dtr2dta();
  else if (strstr(argv[0], "dta2dtr"))
    return dta2dtr();
  else
    fprintf(stderr, "Unknown %s\n", argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe9c(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1182 <main+0x42>
mov    $0x0,%al
call   1030 <dtr2dta@plt>
mov    %eax,-0x4(%rbp)
jmp    11d6 <main+0x96>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe78(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11ae <main+0x6e>
mov    $0x0,%al
call   1050 <dta2dtr@plt>
mov    %eax,-0x4(%rbp)
jmp    11d6 <main+0x96>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe4b(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11cf <main+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     1160 <main+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1030 <dtr2dta@plt>
mov    (%rbx),%rdi
lea    0xe9e(%rip),%rsi
call   1060 <strstr@plt>
test   %rax,%rax
je     117c <main+0x3c>
xor    %eax,%eax
pop    %rbx
jmp    1050 <dta2dtr@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe81(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"dtr2dta\00"
@.str.1 = [8 x i8] c"dta2dtr\00"
@stderr = global i32 0
@.str.2 = [12 x i8] c"Unknown %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i64 @strstr(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @dtr2dta()
store i32 %12, i32* %3
br label %29
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i64 @strstr(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (...) @dta2dtr()
store i32 %20, i32* %3
br label %29
21: ; preds = %13
%22 = load i32, i32* @stderr
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %21
br label %28
28: ; preds = %27
store i32 0, i32* %3
br label %29
29: ; preds = %28, %19, %11
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [8 x i8] c"dtr2dta\00"
@.str.1 = [8 x i8] c"dta2dtr\00"
@stderr = global i32 0
@.str.2 = [12 x i8] c"Unknown %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strstr(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @dtr2dta()
br label %18
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i64 @strstr(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 (...) @dta2dtr()
br label %18
14: ; preds = %8
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %1
%17 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %14, %12, %6
%19 = phi i32 [ %7, %6 ], [ %13, %12 ], [ 0, %14 ]
ret i32 %19
}