#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*/ generate_control_file(int, char **);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcasecmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc < 12) {
    printf("Usage: control_gen <out_path> <package_name> <package_version> "
           "<section> <priority> <architecture> <depends> <install_size> "
           "<maintainer> <description> <long_description>\n");
    return -1;
  } else if (strcasecmp(argv[6], "i386") && strcasecmp(argv[6], "amd64")) {
    printf("Usage: make package DEBIAN_ARCHITECTURE=arch (i386 or amd64)\n");
    return -2;
  }
  generate_control_file(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11d4 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
lea    0xf34(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11bc <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
lea    0xf1b(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11bc <main+0x8c>
lea    0xf0b(%rip),%rdi
call   1040 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    11d4 <main+0xa4>
jmp    11c1 <main+0x91>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <generate_control_file@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0xb,%edi
jg     114c <main+0x1c>
lea    0xf08(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
jmp    119c <main+0x6c>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x30(%rsi),%rbx
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1190 <main+0x60>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1190 <main+0x60>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffffe,%eax
jmp    119c <main+0x6c>
mov    %ebp,%edi
mov    %r14,%rsi
call   1050 <generate_control_file@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [171 x i8] c"Usage: control_gen <out_path> <package_name> <package_version> <section> <priority> <architecture> <depends> <install_size> <maintainer> <description> <long_description>\0A\00"
@.str.1 = [5 x i8] c"i386\00"
@.str.2 = [6 x i8] c"amd64\00"
@.str.3 = [62 x i8] c"Usage: make package DEBIAN_ARCHITECTURE=arch (i386 or amd64)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 12
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %29
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 6
%13 = load i8*, i8** %12
%14 = call i64 @strcasecmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %10
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 6
%19 = load i8*, i8** %18
%20 = call i64 @strcasecmp(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
store i32 -2, i32* %3
br label %29
24: ; preds = %16, %10
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = load i8**, i8*** %5
%28 = call i32 @generate_control_file(i32 %26, i8** %27)
store i32 0, i32* %3
br label %29
29: ; preds = %25, %22, %8
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"i386\00"
@.str.2 = [6 x i8] c"amd64\00"
@str = [61 x i8] c"Usage: make package DEBIAN_ARCHITECTURE=arch (i386 or amd64)\00"
@str.4 = [170 x i8] c"Usage: control_gen <out_path> <package_name> <package_version> <section> <priority> <architecture> <depends> <install_size> <maintainer> <description> <long_description>\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 12
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([170 x i8], [170 x i8]* @str.4, i64 0, i64 0))
br label %18
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 6
%8 = load i8*, i8** %7
%9 = tail call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %6
%12 = tail call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
br label %18
16: ; preds = %6, %11
%17 = tail call i32 @generate_control_file(i32 %0, i8** %1)
br label %18
18: ; preds = %16, %14, %4
%19 = phi i32 [ -1, %4 ], [ -2, %14 ], [ 0, %16 ]
ret i32 %19
}