#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*/ execle(char *, char *, char *, int /*<<< orphan*/, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[], char *envp[]) {
  printf("Будет выполнена программа %s\n", argv[1]);
  printf("Argument count: %d\n\n", argc);
  execle(argv[1], argv[1], argv[0], 0, envp);
  printf("Ошибка!!! \n");
  exit(-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)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%r8
xor    %ecx,%ecx
call   1050 <execle@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rsi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rdx
mov    0x8(%rbx),%rdi
mov    %rdi,%rsi
xor    %ecx,%ecx
mov    %r14,%r8
call   1060 <execle@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"\D0\91\D1\83\D0\B4\D0\B5\D1\82 \D0\B2\D1\8B\D0\BF\D0\BE\D0\BB\D0\BD\D0\B5\D0\BD\D0\B0 \D0\BF\D1\80\D0\BE\D0\B3\D1\80\D0\B0\D0\BC\D0\BC\D0\B0 %s\0A\00"
@.str.1 = [21 x i8] c"Argument count: %d\0A\0A\00"
@.str.2 = [18 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0!!! \0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i8**, i8*** %6
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %6
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %7
%24 = call i32 @execle(i8* %16, i8* %19, i8* %22, i32 0, i8** %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"\D0\91\D1\83\D0\B4\D0\B5\D1\82 \D0\B2\D1\8B\D0\BF\D0\BE\D0\BB\D0\BD\D0\B5\D0\BD\D0\B0 \D0\BF\D1\80\D0\BE\D0\B3\D1\80\D0\B0\D0\BC\D0\BC\D0\B0 %s\0A\00"
@.str.1 = [21 x i8] c"Argument count: %d\0A\0A\00"
@str = [17 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0!!! \00"
define i32 @main(i32 %0, i8** nocapture %1, i8** %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %1
%10 = tail call i32 @execle(i8* %8, i8* %8, i8* %9, i32 0, i8** %2)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 -1)
unreachable
}