#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ gen_unk_fluffval(int /*<<< orphan*/ *, int, int, char *);
void gen_fluffval(FILE *outfile, int fluffval, int unk_fluff, int dim,
                  char *regname) {
  if (!unk_fluff && !fluffval) {
    fprintf(outfile, "0");
    return;
  }
  if (fluffval) {
    if (unk_fluff) {
      fprintf(outfile, "max(");
    }
    fprintf(outfile, "%d", fluffval);
  }
  if (unk_fluff) {
    if (fluffval) {
      fprintf(outfile, ",");
    }
    gen_unk_fluffval(outfile, unk_fluff, dim, regname);
    if (fluffval) {
      fprintf(outfile, ")");
    }
  }
}


x86 assembly (clang, -O0):
<gen_fluffval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1164 <gen_fluffval+0x44>
cmpl   $0x0,-0xc(%rbp)
jne    1164 <gen_fluffval+0x44>
mov    -0x8(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11f9 <gen_fluffval+0xd9>
cmpl   $0x0,-0xc(%rbp)
je     119f <gen_fluffval+0x7f>
cmpl   $0x0,-0x10(%rbp)
je     118a <gen_fluffval+0x6a>
mov    -0x8(%rbp),%rdi
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe6f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,-0x10(%rbp)
je     11f9 <gen_fluffval+0xd9>
cmpl   $0x0,-0xc(%rbp)
je     11c5 <gen_fluffval+0xa5>
mov    -0x8(%rbp),%rdi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <gen_unk_fluffval@plt>
cmpl   $0x0,-0xc(%rbp)
je     11f4 <gen_fluffval+0xd4>
mov    -0x8(%rbp),%rdi
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11f9 <gen_fluffval+0xd9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_fluffval>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r12
mov    %edx,%eax
or     %esi,%eax
je     11b7 <gen_fluffval+0x77>
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%ebp
mov    %esi,%ebx
test   %esi,%esi
je     11cc <gen_fluffval+0x8c>
test   %ebp,%ebp
je     11e8 <gen_fluffval+0xa8>
lea    0xe92(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1060 <fwrite@plt>
lea    0xe7e(%rip),%rsi
mov    %r12,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x2c,%edi
mov    %r12,%rsi
call   1030 <fputc@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1050 <gen_unk_fluffval@plt>
mov    $0x29,%edi
jmp    11bc <gen_fluffval+0x7c>
mov    $0x30,%edi
mov    %r12,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputc@plt>
test   %ebp,%ebp
je     1203 <gen_fluffval+0xc3>
mov    %r12,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <gen_unk_fluffval@plt>
lea    0xe16(%rip),%rsi
mov    %r12,%rdi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [5 x i8] c"max(\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [2 x i8] c")\00"
define void @gen_fluffval(i32* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %8
%12 = icmp ne i32 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32*, i32** %6
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %53
19: ; preds = %13, %5
%20 = load i32, i32* %7
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = load i32, i32* %8
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32*, i32** %6
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %25, %22
%29 = load i32*, i32** %6
%30 = load i32, i32* %7
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %28, %19
%33 = load i32, i32* %8
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %53
35: ; preds = %32
%36 = load i32, i32* %7
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32*, i32** %6
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %38, %35
%42 = load i32*, i32** %6
%43 = load i32, i32* %8
%44 = load i32, i32* %9
%45 = load i8*, i8** %10
%46 = call i32 @gen_unk_fluffval(i32* %42, i32 %43, i32 %44, i8* %45)
%47 = load i32, i32* %7
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %41
%50 = load i32*, i32** %6
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %52
52: ; preds = %49, %41
br label %53
53: ; preds = %16, %52, %32
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"max(\00"
@.str.2 = [3 x i8] c"%d\00"
define void @gen_fluffval(i32* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = icmp eq i32 %2, 0
%7 = or i32 %2, %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @fputc(i32 48, i32* %0)
br label %25
11: ; preds = %5
%12 = icmp eq i32 %1, 0
br i1 %12, label %16, label %13
13: ; preds = %11
br i1 %6, label %14, label %17
14: ; preds = %13
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1)
br label %25
16: ; preds = %11
br i1 %6, label %25, label %23
17: ; preds = %13
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4, i64 1, i32* %0)
%19 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%20 = tail call i32 @fputc(i32 44, i32* %0)
%21 = tail call i32 @gen_unk_fluffval(i32* %0, i32 %2, i32 %3, i8* %4)
%22 = tail call i32 @fputc(i32 41, i32* %0)
br label %25
23: ; preds = %16
%24 = tail call i32 @gen_unk_fluffval(i32* %0, i32 %2, i32 %3, i8* %4)
br label %25
25: ; preds = %14, %23, %17, %9, %16
ret void
}