#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*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ gpde_main_(int *, char *, int *, char *, int *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  int err = 0;
  char f1[256], f2[256], f3[256];
  int lf1, lf2, lf3;
  if (argc < 3) {
    printf("%s: expected <meshfile> <mshffile> <casedir>\n", argv[0]);
    err = 1;
    goto quit;
  }
  strcpy(f1, argv[1]);
  lf1 = strlen(f1);
  strcpy(f2, argv[2]);
  lf2 = strlen(f2);
  strcpy(f3, argv[3]);
  lf3 = strlen(f3);
  gpde_main_(&lf1, f1, &lf2, f2, &lf3, f3);
quit:
  if (err)
    fprintf(stderr, "%s: error %d\n", argv[0], err);
  return err;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1199 <main+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe78(%rip),%rdi
call   1060 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    123a <main+0xea>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x120(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x324(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x220(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x328(%rbp)
lea    -0x320(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x320(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x32c(%rbp)
lea    -0x120(%rbp),%rsi
lea    -0x220(%rbp),%rcx
lea    -0x320(%rbp),%r9
lea    -0x324(%rbp),%rdi
lea    -0x328(%rbp),%rdx
lea    -0x32c(%rbp),%r8
call   1030 <gpde_main_@plt>
cmpl   $0x0,-0x14(%rbp)
je     1263 <main+0x113>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x14(%rbp),%ecx
lea    0xdd0(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x310,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jge    1197 <main+0x47>
mov    (%rbx),%rsi
lea    0xe92(%rip),%rdi
call   1060 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xea8(%rip),%rsi
mov    $0x1,%ebx
mov    $0x1,%ecx
call   1070 <fprintf@plt>
jmp    1213 <main+0xc3>
mov    0x8(%rbx),%rsi
lea    0x210(%rsp),%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,0xc(%rsp)
mov    0x10(%rbx),%rsi
lea    0x110(%rsp),%r15
mov    %r15,%rdi
call   1040 <strcpy@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,0x8(%rsp)
mov    0x18(%rbx),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,0x4(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%r8
mov    %r14,%rsi
mov    %r15,%rcx
mov    %rbx,%r9
call   1030 <gpde_main_@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x310,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"%s: expected <meshfile> <mshffile> <casedir>\0A\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"%s: error %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = alloca [256 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 1, i32* %6
br label %46
20: ; preds = %2
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @strcpy(i8* %21, i8* %24)
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%27 = call i32 @strlen(i8* %26)
store i32 %27, i32* %10
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32 @strcpy(i8* %28, i8* %31)
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%34 = call i32 @strlen(i8* %33)
store i32 %34, i32* %11
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 3
%38 = load i8*, i8** %37
%39 = call i32 @strcpy(i8* %35, i8* %38)
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%41 = call i32 @strlen(i8* %40)
store i32 %41, i32* %12
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%45 = call i32 @gpde_main_(i32* %10, i8* %42, i32* %11, i8* %43, i32* %12, i8* %44)
br label %46
46: ; preds = %20, %15
%47 = load i32, i32* %6
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %56
49: ; preds = %46
%50 = load i32, i32* @stderr
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 0
%53 = load i8*, i8** %52
%54 = load i32, i32* %6
%55 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %53, i32 %54)
br label %56
56: ; preds = %49, %46
%57 = load i32, i32* %6
ret i32 %57
}

LLVM IR (-O2):
@.str = [46 x i8] c"%s: expected <meshfile> <mshffile> <casedir>\0A\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"%s: error %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = icmp slt i32 %0, 3
br i1 %15, label %30, label %16
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strcpy(i8* %9, i8* %18)
%20 = call i32 @strlen(i8* %9)
store i32 %20, i32* %6
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @strcpy(i8* %10, i8* %22)
%24 = call i32 @strlen(i8* %10)
store i32 %24, i32* %7
%25 = getelementptr inbounds i8*, i8** %1, i64 3
%26 = load i8*, i8** %25
%27 = call i32 @strcpy(i8* %11, i8* %26)
%28 = call i32 @strlen(i8* %11)
store i32 %28, i32* %8
%29 = call i32 @gpde_main_(i32* %6, i8* %9, i32* %7, i8* %10, i32* %8, i8* %11)
br label %36
30: ; preds = %2
%31 = load i8*, i8** %1
%32 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = load i32, i32* @stderr
%34 = load i8*, i8** %1
%35 = tail call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %34, i32 1)
br label %36
36: ; preds = %16, %30
%37 = phi i32 [ 1, %30 ], [ 0, %16 ]
ret i32 %37
}