#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*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char const *, int const, char const *,
                          char const *, int const, char const *, char const *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
print_request(const char *IP, const int port, const char *method,
              const char *protocol, const int status, const char *reason,
              const char *URI) {
  time_t timer;
  char buffer[26];
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buffer, 26, "%b %d %H:%M:%S", tm_info);
  printf("%s %s:%d %s / %s; HTTP/1.0 %d %s; %s\n", buffer, IP, port, method,
         protocol, status, reason, URI);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<print_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
lea    -0x34(%rbp),%rdi
call   1050 <time@plt>
lea    -0x34(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rcx
mov    $0x1a,%esi
lea    0xe73(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x50(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
lea    0xe57(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <printf@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_request>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,%r12
mov    %rdx,%r13
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0x1c(%rsp),%r14
mov    %r14,%rdi
call   1050 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xe80(%rip),%rdx
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x1a,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
sub    $0x8,%rsp
lea    0xe6f(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r13,%r8
mov    %r12,%r9
push   0x88(%rsp)
push   0x18(%rsp)
push   0x28(%rsp)
call   1040 <printf@plt>
add    $0x20,%rsp
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%b %d %H:%M:%S\00"
@.str.1 = [38 x i8] c"%s %s:%d %s / %s; HTTP/1.0 %d %s; %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @print_request(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca [26 x i8]
%17 = alloca %struct.tm*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%18 = call i32 @time(i32* %15)
%19 = call %struct.tm* @localtime(i32* %15)
store %struct.tm* %19, %struct.tm** %17
%20 = getelementptr inbounds [26 x i8], [26 x i8]* %16, i64 0, i64 0
%21 = load %struct.tm*, %struct.tm** %17
%22 = call i32 @strftime(i8* %20, i32 26, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %21)
%23 = getelementptr inbounds [26 x i8], [26 x i8]* %16, i64 0, i64 0
%24 = load i8*, i8** %8
%25 = load i32, i32* %9
%26 = load i8*, i8** %10
%27 = load i8*, i8** %11
%28 = load i32, i32* %12
%29 = load i8*, i8** %13
%30 = load i8*, i8** %14
%31 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %23, i8* %24, i32 %25, i8* %26, i8* %27, i32 %28, i8* %29, i8* %30)
%32 = load i32, i32* @EXIT_SUCCESS
ret i32 %32
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%b %d %H:%M:%S\00"
@.str.1 = [38 x i8] c"%s %s:%d %s / %s; HTTP/1.0 %d %s; %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @print_request(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca [26 x i8]
%10 = bitcast i32* %8 to i8*
%11 = getelementptr inbounds [26 x i8], [26 x i8]* %9, i64 0, i64 0
%12 = call i32 @time(i32* %8)
%13 = call %struct.tm* @localtime(i32* %8)
%14 = call i32 @strftime(i8* %11, i32 26, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, i8* %6)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}