#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*/ die(char *);
scalar_t__ execvp(char *, char **);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ warn(char *);
void args_exec_commands(int argc, char **argv) {
  if (argc < 2)
    return;
  if (!strcmp(argv[1], "init")) {
    warn("prefer 'jgmenu_run init' to 'jgmenu init'");
    if (execvp("jgmenu_run", argv) < 0)
      die("cannot exec jgmenu_run");
  }
}


x86 assembly (clang, -O0):
<args_exec_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    115e <args_exec_commands+0x1e>
jmp    11b2 <args_exec_commands+0x72>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe93(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11b2 <args_exec_commands+0x72>
lea    0xe83(%rip),%rdi
call   1030 <warn@plt>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1060 <execvp@plt>
cmp    $0x0,%rax
jge    11ad <args_exec_commands+0x6d>
lea    0xe87(%rip),%rdi
call   1050 <die@plt>
jmp    11b2 <args_exec_commands+0x72>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_exec_commands>:
push   %rbx
cmp    $0x2,%edi
jl     117d <args_exec_commands+0x3d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    117d <args_exec_commands+0x3d>
lea    0xea1(%rip),%rdi
call   1030 <warn@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
call   1060 <execvp@plt>
test   %rax,%rax
js     117f <args_exec_commands+0x3f>
pop    %rbx
ret
lea    0xea9(%rip),%rdi
pop    %rbx
jmp    1050 <die@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"init\00"
@.str.1 = [42 x i8] c"prefer 'jgmenu_run init' to 'jgmenu init'\00"
@.str.2 = [11 x i8] c"jgmenu_run\00"
@.str.3 = [23 x i8] c"cannot exec jgmenu_run\00"
define void @args_exec_commands(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %2
br label %22
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %22, label %14
14: ; preds = %8
%15 = call i32 @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8**, i8*** %4
%17 = call i64 @execvp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %16)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %21
21: ; preds = %19, %14
br label %22
22: ; preds = %7, %21, %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"init\00"
@.str.1 = [42 x i8] c"prefer 'jgmenu_run init' to 'jgmenu init'\00"
@.str.2 = [11 x i8] c"jgmenu_run\00"
@.str.3 = [23 x i8] c"cannot exec jgmenu_run\00"
define void @args_exec_commands(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = tail call i32 @warn(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i64 @execvp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %1)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = tail call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %9, %13, %2, %4
ret void
}