#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 *, char *);
char *strsub(char *, char *, char *);
char *strsub1(char *, char *, char *);
int main(int argc, char **argv) {
  printf("1 %s\n", strsub(argv[1], argv[2], argv[3]));
  printf("2 %s\n", strsub1(argv[1], argv[2], argv[3]));
  printf("3 %s\n", strsub1(argv[1], argv[2], argv[3]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1050 <strsub@plt>
mov    %rax,%rsi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1030 <strsub1@plt>
mov    %rax,%rsi
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1030 <strsub1@plt>
mov    %rax,%rsi
lea    0xe47(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
mov    0x18(%rbx),%rdx
call   1050 <strsub@plt>
lea    0xeb4(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
mov    0x18(%rbx),%rdx
call   1030 <strsub1@plt>
lea    0xe9a(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
mov    0x18(%rbx),%rdx
call   1030 <strsub1@plt>
lea    0xe80(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1 %s\0A\00"
@.str.1 = [6 x i8] c"2 %s\0A\00"
@.str.2 = [6 x i8] c"3 %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 2
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 3
%14 = load i8*, i8** %13
%15 = call i8* @strsub(i8* %8, i8* %11, i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 3
%25 = load i8*, i8** %24
%26 = call i8* @strsub1(i8* %19, i8* %22, i8* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 3
%36 = load i8*, i8** %35
%37 = call i8* @strsub1(i8* %30, i8* %33, i8* %36)
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"1 %s\0A\00"
@.str.1 = [6 x i8] c"2 %s\0A\00"
@.str.2 = [6 x i8] c"3 %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 3
%8 = load i8*, i8** %7
%9 = tail call i8* @strsub(i8* %4, i8* %6, i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = tail call i8* @strsub1(i8* %11, i8* %12, i8* %13)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %3
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = tail call i8* @strsub1(i8* %16, i8* %17, i8* %18)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %19)
ret i32 0
}