#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*/ errori(int /*<<< orphan*/ *);
scalar_t__ log10(size_t);
char *malloc(size_t);
int /*<<< orphan*/ sprintf(char *, char const *, ...);
scalar_t__ strlen(char const *);
const char *kernel_options(size_t width, size_t height, int psf, size_t psfw,
                           size_t psfh, size_t nq, const char *flags[]) {
  size_t nopts;
  size_t opts_size;
  char *opts;
  char *cur;
  const char **f;
  const char *size_opt = " -DIMAGE_SIZE=%zu";
  const char *width_opt = " -DIMAGE_WIDTH=%zu";
  const char *height_opt = " -DIMAGE_HEIGHT=%zu";
  const char *psf_opt = " -DPSF=%d";
  const char *psfw_opt = " -DPSF_WIDTH=%zu";
  const char *psfh_opt = " -DPSF_HEIGHT=%zu";
  const char *nq_opt = " -DQUAD_POINTS=%zu";
  opts_size = 0;
  nopts = 0;
  opts_size += strlen(size_opt) + log10(width * height + 1) + 1;
  nopts += 1;
  opts_size += strlen(width_opt) + log10(width + 1) + 1;
  nopts += 1;
  opts_size += strlen(height_opt) + log10(height + 1) + 1;
  nopts += 1;
  opts_size += strlen(psf_opt) + 1 + 1;
  nopts += 1;
  opts_size += strlen(psfw_opt) + log10(psfw + 1) + 1;
  nopts += 1;
  opts_size += strlen(psfh_opt) + log10(psfh + 1) + 1;
  nopts += 1;
  opts_size += strlen(nq_opt) + log10(nq + 1) + 1;
  nopts += 1;
  for (f = flags; *f; ++f) {
    opts_size += strlen(*f) + 1;
    nopts += 1;
  }
  opts = malloc(opts_size + 1);
  if (!opts)
    errori(NULL);
  cur = opts;
  cur += sprintf(cur, size_opt, width * height);
  cur += sprintf(cur, width_opt, width);
  cur += sprintf(cur, height_opt, height);
  cur += sprintf(cur, psf_opt, psf ? 1 : 0);
  cur += sprintf(cur, psfw_opt, psfw);
  cur += sprintf(cur, psfh_opt, psfh);
  cur += sprintf(cur, nq_opt, nq);
  for (f = flags; *f; ++f)
    cur += sprintf(cur, " %s", *f);
  return opts;
}


