#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*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int strlen(char *);
char strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  if (argc != 2)
    return (0);
  static char c[512];
  char tmp[4];
  tmp[3] = '\0';
  int len = strlen(argv[1]);
  int index = 0;
  for (int i = 0; i < len;) {
    if (argv[1][i] != '\\') {
      c[index++] = argv[1][i++];
      continue;
    }
    memcpy(&tmp[0], &argv[1][i + 1], 3);
    c[index++] = strtoul(&tmp[0], NULL, 8);
    i += 4;
  }
  c[index] = '\0';
  printf("%s\n", c);
  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)
je     116c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    126d <main+0x12d>
movb   $0x0,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1244 <main+0x104>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
je     11e9 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x20(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
movslq %eax,%rcx
lea    0x2e6f(%rip),%rax
mov    %dl,(%rax,%rcx,1)
jmp    118e <main+0x4e>
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
add    %rax,%rsi
mov    $0x3,%edx
call   1050 <memcpy@plt>
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x8,%edx
call   1060 <strtoul@plt>
mov    %al,%dl
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
movslq %eax,%rcx
lea    0x2e1d(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x20(%rbp)
jmp    118e <main+0x4e>
movslq -0x1c(%rbp),%rcx
lea    0x2e01(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0xda6(%rip),%rdi
lea    0x2def(%rip),%rsi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    1217 <main+0xd7>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
movb   $0x0,0x7(%rsp)
mov    0x8(%rsi),%rdi
call   1030 <strlen@plt>
xor    %r13d,%r13d
test   %eax,%eax
jle    11f0 <main+0xb0>
mov    %eax,%r8d
lea    0x2ed6(%rip),%rbx
movabs $0x100000000,%r15
xor    %ebp,%ebp
jmp    11a1 <main+0x61>
nopl   0x0(%rax,%rax,1)
mov    %al,(%rbx)
add    $0x1,%rbx
add    %r15,%rbp
mov    %ecx,%r13d
cmp    %r8d,%ecx
jge    11e9 <main+0xa9>
mov    0x8(%r12),%rsi
movslq %r13d,%rcx
movzbl (%rsi,%rcx,1),%eax
add    $0x1,%ecx
cmp    $0x5c,%al
jne    1190 <main+0x50>
movslq %ecx,%rax
add    %rax,%rsi
lea    0x4(%rsp),%rdi
mov    %r8d,%r14d
mov    $0x3,%edx
call   1050 <memcpy@plt>
lea    0x4(%rsp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1060 <strtoul@plt>
mov    %r14d,%r8d
add    $0x4,%r13d
mov    %r13d,%ecx
jmp    1190 <main+0x50>
sar    $0x20,%rbp
mov    %rbp,%r13
lea    0x2e59(%rip),%rsi
movb   $0x0,0x0(%r13,%rsi,1)
lea    0xdfc(%rip),%rdi
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
@main.c = internal global [512 x i8] zeroinitializer
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %69
13: ; preds = %2
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 3
store i8 0, i8* %14
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strlen(i8* %17)
store i32 %18, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %19
19: ; preds = %46, %33, %13
%20 = load i32, i32* %9
%21 = load i32, i32* %7
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %64
23: ; preds = %19
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 92
br i1 %32, label %33, label %46
33: ; preds = %23
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds i8, i8* %36, i64 %39
%41 = load i8, i8* %40
%42 = load i32, i32* %8
%43 = add nsw i32 %42, 1
store i32 %43, i32* %8
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds [512 x i8], [512 x i8]* @main.c, i64 0, i64 %44
store i8 %41, i8* %45
br label %19
46: ; preds = %23
%47 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %50, i64 %53
%55 = call i32 @memcpy(i8* %47, i8* %54, i32 3)
%56 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%57 = call signext i8 @strtoul(i8* %56, i32* null, i32 8)
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 1
store i32 %59, i32* %8
%60 = sext i32 %58 to i64
%61 = getelementptr inbounds [512 x i8], [512 x i8]* @main.c, i64 0, i64 %60
store i8 %57, i8* %61
%62 = load i32, i32* %9
%63 = add nsw i32 %62, 4
store i32 %63, i32* %9
br label %19
64: ; preds = %19
%65 = load i32, i32* %8
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [512 x i8], [512 x i8]* @main.c, i64 0, i64 %66
store i8 0, i8* %67
%68 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([512 x i8], [512 x i8]* @main.c, i64 0, i64 0))
store i32 0, i32* %3
br label %69
69: ; preds = %64, %12
%70 = load i32, i32* %3
ret i32 %70
}

LLVM IR (-O2):
@main.c = internal global [512 x i8] zeroinitializer
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x i8]
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %40
5: ; preds = %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 0, i8* %7
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strlen(i8* %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %19, label %15
12: ; preds = %28
%13 = shl i64 %32, 32
%14 = ashr exact i64 %13, 32
br label %15
15: ; preds = %12, %5
%16 = phi i64 [ 0, %5 ], [ %14, %12 ]
%17 = getelementptr inbounds [512 x i8], [512 x i8]* @main.c, i64 0, i64 %16
store i8 0, i8* %17
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([512 x i8], [512 x i8]* @main.c, i64 0, i64 0))
br label %40
19: ; preds = %5, %28
%20 = phi i64 [ %32, %28 ], [ 0, %5 ]
%21 = phi i32 [ %30, %28 ], [ 0, %5 ]
%22 = load i8*, i8** %8
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds i8, i8* %22, i64 %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 92
%27 = add nsw i32 %21, 1
br i1 %26, label %34, label %28
28: ; preds = %19, %34
%29 = phi i8 [ %38, %34 ], [ %25, %19 ]
%30 = phi i32 [ %39, %34 ], [ %27, %19 ]
%31 = getelementptr inbounds [512 x i8], [512 x i8]* @main.c, i64 0, i64 %20
store i8 %29, i8* %31
%32 = add nuw i64 %20, 1
%33 = icmp slt i32 %30, %10
br i1 %33, label %19, label %12
34: ; preds = %19
%35 = sext i32 %27 to i64
%36 = getelementptr inbounds i8, i8* %22, i64 %35
%37 = call i32 @memcpy(i8* %6, i8* %36, i32 3)
%38 = call signext i8 @strtoul(i8* nocapture %6, i32* null, i32 8)
%39 = add nsw i32 %21, 4
br label %28
40: ; preds = %2, %15
ret i32 0
}