#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 */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ write_socket(int, char *, int /*<<< orphan*/);
void not_modified(int client_sockfd) {
  char buffer[8096];
  sprintf(buffer, "HTTP/1.1 304 Not Modified\r\n");
  write_socket(client_sockfd, buffer, strlen(buffer));
  sprintf(buffer, "Server: httpServer/0.1.1\r\n");
  write_socket(client_sockfd, buffer, strlen(buffer));
  time_t raw_time;
  struct tm *current_time;
  time(&raw_time);
  current_time = localtime(&raw_time);
  char date_buf[512];
  strftime(date_buf, 512, "Date: %a, %d %b %Y %T %Z", current_time);
  write_socket(client_sockfd, date_buf, strlen(date_buf));
  write_socket(client_sockfd, "\r\n", strlen("\r\n"));
}


x86 assembly (clang, -O0):
<not_modified>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2200,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1fb0(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21f4(%rbp)
lea    -0x1fb0(%rbp),%rax
mov    %rax,-0x21f0(%rbp)
lea    -0x1fb0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x21f4(%rbp),%edi
mov    -0x21f0(%rbp),%rsi
mov    %eax,%edx
call   1040 <write_socket@plt>
lea    -0x1fb0(%rbp),%rdi
lea    0xe56(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21e4(%rbp)
lea    -0x1fb0(%rbp),%rax
mov    %rax,-0x21e0(%rbp)
lea    -0x1fb0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x21e4(%rbp),%edi
mov    -0x21e0(%rbp),%rsi
mov    %eax,%edx
call   1040 <write_socket@plt>
lea    -0x1fb4(%rbp),%rdi
call   1060 <time@plt>
lea    -0x1fb4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x1fc0(%rbp)
lea    -0x21c0(%rbp),%rdi
mov    -0x1fc0(%rbp),%rcx
mov    $0x200,%esi
lea    0xdfc(%rip),%rdx
call   1070 <strftime@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21d4(%rbp)
lea    -0x21c0(%rbp),%rax
mov    %rax,-0x21d0(%rbp)
lea    -0x21c0(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x21d4(%rbp),%edi
mov    -0x21d0(%rbp),%rsi
mov    %eax,%edx
call   1040 <write_socket@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21c4(%rbp)
lea    0xdad(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x21c4(%rbp),%edi
mov    %eax,%edx
lea    0xd99(%rip),%rsi
call   1040 <write_socket@plt>
add    $0x2200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_modified>:
push   %rbp
push   %rbx
sub    $0x21b8,%rsp
mov    %edi,%ebp
movups 0xeaa(%rip),%xmm0
movups %xmm0,0x21c(%rsp)
movups 0xe8f(%rip),%xmm0
movaps %xmm0,0x210(%rsp)
lea    0x210(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write_socket@plt>
movups 0xe80(%rip),%xmm0
movaps %xmm0,0x210(%rsp)
movups 0xe7c(%rip),%xmm0
movups %xmm0,0x21b(%rsp)
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write_socket@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xe54(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %rax,%rcx
call   1070 <strftime@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write_socket@plt>
lea    0xe21(%rip),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write_socket@plt>
add    $0x21b8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [28 x i8] c"HTTP/1.1 304 Not Modified\0D\0A\00"
@.str.1 = [27 x i8] c"Server: httpServer/0.1.1\0D\0A\00"
@.str.2 = [25 x i8] c"Date: %a, %d %b %Y %T %Z\00"
@.str.3 = [3 x i8] c"\0D\0A\00"
define void @not_modified(i32 %0) {
%2 = alloca i32
%3 = alloca [8096 x i8]
%4 = alloca i32
%5 = alloca %struct.tm*
%6 = alloca [512 x i8]
store i32 %0, i32* %2
%7 = getelementptr inbounds [8096 x i8], [8096 x i8]* %3, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = getelementptr inbounds [8096 x i8], [8096 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [8096 x i8], [8096 x i8]* %3, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @write_socket(i32 %9, i8* %10, i32 %12)
%14 = getelementptr inbounds [8096 x i8], [8096 x i8]* %3, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = getelementptr inbounds [8096 x i8], [8096 x i8]* %3, i64 0, i64 0
%18 = getelementptr inbounds [8096 x i8], [8096 x i8]* %3, i64 0, i64 0
%19 = call i32 @strlen(i8* %18)
%20 = call i32 @write_socket(i32 %16, i8* %17, i32 %19)
%21 = call i32 @time(i32* %4)
%22 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %22, %struct.tm** %5
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%24 = load %struct.tm*, %struct.tm** %5
%25 = call i32 @strftime(i8* %23, i32 512, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %24)
%26 = load i32, i32* %2
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%28 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%29 = call i32 @strlen(i8* %28)
%30 = call i32 @write_socket(i32 %26, i8* %27, i32 %29)
%31 = load i32, i32* %2
%32 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 @write_socket(i32 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %32)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [28 x i8] c"HTTP/1.1 304 Not Modified\0D\0A\00"
@.str.1 = [27 x i8] c"Server: httpServer/0.1.1\0D\0A\00"
@.str.2 = [25 x i8] c"Date: %a, %d %b %Y %T %Z\00"
@.str.3 = [3 x i8] c"\0D\0A\00"
define void @not_modified(i32 %0) {
%2 = alloca [8096 x i8]
%3 = alloca i32
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [8096 x i8], [8096 x i8]* %2, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write_socket(i32 %0, i8* %5, i32 %6)
%8 = call i32 @strlen(i8* %5)
%9 = call i32 @write_socket(i32 %0, i8* %5, i32 %8)
%10 = bitcast i32* %3 to i8*
%11 = call i32 @time(i32* %3)
%12 = call %struct.tm* @localtime(i32* %3)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%14 = call i32 @strftime(i8* %13, i32 512, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %12)
%15 = call i32 @strlen(i8* %13)
%16 = call i32 @write_socket(i32 %0, i8* %13, i32 %15)
%17 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @write_socket(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %17)
ret void
}