#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*/ err_abort(char *);
int /*<<< orphan*/ generate_okHeader(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
scalar_t__ strlen(char *);
scalar_t__ write(int, char *, scalar_t__);
void send_post_calculation(int sockfd, int num1, int num2) {
  char response[255 + 1];
  memset(response, '\0', 255 + 1);
  generate_okHeader(NULL, response);
  sprintf(response,
          "%s<HTML><BODY><center><h1> Ergebnis: %d</h1></center></BODY></HTML>",
          response, num1 * num2);
  if (write(sockfd, response, strlen(response)) != strlen(response)) {
    err_abort("Fehler beim Schreiben des Sockets!");
  }
}


x86 assembly (clang, -O0):
<send_post_calculation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x110(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1060 <generate_okHeader@plt>
lea    -0x110(%rbp),%rdi
lea    -0x110(%rbp),%rdx
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
lea    0xe4d(%rip),%rsi
call   1080 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x124(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x120(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x124(%rbp),%edi
mov    -0x120(%rbp),%rsi
mov    %rax,%rdx
call   1030 <write@plt>
mov    %rax,-0x118(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x118(%rbp),%rax
cmp    %rcx,%rax
je     1222 <send_post_calculation+0xc2>
lea    0xe27(%rip),%rdi
call   1070 <err_abort@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_post_calculation>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%r14d
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <generate_okHeader@plt>
imul   %r15d,%ebp
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1080 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <write@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    %rax,%rbp
je     11db <send_post_calculation+0x7b>
lea    0xe6e(%rip),%rdi
call   1070 <err_abort@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [68 x i8] c"%s<HTML><BODY><center><h1> Ergebnis: %d</h1></center></BODY></HTML>\00"
@.str.1 = [35 x i8] c"Fehler beim Schreiben des Sockets!\00"
define void @send_post_calculation(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [256 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = call i32 @memset(i8* %8, i8 signext 0, i32 256)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%11 = call i32 @generate_okHeader(i32* null, i8* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %16)
%18 = load i32, i32* %4
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%21 = call i64 @strlen(i8* %20)
%22 = call i64 @write(i32 %18, i8* %19, i64 %21)
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%24 = call i64 @strlen(i8* %23)
%25 = icmp ne i64 %22, %24
br i1 %25, label %26, label %28
26: ; preds = %3
%27 = call i32 @err_abort(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %3
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"%s<HTML><BODY><center><h1> Ergebnis: %d</h1></center></BODY></HTML>\00"
@.str.1 = [35 x i8] c"Fehler beim Schreiben des Sockets!\00"
define void @send_post_calculation(i32 %0, i32 %1, i32 %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i8 signext 0, i32 256)
%7 = call i32 @generate_okHeader(i32* null, i8* %5)
%8 = mul nsw i32 %2, %1
%9 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %8)
%10 = call i64 @strlen(i8* %5)
%11 = call i64 @write(i32 %0, i8* %5, i64 %10)
%12 = call i64 @strlen(i8* %5)
%13 = icmp eq i64 %11, %12
br i1 %13, label %16, label %14
14: ; preds = %3
%15 = call i32 @err_abort(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
ret void
}