#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*/ execvp(char *, char **);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ read_yes_no();
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  for (int i = 1; i < argc; ++i) {
    fputs(argv[i], stdout);
    putchar(' ');
  }
  fputs("[y/n]", stdout);
  if (!read_yes_no())
    return 0;
  execvp(argv[1], &argv[1]);
  perror("execvp");
  return 1;
}


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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ab <main+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2e54(%rip),%rax
mov    (%rax),%esi
call   1050 <fputs@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x1d>
mov    0x2e2e(%rip),%rax
mov    (%rax),%esi
lea    0xe45(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x0,%al
call   1040 <read_yes_no@plt>
cmp    $0x0,%eax
jne    11dc <main+0x8c>
movl   $0x0,-0x4(%rbp)
jmp    1204 <main+0xb4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1070 <execvp@plt>
lea    0xe0e(%rip),%rdi
call   1060 <perror@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x2,%edi
jl     118f <main+0x3f>
mov    %edi,%ebp
mov    $0x1,%ebx
mov    0x2e73(%rip),%r15
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
mov    (%r15),%esi
call   1050 <fputs@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1170 <main+0x20>
mov    0x2e4a(%rip),%rax
mov    (%rax),%esi
lea    0xe61(%rip),%rdi
call   1050 <fputs@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <read_yes_no@plt>
test   %eax,%eax
jne    11be <main+0x6e>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%r14),%rdi
add    $0x8,%r14
mov    %r14,%rsi
call   1070 <execvp@plt>
lea    0xe31(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%ebp
jmp    11b1 <main+0x61>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"[y/n]\00"
@.str.1 = [7 x i8] c"execvp\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = load i32, i32* @stdout
%18 = call i32 @fputs(i8* %16, i32 %17)
%19 = call i32 @putchar(i8 signext 32)
br label %20
20: ; preds = %11
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %7
23: ; preds = %7
%24 = load i32, i32* @stdout
%25 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = call i32 (...) @read_yes_no()
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %23
store i32 0, i32* %3
br label %37
29: ; preds = %23
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = call i32 @execvp(i8* %32, i8** %34)
%36 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %37
37: ; preds = %29, %28
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"[y/n]\00"
@.str.1 = [7 x i8] c"execvp\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %11
6: ; preds = %11, %2
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 (...) @read_yes_no()
%10 = icmp eq i32 %9, 0
br i1 %10, label %25, label %20
11: ; preds = %4, %11
%12 = phi i64 [ 1, %4 ], [ %18, %11 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = load i32, i32* @stdout
%16 = tail call i32 @fputs(i8* %14, i32 %15)
%17 = tail call i32 @putchar(i8 signext 32)
%18 = add nuw nsw i64 %12, 1
%19 = icmp eq i64 %18, %5
br i1 %19, label %6, label %11
20: ; preds = %6
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = tail call i32 @execvp(i8* %22, i8** %21)
%24 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %6, %20
%26 = phi i32 [ 1, %20 ], [ 0, %6 ]
ret i32 %26
}