#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*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char name[16] = {0};
  int i = 0;
  if (1 == argc)
    exit(1);
  while (argv[1][i] != '\\') {
    name[i] = argv[1][i];
    i++;
  }
  printf(name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movl   $0x0,-0x24(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1175 <main+0x45>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    117a <main+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
je     11b8 <main+0x88>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x20(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117a <main+0x4a>
lea    -0x20(%rbp),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
cmp    $0x1,%edi
je     1160 <main+0x40>
mov    0x8(%rsi),%rax
mov    (%rax),%cl
cmp    $0x5c,%cl
je     1151 <main+0x31>
xor    %edx,%edx
nopl   (%rax)
mov    %cl,(%rsp,%rdx,1)
movzbl 0x1(%rax,%rdx,1),%ecx
add    $0x1,%rdx
cmp    $0x5c,%cl
jne    1140 <main+0x20>
mov    %rsp,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [16 x i8]* %6 to i8*
store i32 0, i32* %7
%9 = load i32, i32* %4
%10 = icmp eq i32 1, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
br label %14
14: ; preds = %24, %13
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 92
br i1 %23, label %24, label %37
24: ; preds = %14
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = load i8, i8* %30
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 %33
store i8 %31, i8* %34
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %14
37: ; preds = %14
%38 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%39 = call i32 @printf(i8* %38)
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 1
br i1 %5, label %11, 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, 92
br i1 %10, label %21, label %13
11: ; preds = %2
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %6, %13
%14 = phi i64 [ %17, %13 ], [ 0, %6 ]
%15 = phi i8 [ %19, %13 ], [ %9, %6 ]
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %14
store i8 %15, i8* %16
%17 = add nuw nsw i64 %14, 1
%18 = getelementptr inbounds i8, i8* %8, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 92
br i1 %20, label %21, label %13
21: ; preds = %13, %6
%22 = call i32 @printf(i8* %4)
ret i32 0
}