#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ file_extension(char *, char *, char *);
int /*<<< orphan*/ file_name(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ nConvert(char *, char *, char *, char *, char *,
                            int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int system(char *);
void file_convert(char *path, char *ext, int width, int height, int q) {
  char res[200];
  char name[200];
  file_extension(path, res, name);
  char name_alt[50];
  strcpy(name_alt, name);
  file_name(name);
  char quality[5];
  char x[5];
  char y[5];
  char resolution[15];
  char *destination;
  int len;
  len = strlen(quality) + strlen(y) + strlen(x) + strlen(name) +
        strlen("cache") + 10;
  destination = malloc(len * sizeof(char));
  if (destination == NULL) {
    perror("");
    exit(EXIT_FAILURE);
  }
  sprintf(y, "%d", height);
  sprintf(x, "%d", width);
  sprintf(quality, "%d", q);
  strncpy(resolution, x, strlen(x) + 1);
  strncat(resolution, "x", 1);
  strncat(resolution, y, strlen(y));
  strcpy(destination, "cache/");
  strcat(destination, name);
  strcat(destination, "/");
  strcat(destination, x);
  strcat(destination, "/");
  strcat(destination, y);
  strcat(destination, "/");
  strcat(destination, quality);
  int len2 = strlen(destination) + strlen("mkdir -p ") + 5;
  char *create_folder_command = malloc(len2 * sizeof(char));
  strncpy(create_folder_command, "mkdir -p ", strlen("mkdir -p ") + 1);
  strncat(create_folder_command, destination, strlen(destination));
  int commRes = system(create_folder_command);
  if (commRes == -1) {
    fprintf(stderr, "Error in system\n");
    exit(EXIT_FAILURE);
  }
  nConvert(res, destination, name_alt, ext, resolution, 0, q);
  free(destination);
  free(create_folder_command);
}


x86 assembly (clang, -O0):
<file_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
lea    -0x1c0(%rbp),%rdx
call   10b0 <file_extension@plt>
lea    -0x200(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x1c0(%rbp),%rdi
call   1060 <file_name@plt>
lea    -0x205(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x24c(%rbp)
lea    -0x20f(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x24c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x248(%rbp)
lea    -0x20a(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x248(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x244(%rbp)
lea    -0x1c0(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x244(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x240(%rbp)
lea    0xd50(%rip),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x240(%rbp),%eax
add    %ecx,%eax
add    $0xa,%eax
mov    %eax,-0x22c(%rbp)
movslq -0x22c(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x228(%rbp)
cmpq   $0x0,-0x228(%rbp)
jne    1309 <file_convert+0x119>
lea    0xd36(%rip),%rdi
call   10d0 <perror@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    -0x20f(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xcec(%rip),%rsi
call   10f0 <sprintf@plt>
lea    -0x20a(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xcd6(%rip),%rsi
call   10f0 <sprintf@plt>
lea    -0x205(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xcc0(%rip),%rsi
call   10f0 <sprintf@plt>
lea    -0x21e(%rbp),%rax
mov    %rax,-0x290(%rbp)
lea    -0x20a(%rbp),%rax
mov    %rax,-0x288(%rbp)
lea    -0x20a(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x290(%rbp),%rdi
mov    -0x288(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1040 <strncpy@plt>
lea    -0x21e(%rbp),%rdi
lea    0xc70(%rip),%rsi
mov    $0x1,%edx
call   1090 <strncat@plt>
lea    -0x21e(%rbp),%rax
mov    %rax,-0x280(%rbp)
lea    -0x20f(%rbp),%rax
mov    %rax,-0x278(%rbp)
lea    -0x20f(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x280(%rbp),%rdi
mov    -0x278(%rbp),%rsi
mov    %eax,%edx
call   1090 <strncat@plt>
mov    -0x228(%rbp),%rdi
lea    0xc1d(%rip),%rsi
call   1050 <strcpy@plt>
mov    -0x228(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   10e0 <strcat@plt>
mov    -0x228(%rbp),%rdi
lea    0xbfc(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x228(%rbp),%rdi
lea    -0x20a(%rbp),%rsi
call   10e0 <strcat@plt>
mov    -0x228(%rbp),%rdi
lea    0xbd6(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x228(%rbp),%rdi
lea    -0x20f(%rbp),%rsi
call   10e0 <strcat@plt>
mov    -0x228(%rbp),%rdi
lea    0xbb0(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x228(%rbp),%rdi
lea    -0x205(%rbp),%rsi
call   10e0 <strcat@plt>
mov    -0x228(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x26c(%rbp)
lea    0xb81(%rip),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x26c(%rbp),%eax
add    %ecx,%eax
add    $0x5,%eax
mov    %eax,-0x230(%rbp)
movslq -0x230(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x238(%rbp)
mov    -0x238(%rbp),%rax
mov    %rax,-0x268(%rbp)
lea    0xb3b(%rip),%rdi
call   1070 <strlen@plt>
mov    -0x268(%rbp),%rdi
mov    %eax,%edx
add    $0x1,%edx
lea    0xb23(%rip),%rsi
call   1040 <strncpy@plt>
mov    -0x238(%rbp),%rax
mov    %rax,-0x260(%rbp)
mov    -0x228(%rbp),%rax
mov    %rax,-0x258(%rbp)
mov    -0x228(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x260(%rbp),%rdi
mov    -0x258(%rbp),%rsi
mov    %eax,%edx
call   1090 <strncat@plt>
mov    -0x238(%rbp),%rdi
call   1080 <system@plt>
mov    %eax,-0x23c(%rbp)
cmpl   $0xffffffff,-0x23c(%rbp)
jne    1573 <file_convert+0x383>
mov    0x2a89(%rip),%rax
mov    (%rax),%edi
lea    0xabc(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2a6c(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x228(%rbp),%rsi
lea    -0x200(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x21e(%rbp),%r8
mov    -0x1c(%rbp),%eax
xor    %r9d,%r9d
mov    %eax,(%rsp)
call   1110 <nConvert@plt>
mov    -0x228(%rbp),%rdi
call   1030 <free@plt>
mov    -0x238(%rbp),%rdi
call   1030 <free@plt>
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_convert>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
mov    %r8d,0x14(%rsp)
mov    %ecx,%r13d
mov    %edx,%r12d
mov    %rsi,0x28(%rsp)
lea    0x150(%rsp),%rsi
lea    0x80(%rsp),%rbx
mov    %rbx,%rdx
call   10b0 <file_extension@plt>
lea    0x40(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <file_name@plt>
lea    0x23(%rsp),%rdi
call   1070 <strlen@plt>
mov    %eax,%r14d
lea    0x19(%rsp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ebp
lea    0x1e(%rsp),%rdi
call   1070 <strlen@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %eax,%ebx
lea    0xd8b(%rip),%rdi
call   1070 <strlen@plt>
add    %r14d,%ebp
add    %r15d,%ebp
add    %ebx,%ebp
lea    (%rax,%rbp,1),%edi
add    $0xa,%edi
call   10c0 <malloc@plt>
test   %rax,%rax
je     1431 <file_convert+0x241>
mov    %rax,%rbx
lea    0xd66(%rip),%rbp
lea    0x19(%rsp),%r14
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
call   10f0 <sprintf@plt>
lea    0x1e(%rsp),%r15
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
call   10f0 <sprintf@plt>
lea    0x23(%rsp),%r12
mov    %r12,%rdi
mov    %rbp,%rsi
mov    0x14(%rsp),%r13d
mov    %r13d,%edx
call   10f0 <sprintf@plt>
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%edx
lea    0x31(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
call   1040 <strncpy@plt>
lea    0xd09(%rip),%rsi
mov    %rbp,%rdi
mov    $0x1,%edx
call   1090 <strncat@plt>
mov    %r14,%rdi
call   1070 <strlen@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1090 <strncat@plt>
lea    0xce2(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcpy@plt>
lea    0x80(%rsp),%rsi
mov    %rbx,%rdi
call   10e0 <strcat@plt>
lea    0xcc8(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10e0 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   10e0 <strcat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10e0 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <strcat@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10e0 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10e0 <strcat@plt>
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %eax,%ebp
lea    0xc77(%rip),%r14
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    (%rax,%rbp,1),%edi
add    $0x5,%edi
call   10c0 <malloc@plt>
mov    %rax,%rbp
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbp,%rdi
mov    %r14,%rsi
call   1040 <strncpy@plt>
mov    %rbx,%rdi
call   1070 <strlen@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1090 <strncat@plt>
mov    %rbp,%rdi
call   1080 <system@plt>
cmp    $0xffffffff,%eax
je     143f <file_convert+0x24f>
mov    %r13d,(%rsp)
lea    0x150(%rsp),%rdi
lea    0x40(%rsp),%rdx
lea    0x31(%rsp),%r8
mov    %rbx,%rsi
mov    0x28(%rsp),%rcx
xor    %r9d,%r9d
call   1110 <nConvert@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbf4(%rip),%rdi
call   10d0 <perror@plt>
jmp    1454 <file_convert+0x264>
mov    0x2b9a(%rip),%rax
mov    (%rax),%edi
lea    0xbcd(%rip),%rsi
call   10a0 <fprintf@plt>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"cache\00"
@.str.1 = [1 x i8] zeroinitializer
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"x\00"
@.str.4 = [7 x i8] c"cache/\00"
@.str.5 = [2 x i8] c"/\00"
@.str.6 = [10 x i8] c"mkdir -p \00"
@stderr = global i32 0
@.str.7 = [17 x i8] c"Error in system\0A\00"
define void @file_convert(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [200 x i8]
%12 = alloca [200 x i8]
%13 = alloca [50 x i8]
%14 = alloca [5 x i8]
%15 = alloca [5 x i8]
%16 = alloca [5 x i8]
%17 = alloca [15 x i8]
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%23 = load i8*, i8** %6
%24 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%25 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%26 = call i32 @file_extension(i8* %23, i8* %24, i8* %25)
%27 = getelementptr inbounds [50 x i8], [50 x i8]* %13, i64 0, i64 0
%28 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%29 = call i32 @strcpy(i8* %27, i8* %28)
%30 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%31 = call i32 @file_name(i8* %30)
%32 = getelementptr inbounds [5 x i8], [5 x i8]* %14, i64 0, i64 0
%33 = call i32 @strlen(i8* %32)
%34 = getelementptr inbounds [5 x i8], [5 x i8]* %16, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
%36 = add nsw i32 %33, %35
%37 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%38 = call i32 @strlen(i8* %37)
%39 = add nsw i32 %36, %38
%40 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%41 = call i32 @strlen(i8* %40)
%42 = add nsw i32 %39, %41
%43 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%44 = add nsw i32 %42, %43
%45 = add nsw i32 %44, 10
store i32 %45, i32* %19
%46 = load i32, i32* %19
%47 = sext i32 %46 to i64
%48 = mul i64 %47, 1
%49 = trunc i64 %48 to i32
%50 = call i8* @malloc(i32 %49)
store i8* %50, i8** %18
%51 = load i8*, i8** %18
%52 = icmp eq i8* %51, null
br i1 %52, label %53, label %57
53: ; preds = %5
%54 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%55 = load i32, i32* @EXIT_FAILURE
%56 = call i32 @exit(i32 %55)
unreachable
57: ; preds = %5
%58 = getelementptr inbounds [5 x i8], [5 x i8]* %16, i64 0, i64 0
%59 = load i32, i32* %9
%60 = call i32 @sprintf(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%62 = load i32, i32* %8
%63 = call i32 @sprintf(i8* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%64 = getelementptr inbounds [5 x i8], [5 x i8]* %14, i64 0, i64 0
%65 = load i32, i32* %10
%66 = call i32 @sprintf(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = getelementptr inbounds [15 x i8], [15 x i8]* %17, i64 0, i64 0
%68 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%69 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%70 = call i32 @strlen(i8* %69)
%71 = add nsw i32 %70, 1
%72 = call i32 @strncpy(i8* %67, i8* %68, i32 %71)
%73 = getelementptr inbounds [15 x i8], [15 x i8]* %17, i64 0, i64 0
%74 = call i32 @strncat(i8* %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%75 = getelementptr inbounds [15 x i8], [15 x i8]* %17, i64 0, i64 0
%76 = getelementptr inbounds [5 x i8], [5 x i8]* %16, i64 0, i64 0
%77 = getelementptr inbounds [5 x i8], [5 x i8]* %16, i64 0, i64 0
%78 = call i32 @strlen(i8* %77)
%79 = call i32 @strncat(i8* %75, i8* %76, i32 %78)
%80 = load i8*, i8** %18
%81 = call i32 @strcpy(i8* %80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%82 = load i8*, i8** %18
%83 = getelementptr inbounds [200 x i8], [200 x i8]* %12, i64 0, i64 0
%84 = call i32 @strcat(i8* %82, i8* %83)
%85 = load i8*, i8** %18
%86 = call i32 @strcat(i8* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%87 = load i8*, i8** %18
%88 = getelementptr inbounds [5 x i8], [5 x i8]* %15, i64 0, i64 0
%89 = call i32 @strcat(i8* %87, i8* %88)
%90 = load i8*, i8** %18
%91 = call i32 @strcat(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%92 = load i8*, i8** %18
%93 = getelementptr inbounds [5 x i8], [5 x i8]* %16, i64 0, i64 0
%94 = call i32 @strcat(i8* %92, i8* %93)
%95 = load i8*, i8** %18
%96 = call i32 @strcat(i8* %95, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%97 = load i8*, i8** %18
%98 = getelementptr inbounds [5 x i8], [5 x i8]* %14, i64 0, i64 0
%99 = call i32 @strcat(i8* %97, i8* %98)
%100 = load i8*, i8** %18
%101 = call i32 @strlen(i8* %100)
%102 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%103 = add nsw i32 %101, %102
%104 = add nsw i32 %103, 5
store i32 %104, i32* %20
%105 = load i32, i32* %20
%106 = sext i32 %105 to i64
%107 = mul i64 %106, 1
%108 = trunc i64 %107 to i32
%109 = call i8* @malloc(i32 %108)
store i8* %109, i8** %21
%110 = load i8*, i8** %21
%111 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%112 = add nsw i32 %111, 1
%113 = call i32 @strncpy(i8* %110, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %112)
%114 = load i8*, i8** %21
%115 = load i8*, i8** %18
%116 = load i8*, i8** %18
%117 = call i32 @strlen(i8* %116)
%118 = call i32 @strncat(i8* %114, i8* %115, i32 %117)
%119 = load i8*, i8** %21
%120 = call i32 @system(i8* %119)
store i32 %120, i32* %22
%121 = load i32, i32* %22
%122 = icmp eq i32 %121, -1
br i1 %122, label %123, label %128
123: ; preds = %57
%124 = load i32, i32* @stderr
%125 = call i32 @fprintf(i32 %124, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%126 = load i32, i32* @EXIT_FAILURE
%127 = call i32 @exit(i32 %126)
unreachable
128: ; preds = %57
%129 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%130 = load i8*, i8** %18
%131 = getelementptr inbounds [50 x i8], [50 x i8]* %13, i64 0, i64 0
%132 = load i8*, i8** %7
%133 = getelementptr inbounds [15 x i8], [15 x i8]* %17, i64 0, i64 0
%134 = load i32, i32* %10
%135 = call i32 @nConvert(i8* %129, i8* %130, i8* %131, i8* %132, i8* %133, i32 0, i32 %134)
%136 = load i8*, i8** %18
%137 = call i32 @free(i8* %136)
%138 = load i8*, i8** %21
%139 = call i32 @free(i8* %138)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"cache\00"
@.str.1 = [1 x i8] zeroinitializer
@EXIT_FAILURE = global i32 0
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c"x\00"
@.str.4 = [7 x i8] c"cache/\00"
@.str.5 = [2 x i8] c"/\00"
@.str.6 = [10 x i8] c"mkdir -p \00"
@stderr = global i32 0
@.str.7 = [17 x i8] c"Error in system\0A\00"
define void @file_convert(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [200 x i8]
%7 = alloca [200 x i8]
%8 = alloca [50 x i8]
%9 = alloca [5 x i8]
%10 = alloca [5 x i8]
%11 = alloca [5 x i8]
%12 = alloca [15 x i8]
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%15 = call i32 @file_extension(i8* %0, i8* %13, i8* %14)
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* %14)
%18 = call i32 @file_name(i8* %14)
%19 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %10, i64 0, i64 0
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 0
%22 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%23 = call i32 @strlen(i8* %19)
%24 = call i32 @strlen(i8* %21)
%25 = call i32 @strlen(i8* %20)
%26 = call i32 @strlen(i8* %14)
%27 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%28 = add i32 %23, 10
%29 = add i32 %28, %24
%30 = add i32 %29, %25
%31 = add i32 %30, %26
%32 = add i32 %31, %27
%33 = call i8* @malloc(i32 %32)
%34 = icmp eq i8* %33, null
br i1 %34, label %35, label %39
35: ; preds = %5
%36 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %5
%40 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%41 = call i32 @sprintf(i8* %20, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%42 = call i32 @sprintf(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%43 = call i32 @strlen(i8* %20)
%44 = add nsw i32 %43, 1
%45 = call i32 @strncpy(i8* %22, i8* %20, i32 %44)
%46 = call i32 @strncat(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
%47 = call i32 @strlen(i8* %21)
%48 = call i32 @strncat(i8* %22, i8* %21, i32 %47)
%49 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 @strcat(i8* %33, i8* %14)
%51 = call i32 @strcat(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%52 = call i32 @strcat(i8* %33, i8* %20)
%53 = call i32 @strcat(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%54 = call i32 @strcat(i8* %33, i8* %21)
%55 = call i32 @strcat(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%56 = call i32 @strcat(i8* %33, i8* %19)
%57 = call i32 @strlen(i8* %33)
%58 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%59 = add i32 %57, 5
%60 = add i32 %59, %58
%61 = call i8* @malloc(i32 %60)
%62 = call i32 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%63 = add nsw i32 %62, 1
%64 = call i32 @strncpy(i8* %61, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %63)
%65 = call i32 @strlen(i8* %33)
%66 = call i32 @strncat(i8* %61, i8* %33, i32 %65)
%67 = call i32 @system(i8* %61)
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %74
69: ; preds = %39
%70 = load i32, i32* @stderr
%71 = call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0))
%72 = load i32, i32* @EXIT_FAILURE
%73 = call i32 @exit(i32 %72)
unreachable
74: ; preds = %39
%75 = call i32 @nConvert(i8* %13, i8* %33, i8* %16, i8* %1, i8* %22, i32 0, i32 %4)
%76 = call i32 @free(i8* %33)
%77 = call i32 @free(i8* %61)
ret void
}