#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*/ free(char *);
int matho_process(char *, char **);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int solve_function(char *input, char *seperator) {
  char *output;
  int i;
  int rv;
  rv = matho_process(input, &output);
  if (output != 0)
    printf("%s\n%s\n%s\n", seperator, output, seperator);
  if (rv)
    free(output);
  return rv;
}


x86 assembly (clang, -O0):
<solve_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <matho_process@plt>
mov    %eax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <solve_function+0x43>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
je     1186 <solve_function+0x56>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_function>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsp,%rsi
call   1050 <matho_process@plt>
mov    %eax,%ebx
mov    (%rsp),%rdx
test   %rdx,%rdx
je     115c <solve_function+0x2c>
lea    0xeaf(%rip),%rdi
mov    %r14,%rsi
mov    %r14,%rcx
call   1040 <printf@plt>
test   %ebx,%ebx
je     1169 <solve_function+0x39>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
define i32 @solve_function(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @matho_process(i8* %8, i8** %5)
store i32 %9, i32* %7
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i8* %15)
br label %17
17: ; preds = %12, %2
%18 = load i32, i32* %7
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i8*, i8** %5
%22 = call i32 @free(i8* %21)
br label %23
23: ; preds = %20, %17
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
define i32 @solve_function(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @matho_process(i8* %0, i8** %3)
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %6, i8* %1)
br label %10
10: ; preds = %8, %2
%11 = icmp eq i32 %5, 0
br i1 %11, label %15, label %12
12: ; preds = %10
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %12, %10
ret i32 %5
}