#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*/ copy(char *);
char toupper(char);
int main(int argc, char **argv) {
  char arch[3];
  if (argc < 2 || argv[1][0] != '-' || argv[1][1] != 'f') {
    copy(NULL);
    return 0;
  }
  arch[0] = toupper(argv[1][2]);
  arch[1] = toupper(argv[1][3]);
  arch[2] = '\0';
  copy(arch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1169 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1169 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x66,%eax
je     117e <main+0x5e>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <copy@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ba <main+0x9a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x2(%rax),%edi
call   1030 <toupper@plt>
mov    %al,-0x13(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x3(%rax),%edi
call   1030 <toupper@plt>
mov    %al,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
lea    -0x13(%rbp),%rdi
call   1040 <copy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x2,%edi
jl     1166 <main+0x46>
mov    %rsi,%rbx
mov    0x8(%rsi),%rax
cmpb   $0x2d,(%rax)
jne    1166 <main+0x46>
cmpb   $0x66,0x1(%rax)
jne    1166 <main+0x46>
movsbl 0x2(%rax),%edi
call   1030 <toupper@plt>
mov    %al,0xd(%rsp)
mov    0x8(%rbx),%rax
movsbl 0x3(%rax),%edi
call   1030 <toupper@plt>
mov    %al,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xd(%rsp),%rdi
jmp    1168 <main+0x48>
xor    %edi,%edi
call   1040 <copy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %25, label %9
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 45
br i1 %16, label %25, label %17
17: ; preds = %9
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 102
br i1 %24, label %25, label %27
25: ; preds = %17, %9, %2
%26 = call i32 @copy(i8* null)
store i32 0, i32* %3
br label %45
27: ; preds = %17
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = getelementptr inbounds i8, i8* %30, i64 2
%32 = load i8, i8* %31
%33 = call signext i8 @toupper(i8 signext %32)
%34 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
store i8 %33, i8* %34
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8, i8* %37, i64 3
%39 = load i8, i8* %38
%40 = call signext i8 @toupper(i8 signext %39)
%41 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 1
store i8 %40, i8* %41
%42 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 2
store i8 0, i8* %42
%43 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%44 = call i32 @copy(i8* %43)
store i32 0, i32* %3
br label %45
45: ; preds = %27, %25
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 45
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 102
br i1 %14, label %17, label %15
15: ; preds = %11, %6, %2
%16 = tail call i32 @copy(i8* null)
br label %28
17: ; preds = %11
%18 = getelementptr inbounds i8, i8* %8, i64 2
%19 = load i8, i8* %18
%20 = tail call signext i8 @toupper(i8 signext %19)
store i8 %20, i8* %4
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = tail call signext i8 @toupper(i8 signext %23)
%25 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %24, i8* %25
%26 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %26
%27 = call i32 @copy(i8* %4)
br label %28
28: ; preds = %17, %15
ret i32 0
}