#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 */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *, char *,
                            char *);
int /*<<< orphan*/ stderr;
scalar_t__ system(char *);
int main(int argc, char *argv[]) {
  char *prog, *arch, *def, *name, *lib;
  char s[1024];
  if (argc != 6) {
    fprintf(stderr, "bad number of arguments");
    exit(EXIT_FAILURE);
  }
  prog = argv[1];
  arch = argv[2];
  def = argv[3];
  name = argv[4];
  lib = argv[5];
  snprintf(s, sizeof(s), "\"%s\" /machine:%s /def:%s /name:%s /out:%s", prog,
           arch, def, name, lib);
  if (system(s)) {
    fprintf(stderr, "%s failed\n", s);
    exit(EXIT_FAILURE);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     1188 <main+0x48>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x38(%rbp)
lea    -0x440(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    -0x38(%rbp),%rax
mov    $0x400,%esi
lea    0xe2d(%rip),%rdx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <snprintf@plt>
lea    -0x440(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     123b <main+0xfb>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
lea    -0x440(%rbp),%rdx
lea    0xe1c(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
cmp    $0x6,%edi
jne    1195 <main+0x55>
mov    0x8(%rsi),%rcx
mov    0x10(%rsi),%r8
mov    0x18(%rsi),%r9
movups 0x20(%rsi),%xmm0
movups %xmm0,(%rsp)
lea    0xeb0(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
test   %rax,%rax
jne    11ae <main+0x6e>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0xe5b(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    11ca <main+0x8a>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"bad number of arguments\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [42 x i8] c"\22%s\22 /machine:%s /def:%s /name:%s /out:%s\00"
@.str.2 = [11 x i8] c"%s failed\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 6
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
store i8* %22, i8** %6
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
store i8* %25, i8** %7
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 3
%28 = load i8*, i8** %27
store i8* %28, i8** %8
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 4
%31 = load i8*, i8** %30
store i8* %31, i8** %9
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 5
%34 = load i8*, i8** %33
store i8* %34, i8** %10
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%36 = load i8*, i8** %6
%37 = load i8*, i8** %7
%38 = load i8*, i8** %8
%39 = load i8*, i8** %9
%40 = load i8*, i8** %10
%41 = call i32 @snprintf(i8* %35, i32 1024, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %36, i8* %37, i8* %38, i8* %39, i8* %40)
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%43 = call i64 @system(i8* %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %19
%46 = load i32, i32* @stderr
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %47)
%49 = load i32, i32* @EXIT_FAILURE
%50 = call i32 @exit(i32 %49)
unreachable
51: ; preds = %19
%52 = load i32, i32* @EXIT_SUCCESS
%53 = call i32 @exit(i32 %52)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"bad number of arguments\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [42 x i8] c"\22%s\22 /machine:%s /def:%s /name:%s /out:%s\00"
@.str.2 = [11 x i8] c"%s failed\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 6
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8*, i8** %1, i64 3
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8*, i8** %1, i64 4
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8*, i8** %1, i64 5
%21 = load i8*, i8** %20
%22 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %15, i8* %17, i8* %19, i8* %21)
%23 = call i64 @system(i8* %4)
%24 = icmp eq i64 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %11
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %11
%31 = load i32, i32* @EXIT_SUCCESS
%32 = call i32 @exit(i32 %31)
unreachable
}