#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void set_mode(int on_off, int mode) {
  char *tags[] = {"<strong>",
                  "</strong>",
                  "<font color=\"#336600\">",
                  "</font>",
                  "<font color=\"#336600\">",
                  "</font>",
                  "<font color=\"#663300\"><strong>",
                  "</strong></font>",
                  "<font color=\"#0000CC\">",
                  "</font>",
                  NULL,
                  NULL};
  fprintf(stdout, tags[mode + 1 - on_off]);
}


x86 assembly (clang, -O0):
<set_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
lea    0x2c77(%rip),%rsi
mov    $0x60,%edx
call   1040 <memcpy@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0x4(%rbp),%eax
cltq
mov    -0x70(%rbp,%rax,8),%rsi
call   1030 <fprintf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mode>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
sub    %edi,%esi
add    $0x1,%esi
movslq %esi,%rcx
lea    0x2c88(%rip),%rdx
mov    (%rdx,%rcx,8),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"<strong>\00"
@.str.1 = [10 x i8] c"</strong>\00"
@.str.2 = [23 x i8] c"<font color=\22\22>\00"
@.str.3 = [8 x i8] c"</font>\00"
@.str.4 = [31 x i8] c"<font color=\22\22><strong>\00"
@.str.5 = [17 x i8] c"</strong></font>\00"
@.str.6 = [23 x i8] c"<font color=\22CC\22>\00"
@__const.set_mode.tags = [12 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* null, i8* null]
@stdout = global i32 0
define void @set_mode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [12 x i8*]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast [12 x i8*]* %5 to i8*
%7 = load i32, i32* @stdout
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [12 x i8*], [12 x i8*]* %5, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %7, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"<strong>\00"
@.str.1 = [10 x i8] c"</strong>\00"
@.str.2 = [23 x i8] c"<font color=\22\22>\00"
@.str.3 = [8 x i8] c"</font>\00"
@.str.4 = [31 x i8] c"<font color=\22\22><strong>\00"
@.str.5 = [17 x i8] c"</strong></font>\00"
@.str.6 = [23 x i8] c"<font color=\22CC\22>\00"
@__const.set_mode.tags = [12 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0), i8* null, i8* null]
@stdout = global i32 0
define void @set_mode(i32 %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [12 x i8*], [12 x i8*]* @__const.set_mode.tags, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 @fprintf(i32 %3, i8* %8)
ret void
}