#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*/ execlp(char *, char *, char *, char *, char *, char *,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main() {
  int i;
  fprintf(stdout, "I'm a.out\n");
  fflush(stdout);
  execlp("myargprint", "myargprint", "10", "20", "-a", "-b", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xea2(%rip),%rsi
lea    0xea6(%rip),%rdx
lea    0xea2(%rip),%rcx
lea    0xe9e(%rip),%r8
lea    0xe9a(%rip),%r9
xor    %eax,%eax
mov    %rsi,%rdi
movq   $0x0,(%rsp)
call   1050 <execlp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ea4(%rip),%rbx
mov    (%rbx),%edi
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
movq   $0x0,(%rsp)
lea    0xeab(%rip),%rdi
lea    0xeaf(%rip),%rdx
lea    0xeab(%rip),%rcx
lea    0xea7(%rip),%r8
lea    0xea3(%rip),%r9
mov    %rdi,%rsi
call   1050 <execlp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [11 x i8] c"I'm a.out\0A\00"
@.str.1 = [11 x i8] c"myargprint\00"
@.str.2 = [3 x i8] c"10\00"
@.str.3 = [3 x i8] c"20\00"
@.str.4 = [3 x i8] c"-a\00"
@.str.5 = [3 x i8] c"-b\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @execlp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [11 x i8] c"I'm a.out\0A\00"
@.str.1 = [11 x i8] c"myargprint\00"
@.str.2 = [3 x i8] c"10\00"
@.str.3 = [3 x i8] c"20\00"
@.str.4 = [3 x i8] c"-a\00"
@.str.5 = [3 x i8] c"-b\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @execlp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* null)
ret i32 0
}