#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 */
scalar_t__ calloc(scalar_t__, int);
int /*<<< orphan*/ free(char *);
int s2open(int, int, int, char **);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int s2open_(int *ifullscreen, int *istereo) {
  int iargc = 0;
  char *iargv[1];
  iargv[0] = (char *)calloc(strlen("s2plot.exe") + 1, sizeof(char));
  strcpy(iargv[0], "s2plot.exe");
  int result = s2open(*ifullscreen, *istereo, iargc, iargv);
  free(iargv[0]);
  return result;
}


x86 assembly (clang, -O0):
<s2open_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe92(%rip),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rcx
call   1070 <s2open@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2open_>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xb,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,(%rsp)
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
mov    %rsp,%rcx
xor    %edx,%edx
call   1060 <s2open@plt>
mov    %eax,%ebx
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"s2plot.exe\00"
define i32 @s2open_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [1 x i8*]
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%8 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = add nsw i64 %8, 1
%10 = call i64 @calloc(i64 %9, i32 1)
%11 = inttoptr i64 %10 to i8*
%12 = getelementptr inbounds [1 x i8*], [1 x i8*]* %6, i64 0, i64 0
store i8* %11, i8** %12
%13 = getelementptr inbounds [1 x i8*], [1 x i8*]* %6, i64 0, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%16 = load i32*, i32** %3
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = load i32, i32* %5
%21 = getelementptr inbounds [1 x i8*], [1 x i8*]* %6, i64 0, i64 0
%22 = call i32 @s2open(i32 %17, i32 %19, i32 %20, i8** %21)
store i32 %22, i32* %7
%23 = getelementptr inbounds [1 x i8*], [1 x i8*]* %6, i64 0, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @free(i8* %24)
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
@.str = [11 x i8] c"s2plot.exe\00"
define i32 @s2open_(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [1 x i8*]
%4 = bitcast [1 x i8*]* %3 to i8*
%5 = tail call i64 @calloc(i64 11, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds [1 x i8*], [1 x i8*]* %3, i64 0, i64 0
store i8* %6, i8** %7
%8 = tail call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %0
%10 = load i32, i32* %1
%11 = call i32 @s2open(i32 %9, i32 %10, i32 0, i8** %7)
%12 = load i8*, i8** %7
%13 = call i32 @free(i8* %12)
ret i32 %11
}