#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*/ printf(char *, ...);
void request_too_large(char const *charset) {
  if (!charset)
    charset = "utf-8";
  printf("Content-Type: text/html; charset=%s\n\n", charset);
  printf("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; "
         "charset=%s\"><title>%s</title></head><body><h1>%s</h1><p>",
         charset, "Request is rejected", "Request is rejected");
  printf("Your request has been rejected for its data size exceeds the allowed "
         "maximum.");
  printf("</p></body></html>\n");
}


x86 assembly (clang, -O0):
<request_too_large>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <request_too_large+0x22>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xedd(%rip),%rdi
lea    0xf4f(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_too_large>:
push   %rbx
test   %rdi,%rdi
lea    0xed5(%rip),%rbx
cmovne %rdi,%rbx
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0xf57(%rip),%rcx
mov    %rbx,%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf57(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf97(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"utf-8\00"
@.str.1 = [38 x i8] c"Content-Type: text/html; charset=%s\0A\0A\00"
@.str.2 = [121 x i8] c"<html><head><meta http-equiv=\22Content-Type\22 content=\22text/html; charset=%s\22><title>%s</title></head><body><h1>%s</h1><p>\00"
@.str.3 = [20 x i8] c"Request is rejected\00"
@.str.4 = [78 x i8] c"Your request has been rejected for its data size exceeds the allowed maximum.\00"
@.str.5 = [20 x i8] c"</p></body></html>\0A\00"
define void @request_too_large(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"utf-8\00"
@.str.1 = [38 x i8] c"Content-Type: text/html; charset=%s\0A\0A\00"
@.str.2 = [121 x i8] c"<html><head><meta http-equiv=\22Content-Type\22 content=\22text/html; charset=%s\22><title>%s</title></head><body><h1>%s</h1><p>\00"
@.str.3 = [20 x i8] c"Request is rejected\00"
@.str.4 = [78 x i8] c"Your request has been rejected for its data size exceeds the allowed maximum.\00"
@str = [19 x i8] c"</p></body></html>\00"
define void @request_too_large(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([121 x i8], [121 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}