#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*/ LC_ALL;
int createAbc(int, char **);
int /*<<< orphan*/ free(char **);
char **malloc(int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int runAbcToSvg(char *abcFile, char *svgFile) {
  setlocale(LC_ALL, "C");
  char *first = "abcm2ps";
  char *second = "-g";
  char *third = "-O";
  char **argc = malloc(sizeof(char *) * 5);
  argc[0] = first;
  argc[1] = second;
  argc[2] = third;
  argc[3] = svgFile;
  argc[4] = abcFile;
  int answer = createAbc(5, argc);
  free(argc);
  return answer;
}


x86 assembly (clang, -O0):
<runAbcToSvg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1060 <setlocale@plt>
lea    0xe96(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe93(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe8b(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x8(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x30(%rbp),%rsi
mov    $0x5,%edi
call   1040 <createAbc@plt>
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runAbcToSvg>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1060 <setlocale@plt>
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe8c(%rip),%rax
mov    %rax,(%rbx)
lea    0xe8a(%rip),%rax
mov    %rax,0x8(%rbx)
lea    0xe82(%rip),%rax
mov    %rax,0x10(%rbx)
mov    %r15,0x18(%rbx)
mov    %r14,0x20(%rbx)
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <createAbc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [8 x i8] c"abcm2ps\00"
@.str.2 = [3 x i8] c"-g\00"
@.str.3 = [3 x i8] c"-O\00"
define i32 @runAbcToSvg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%10 = load i32, i32* @LC_ALL
%11 = call i32 @setlocale(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %7
%12 = call i8** @malloc(i32 40)
store i8** %12, i8*** %8
%13 = load i8*, i8** %5
%14 = load i8**, i8*** %8
%15 = getelementptr inbounds i8*, i8** %14, i64 0
store i8* %13, i8** %15
%16 = load i8*, i8** %6
%17 = load i8**, i8*** %8
%18 = getelementptr inbounds i8*, i8** %17, i64 1
store i8* %16, i8** %18
%19 = load i8*, i8** %7
%20 = load i8**, i8*** %8
%21 = getelementptr inbounds i8*, i8** %20, i64 2
store i8* %19, i8** %21
%22 = load i8*, i8** %4
%23 = load i8**, i8*** %8
%24 = getelementptr inbounds i8*, i8** %23, i64 3
store i8* %22, i8** %24
%25 = load i8*, i8** %3
%26 = load i8**, i8*** %8
%27 = getelementptr inbounds i8*, i8** %26, i64 4
store i8* %25, i8** %27
%28 = load i8**, i8*** %8
%29 = call i32 @createAbc(i32 5, i8** %28)
store i32 %29, i32* %9
%30 = load i8**, i8*** %8
%31 = call i32 @free(i8** %30)
%32 = load i32, i32* %9
ret i32 %32
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
@.str.1 = [8 x i8] c"abcm2ps\00"
@.str.2 = [3 x i8] c"-g\00"
@.str.3 = [3 x i8] c"-O\00"
define i32 @runAbcToSvg(i8* %0, i8* %1) {
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i8** @malloc(i32 40)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %5, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds i8*, i8** %5, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds i8*, i8** %5, i64 3
store i8* %1, i8** %8
%9 = getelementptr inbounds i8*, i8** %5, i64 4
store i8* %0, i8** %9
%10 = tail call i32 @createAbc(i32 5, i8** %5)
%11 = tail call i32 @free(i8** %5)
ret i32 %10
}