#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 */
long atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ undelete_for_short(char *, long);
int main(int argc, char *argv[]) {
  if (argc < 3) {
    printf("%s", "Please input the path and offset\nThe Byte will be replaced "
                 "by \"A\"\n");
    return 0;
  }
  char *path = argv[1];
  long offset = atoi(argv[2]);
  printf("%li", offset);
  undelete_for_short(path, offset);
}


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   $0x3,-0x8(%rbp)
jge    1171 <main+0x41>
lea    0xea9(%rip),%rdi
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ad <main+0x7d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <undelete_for_short@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jg     1157 <main+0x17>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
jmp    1183 <main+0x43>
mov    0x8(%rsi),%r14
mov    0x10(%rsi),%rdi
call   1060 <atoi@plt>
mov    %rax,%rbx
lea    0xe92(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <undelete_for_short@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [67 x i8] c"Please input the path and offset\0AThe Byte will be replaced by \22A\22\0A\00"
@.str.2 = [4 x i8] c"%li\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %25
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i64 @atoi(i8* %18)
store i64 %19, i64* %7
%20 = load i64, i64* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %20)
%22 = load i8*, i8** %6
%23 = load i64, i64* %7
%24 = call i32 @undelete_for_short(i8* %22, i64 %23)
br label %25
25: ; preds = %12, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%li\00"
@str = [66 x i8] c"Please input the path and offset\0AThe Byte will be replaced by \22A\22\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i64 @atoi(i8* %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %11)
%13 = tail call i32 @undelete_for_short(i8* %8, i64 %11)
br label %14
14: ; preds = %6, %4
ret i32 0
}