x86 assembly (clang, -O0):
<kernel_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xe83(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xe92(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xea0(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    0xea4(%rip),%rax
mov    %rax,-0x90(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <log10@plt>
mov    %rax,%rcx
mov    -0xc0(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x68(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0xb8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1050 <log10@plt>
mov    %rax,%rcx
mov    -0xb8(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <log10@plt>
mov    %rax,%rcx
mov    -0xb0(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x78(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <log10@plt>
mov    %rax,%rcx
mov    -0xa8(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x88(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
call   1050 <log10@plt>
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x98(%rbp)
mov    -0x30(%rbp),%rdi
add    $0x1,%rdi
call   1050 <log10@plt>
mov    %rax,%rcx
mov    -0x98(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
cmpq   $0x0,(%rax)
je     13e0 <kernel_options+0x290>
mov    -0x58(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x58(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
jmp    139d <kernel_options+0x24d>
mov    -0x40(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1405 <kernel_options+0x2b5>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <errori@plt>
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x14(%rbp),%ecx
xor    %edx,%edx
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x80(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
cmpq   $0x0,(%rax)
je     1569 <kernel_options+0x419>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rax
mov    (%rax),%rdx
lea    0xb38(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
jmp    1521 <kernel_options+0x3d1>
mov    -0x48(%rbp),%rax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_options>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%r12
mov    %r8,%r13
mov    %rcx,%r14
mov    %edx,0xc(%rsp)
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    0x80(%rsp),%r15
mov    %rsi,%rax
imul   %rdi,%rax
mov    %rax,0x18(%rsp)
lea    0x1(%rax),%rdi
call   1050 <log10@plt>
mov    %rax,0x10(%rsp)
mov    %rbx,0x20(%rsp)
lea    0x1(%rbx),%rdi
call   1050 <log10@plt>
mov    %rax,%rbx
mov    %rbp,0x28(%rsp)
lea    0x1(%rbp),%rdi
call   1050 <log10@plt>
mov    %rax,%rbp
mov    %r14,0x30(%rsp)
lea    0x1(%r14),%rdi
call   1050 <log10@plt>
mov    %rax,%r14
mov    %r13,0x38(%rsp)
lea    0x1(%r13),%rdi
call   1050 <log10@plt>
mov    %rax,%r13
mov    %r12,0x40(%rsp)
lea    0x1(%r12),%rdi
call   1050 <log10@plt>
add    0x10(%rsp),%rbx
add    %rbp,%rbx
add    %r14,%rbx
add    %r13,%rbx
add    %rax,%rbx
add    $0x7a,%rbx
mov    (%r15),%rdi
test   %rdi,%rdi
je     1229 <kernel_options+0xd9>
lea    0x8(%r15),%rbp
nopw   0x0(%rax,%rax,1)
call   1030 <strlen@plt>
add    %rax,%rbx
add    $0x1,%rbx
mov    0x0(%rbp),%rdi
add    $0x8,%rbp
test   %rdi,%rdi
jne    1210 <kernel_options+0xc0>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1244 <kernel_options+0xf4>
xor    %edi,%edi
call   1070 <errori@plt>
lea    0xdb5(%rip),%rsi
mov    %r14,%rdi
mov    0x18(%rsp),%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
cltq
mov    %r14,%rbx
add    %rax,%rbx
lea    0xda9(%rip),%rsi
mov    %rbx,%rdi
mov    0x20(%rsp),%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
movslq %eax,%rbp
add    %rbx,%rbp
lea    0xda0(%rip),%rsi
mov    %rbp,%rdi
mov    0x28(%rsp),%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
movslq %eax,%rbx
add    %rbp,%rbx
xor    %edx,%edx
cmpl   $0x0,0xc(%rsp)
setne  %dl
lea    0xd8e(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <sprintf@plt>
movslq %eax,%rbp
add    %rbx,%rbp
lea    0xd81(%rip),%rsi
mov    %rbp,%rdi
mov    0x30(%rsp),%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
movslq %eax,%rbx
add    %rbp,%rbx
lea    0xd76(%rip),%rsi
mov    %rbx,%rdi
mov    0x38(%rsp),%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
movslq %eax,%rbp
add    %rbx,%rbp
lea    0xd6c(%rip),%rsi
mov    %rbp,%rdi
mov    0x40(%rsp),%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    (%r15),%rdx
test   %rdx,%rdx
je     134e <kernel_options+0x1fe>
cltq
add    %rax,%rbp
add    $0x8,%r15
lea    0xd58(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <sprintf@plt>
cltq
add    %rax,%rbp
mov    (%r15),%rdx
add    $0x8,%r15
test   %rdx,%rdx
jne    1330 <kernel_options+0x1e0>
mov    %r14,%rax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c" -DIMAGE_SIZE=%zu\00"
@.str.1 = [19 x i8] c" -DIMAGE_WIDTH=%zu\00"
@.str.2 = [20 x i8] c" -DIMAGE_HEIGHT=%zu\00"
@.str.3 = [10 x i8] c" -DPSF=%d\00"
@.str.4 = [17 x i8] c" -DPSF_WIDTH=%zu\00"
@.str.5 = [18 x i8] c" -DPSF_HEIGHT=%zu\00"
@.str.6 = [19 x i8] c" -DQUAD_POINTS=%zu\00"
@.str.7 = [4 x i8] c" %s\00"
define i8* @kernel_options(i64 %0, i64 %1, i32 %2, i64 %3, i64 %4, i64 %5, i8** %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8**
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8**
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
store i64 %0, i64* %8
store i64 %1, i64* %9
store i32 %2, i32* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i8** %6, i8*** %14
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %20
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8** %21
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8** %22
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %23
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8** %24
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8** %25
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8** %26
store i64 0, i64* %16
store i64 0, i64* %15
%27 = load i8*, i8** %20
%28 = call i64 @strlen(i8* %27)
%29 = load i64, i64* %8
%30 = load i64, i64* %9
%31 = mul i64 %29, %30
%32 = add i64 %31, 1
%33 = call i64 @log10(i64 %32)
%34 = add nsw i64 %28, %33
%35 = add nsw i64 %34, 1
%36 = load i64, i64* %16
%37 = add i64 %36, %35
store i64 %37, i64* %16
%38 = load i64, i64* %15
%39 = add i64 %38, 1
store i64 %39, i64* %15
%40 = load i8*, i8** %21
%41 = call i64 @strlen(i8* %40)
%42 = load i64, i64* %8
%43 = add i64 %42, 1
%44 = call i64 @log10(i64 %43)
%45 = add nsw i64 %41, %44
%46 = add nsw i64 %45, 1
%47 = load i64, i64* %16
%48 = add i64 %47, %46
store i64 %48, i64* %16
%49 = load i64, i64* %15
%50 = add i64 %49, 1
store i64 %50, i64* %15
%51 = load i8*, i8** %22
%52 = call i64 @strlen(i8* %51)
%53 = load i64, i64* %9
%54 = add i64 %53, 1
%55 = call i64 @log10(i64 %54)
%56 = add nsw i64 %52, %55
%57 = add nsw i64 %56, 1
%58 = load i64, i64* %16
%59 = add i64 %58, %57
store i64 %59, i64* %16
%60 = load i64, i64* %15
%61 = add i64 %60, 1
store i64 %61, i64* %15
%62 = load i8*, i8** %23
%63 = call i64 @strlen(i8* %62)
%64 = add nsw i64 %63, 1
%65 = add nsw i64 %64, 1
%66 = load i64, i64* %16
%67 = add i64 %66, %65
store i64 %67, i64* %16
%68 = load i64, i64* %15
%69 = add i64 %68, 1
store i64 %69, i64* %15
%70 = load i8*, i8** %24
%71 = call i64 @strlen(i8* %70)
%72 = load i64, i64* %11
%73 = add i64 %72, 1
%74 = call i64 @log10(i64 %73)
%75 = add nsw i64 %71, %74
%76 = add nsw i64 %75, 1
%77 = load i64, i64* %16
%78 = add i64 %77, %76
store i64 %78, i64* %16
%79 = load i64, i64* %15
%80 = add i64 %79, 1
store i64 %80, i64* %15
%81 = load i8*, i8** %25
%82 = call i64 @strlen(i8* %81)
%83 = load i64, i64* %12
%84 = add i64 %83, 1
%85 = call i64 @log10(i64 %84)
%86 = add nsw i64 %82, %85
%87 = add nsw i64 %86, 1
%88 = load i64, i64* %16
%89 = add i64 %88, %87
store i64 %89, i64* %16
%90 = load i64, i64* %15
%91 = add i64 %90, 1
store i64 %91, i64* %15
%92 = load i8*, i8** %26
%93 = call i64 @strlen(i8* %92)
%94 = load i64, i64* %13
%95 = add i64 %94, 1
%96 = call i64 @log10(i64 %95)
%97 = add nsw i64 %93, %96
%98 = add nsw i64 %97, 1
%99 = load i64, i64* %16
%100 = add i64 %99, %98
store i64 %100, i64* %16
%101 = load i64, i64* %15
%102 = add i64 %101, 1
store i64 %102, i64* %15
%103 = load i8**, i8*** %14
store i8** %103, i8*** %19
br label %104
104: ; preds = %117, %7
%105 = load i8**, i8*** %19
%106 = load i8*, i8** %105
%107 = icmp ne i8* %106, null
br i1 %107, label %108, label %120
108: ; preds = %104
%109 = load i8**, i8*** %19
%110 = load i8*, i8** %109
%111 = call i64 @strlen(i8* %110)
%112 = add nsw i64 %111, 1
%113 = load i64, i64* %16
%114 = add i64 %113, %112
store i64 %114, i64* %16
%115 = load i64, i64* %15
%116 = add i64 %115, 1
store i64 %116, i64* %15
br label %117
117: ; preds = %108
%118 = load i8**, i8*** %19
%119 = getelementptr inbounds i8*, i8** %118, i32 1
store i8** %119, i8*** %19
br label %104
120: ; preds = %104
%121 = load i64, i64* %16
%122 = add i64 %121, 1
%123 = call i8* @malloc(i64 %122)
store i8* %123, i8** %17
%124 = load i8*, i8** %17
%125 = icmp ne i8* %124, null
br i1 %125, label %128, label %126
126: ; preds = %120
%127 = call i32 @errori(i32* null)
br label %128
128: ; preds = %126, %120
%129 = load i8*, i8** %17
store i8* %129, i8** %18
%130 = load i8*, i8** %18
%131 = load i8*, i8** %20
%132 = load i64, i64* %8
%133 = load i64, i64* %9
%134 = mul i64 %132, %133
%135 = call i32 (i8*, i8*, ...) @sprintf(i8* %130, i8* %131, i64 %134)
%136 = load i8*, i8** %18
%137 = sext i32 %135 to i64
%138 = getelementptr inbounds i8, i8* %136, i64 %137
store i8* %138, i8** %18
%139 = load i8*, i8** %18
%140 = load i8*, i8** %21
%141 = load i64, i64* %8
%142 = call i32 (i8*, i8*, ...) @sprintf(i8* %139, i8* %140, i64 %141)
%143 = load i8*, i8** %18
%144 = sext i32 %142 to i64
%145 = getelementptr inbounds i8, i8* %143, i64 %144
store i8* %145, i8** %18
%146 = load i8*, i8** %18
%147 = load i8*, i8** %22
%148 = load i64, i64* %9
%149 = call i32 (i8*, i8*, ...) @sprintf(i8* %146, i8* %147, i64 %148)
%150 = load i8*, i8** %18
%151 = sext i32 %149 to i64
%152 = getelementptr inbounds i8, i8* %150, i64 %151
store i8* %152, i8** %18
%153 = load i8*, i8** %18
%154 = load i8*, i8** %23
%155 = load i32, i32* %10
%156 = icmp ne i32 %155, 0
%157 = zext i1 %156 to i64
%158 = select i1 %156, i32 1, i32 0
%159 = call i32 (i8*, i8*, ...) @sprintf(i8* %153, i8* %154, i32 %158)
%160 = load i8*, i8** %18
%161 = sext i32 %159 to i64
%162 = getelementptr inbounds i8, i8* %160, i64 %161
store i8* %162, i8** %18
%163 = load i8*, i8** %18
%164 = load i8*, i8** %24
%165 = load i64, i64* %11
%166 = call i32 (i8*, i8*, ...) @sprintf(i8* %163, i8* %164, i64 %165)
%167 = load i8*, i8** %18
%168 = sext i32 %166 to i64
%169 = getelementptr inbounds i8, i8* %167, i64 %168
store i8* %169, i8** %18
%170 = load i8*, i8** %18
%171 = load i8*, i8** %25
%172 = load i64, i64* %12
%173 = call i32 (i8*, i8*, ...) @sprintf(i8* %170, i8* %171, i64 %172)
%174 = load i8*, i8** %18
%175 = sext i32 %173 to i64
%176 = getelementptr inbounds i8, i8* %174, i64 %175
store i8* %176, i8** %18
%177 = load i8*, i8** %18
%178 = load i8*, i8** %26
%179 = load i64, i64* %13
%180 = call i32 (i8*, i8*, ...) @sprintf(i8* %177, i8* %178, i64 %179)
%181 = load i8*, i8** %18
%182 = sext i32 %180 to i64
%183 = getelementptr inbounds i8, i8* %181, i64 %182
store i8* %183, i8** %18
%184 = load i8**, i8*** %14
store i8** %184, i8*** %19
br label %185
185: ; preds = %197, %128
%186 = load i8**, i8*** %19
%187 = load i8*, i8** %186
%188 = icmp ne i8* %187, null
br i1 %188, label %189, label %200
189: ; preds = %185
%190 = load i8*, i8** %18
%191 = load i8**, i8*** %19
%192 = load i8*, i8** %191
%193 = call i32 (i8*, i8*, ...) @sprintf(i8* %190, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %192)
%194 = load i8*, i8** %18
%195 = sext i32 %193 to i64
%196 = getelementptr inbounds i8, i8* %194, i64 %195
store i8* %196, i8** %18
br label %197
197: ; preds = %189
%198 = load i8**, i8*** %19
%199 = getelementptr inbounds i8*, i8** %198, i32 1
store i8** %199, i8*** %19
br label %185
200: ; preds = %185
%201 = load i8*, i8** %17
ret i8* %201
}

LLVM IR (-O2):
@.str = [18 x i8] c" -DIMAGE_SIZE=%zu\00"
@.str.1 = [19 x i8] c" -DIMAGE_WIDTH=%zu\00"
@.str.2 = [20 x i8] c" -DIMAGE_HEIGHT=%zu\00"
@.str.3 = [10 x i8] c" -DPSF=%d\00"
@.str.4 = [17 x i8] c" -DPSF_WIDTH=%zu\00"
@.str.5 = [18 x i8] c" -DPSF_HEIGHT=%zu\00"
@.str.6 = [19 x i8] c" -DQUAD_POINTS=%zu\00"
@.str.7 = [4 x i8] c" %s\00"
define noalias i8* @kernel_options(i64 %0, i64 %1, i32 %2, i64 %3, i64 %4, i64 %5, i8** nocapture %6) {
%8 = mul i64 %1, %0
%9 = add i64 %8, 1
%10 = tail call i64 @log10(i64 %9)
%11 = add i64 %0, 1
%12 = tail call i64 @log10(i64 %11)
%13 = add i64 %1, 1
%14 = tail call i64 @log10(i64 %13)
%15 = add i64 %3, 1
%16 = tail call i64 @log10(i64 %15)
%17 = add i64 %4, 1
%18 = tail call i64 @log10(i64 %17)
%19 = add i64 %5, 1
%20 = tail call i64 @log10(i64 %19)
%21 = add i64 %10, 122
%22 = add i64 %21, %12
%23 = add i64 %22, %14
%24 = add i64 %23, %16
%25 = add i64 %24, %18
%26 = add i64 %25, %20
%27 = load i8*, i8** %6
%28 = icmp eq i8* %27, null
br i1 %28, label %39, label %29
29: ; preds = %7, %29
%30 = phi i8* [ %37, %29 ], [ %27, %7 ]
%31 = phi i64 [ %35, %29 ], [ %26, %7 ]
%32 = phi i8** [ %36, %29 ], [ %6, %7 ]
%33 = tail call i64 @strlen(i8* %30)
%34 = add i64 %31, 1
%35 = add i64 %34, %33
%36 = getelementptr inbounds i8*, i8** %32, i64 1
%37 = load i8*, i8** %36
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %29
39: ; preds = %29, %7
%40 = phi i64 [ %26, %7 ], [ %35, %29 ]
%41 = add i64 %40, 1
%42 = tail call i8* @malloc(i64 %41)
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = tail call i32 @errori(i32* null)
br label %46
46: ; preds = %44, %39
%47 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %42, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %8)
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %42, i64 %48
%50 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %49, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i64 %0)
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %49, i64 %51
%53 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %52, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 %1)
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = icmp ne i32 %2, 0
%57 = zext i1 %56 to i32
%58 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %55, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %55, i64 %59
%61 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %60, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i64 %3)
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %63, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i64 %4)
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %63, i64 %65
%67 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %66, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i64 %5)
%68 = load i8*, i8** %6
%69 = icmp eq i8* %68, null
br i1 %69, label %83, label %70
70: ; preds = %46
%71 = sext i32 %67 to i64
%72 = getelementptr inbounds i8, i8* %66, i64 %71
br label %73
73: ; preds = %70, %73
%74 = phi i8* [ %81, %73 ], [ %68, %70 ]
%75 = phi i8* [ %79, %73 ], [ %72, %70 ]
%76 = phi i8** [ %80, %73 ], [ %6, %70 ]
%77 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %75, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %74)
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %75, i64 %78
%80 = getelementptr inbounds i8*, i8** %76, i64 1
%81 = load i8*, i8** %80
%82 = icmp eq i8* %81, null
br i1 %82, label %83, label %73
83: ; preds = %73, %46
ret i8* %42
}