#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*/ func(char *, char *, ...);
int main(int argc, char *argv[]) {
  if (argc <= 3) {
    return 1;
  }
  func(argv[0], argv[1], argv[2]);
  func(argv[0], (argv[1]));
  if (argc == 2)
    return 2;
  for (int i = 0; i < 10; i++)
    ;
  return 0;
}


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)
cmpl   $0x3,-0x8(%rbp)
jg     113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <main+0xa1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    $0x0,%al
call   1030 <func@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0x0,%al
call   1030 <func@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1186 <main+0x76>
movl   $0x2,-0x4(%rbp)
jmp    11b1 <main+0xa1>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    11aa <main+0x9a>
jmp    119c <main+0x8c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118d <main+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x4,%edi
jl     1142 <main+0x32>
mov    %rsi,%rbx
mov    (%rsi),%rdi
mov    0x8(%rsi),%rsi
mov    0x10(%rbx),%rdx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <func@plt>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
xor    %eax,%eax
call   1030 <func@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 3
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %40
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 (i8*, i8*, ...) @func(i8* %13, i8* %16, i8* %19)
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 (i8*, i8*, ...) @func(i8* %23, i8* %26)
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 2
br i1 %29, label %30, label %31
30: ; preds = %10
store i32 2, i32* %3
br label %40
31: ; preds = %10
store i32 0, i32* %6
br label %32
32: ; preds = %36, %31
%33 = load i32, i32* %6
%34 = icmp slt i32 %33, 10
br i1 %34, label %35, label %39
35: ; preds = %32
br label %36
36: ; preds = %35
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %32
39: ; preds = %32
store i32 0, i32* %3
br label %40
40: ; preds = %39, %30, %9
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, i8*, ...) @func(i8* %5, i8* %7, i8* %9)
%11 = load i8*, i8** %1
%12 = load i8*, i8** %6
%13 = tail call i32 (i8*, i8*, ...) @func(i8* %11, i8* %12)
br label %14
14: ; preds = %4, %2
%15 = phi i32 [ 1, %2 ], [ 0, %4 ]
ret i32 %15
}