#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*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c, i = 0;
  scanf("%d", &a);
  b = a;
  while (a != 1 && a != 2 && a != 3) {
    a /= 10;
  }
  if (a == 1)
    printf("The file in \"C:\\My Documents\\%d.txt\" is Tom's.", b);
  else if (a == 2)
    printf("The file in \"C:\\My Documents\\%d.txt\" is Mary's.", b);
  else if (a == 3)
    printf("The file in \"C:\\My Documents\\%d.txt\" is Jerry's.", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x15(%rbp)
je     1174 <main+0x54>
xor    %eax,%eax
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x15(%rbp)
je     1174 <main+0x54>
cmpl   $0x3,-0x8(%rbp)
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1184 <main+0x64>
jmp    1197 <main+0x77>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x2c>
cmpl   $0x1,-0x8(%rbp)
jne    11b5 <main+0x95>
mov    -0xc(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
cmpl   $0x2,-0x8(%rbp)
jne    11d3 <main+0xb3>
mov    -0xc(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
cmpl   $0x3,-0x8(%rbp)
jne    11ec <main+0xcc>
mov    -0xc(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
jmp    11f6 <main+0xd6>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x4(%rsi),%ecx
mov    %esi,%eax
cmp    $0xfffffffc,%ecx
ja     1175 <main+0x55>
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%eax
add    %edx,%ecx
add    $0xfffffffc,%ecx
cmp    $0xfffffffd,%ecx
jb     1150 <main+0x30>
mov    %eax,0x4(%rsp)
add    $0xffffffff,%eax
cmp    $0x2,%eax
ja     1192 <main+0x72>
cltq
lea    0xf0e(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [47 x i8] c"The file in \22C:\\My Documents\\%d.txt\22 is Tom's.\00"
@.str.2 = [48 x i8] c"The file in \22C:\\My Documents\\%d.txt\22 is Mary's.\00"
@.str.3 = [49 x i8] c"The file in \22C:\\My Documents\\%d.txt\22 is Jerry's.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
store i32 %7, i32* %3
br label %8
8: ; preds = %19, %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 3
br label %17
17: ; preds = %14, %11, %8
%18 = phi i1 [ false, %11 ], [ false, %8 ], [ %16, %14 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i32, i32* %2
%21 = sdiv i32 %20, 10
store i32 %21, i32* %2
br label %8
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %42
28: ; preds = %22
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 %32)
br label %41
34: ; preds = %28
%35 = load i32, i32* %2
%36 = icmp eq i32 %35, 3
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %3
%39 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %31
br label %42
42: ; preds = %41, %25
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [47 x i8] c"The file in \22C:\\My Documents\\%d.txt\22 is Tom's.\00"
@.str.2 = [48 x i8] c"The file in \22C:\\My Documents\\%d.txt\22 is Mary's.\00"
@.str.3 = [49 x i8] c"The file in \22C:\\My Documents\\%d.txt\22 is Jerry's.\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([47 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([48 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([49 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add i32 %4, -4
%6 = icmp ult i32 %5, -3
br i1 %6, label %7, label %13
7: ; preds = %0, %7
%8 = phi i32 [ %9, %7 ], [ %4, %0 ]
%9 = sdiv i32 %8, 10
%10 = add nsw i32 %9, -4
%11 = icmp ult i32 %10, -3
br i1 %11, label %7, label %12
12: ; preds = %7
store i32 %9, i32* %1
br label %13
13: ; preds = %12, %0
%14 = phi i32 [ %9, %12 ], [ %4, %0 ]
%15 = add i32 %14, -1
%16 = icmp ult i32 %15, 3
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = sext i32 %15 to i64
%19 = shl i64 %18, 2
%20 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %19)
%21 = call i32 @printf(i8* %20, i32 %4)
br label %22
22: ; preds = %13, %17
ret i32 0
}