#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_long(char *, long, char *);
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);
  char *signal = argv[3];
  undelete_for_long(path, offset, signal);
}


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)
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    11bd <main+0x8d>
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    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <undelete_for_long@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jg     1158 <main+0x18>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
jmp    118b <main+0x4b>
mov    %rsi,%rbx
mov    0x8(%rsi),%r14
mov    0x10(%rsi),%rdi
call   1060 <atoi@plt>
mov    %rax,%r15
lea    0xe8e(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbx),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <undelete_for_long@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
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
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = 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 %30
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
store i8* %16, i8** %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i64 @atoi(i8* %19)
store i64 %20, i64* %7
%21 = load i64, i64* %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %21)
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 3
%25 = load i8*, i8** %24
store i8* %25, i8** %8
%26 = load i8*, i8** %6
%27 = load i64, i64* %7
%28 = load i8*, i8** %8
%29 = call i32 @undelete_for_long(i8* %26, i64 %27, i8* %28)
br label %30
30: ; preds = %13, %11
%31 = load i32, i32* %3
ret i32 %31
}

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 %16
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 = getelementptr inbounds i8*, i8** %1, i64 3
%14 = load i8*, i8** %13
%15 = tail call i32 @undelete_for_long(i8* %8, i64 %11, i8* %14)
br label %16
16: ; preds = %6, %4
ret i32 0
}