#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 */
unsigned int getclock();
unsigned int getmem();
int getncpu();
int /*<<< orphan*/ serverconnect(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *, char *,
                            int, unsigned int, unsigned int, int);
void knh_checkSecurityAlert(void) {
  char path[512] = {'\0'};
  unsigned int clock = getclock();
  unsigned int mem = getmem();
  int ncpu = getncpu();
  snprintf(path, 512,
           "/cgi-bin/security-alert/"
           "server?dist=%s&ver=%s&arch=%s(%s)&rev=%d&clock=%u&mem=%u&ncpu=%d&"
           "prev=yes",
           "source", "0.7",
           ("linux"
            ""
            "_64"),
           "x86_64", 1790, clock, mem, ncpu);
  ;
  serverconnect(path);
}


x86 assembly (clang, -O0):
<knh_checkSecurityAlert>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x248,%rsp
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
mov    $0x0,%al
call   1060 <getclock@plt>
mov    %eax,-0x214(%rbp)
mov    $0x0,%al
call   1070 <getmem@plt>
mov    %eax,-0x218(%rbp)
mov    $0x0,%al
call   1050 <getncpu@plt>
mov    %eax,-0x21c(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x214(%rbp),%r11d
mov    -0x218(%rbp),%r10d
mov    -0x21c(%rbp),%eax
mov    $0x200,%esi
lea    0xe33(%rip),%rdx
lea    0xe8e(%rip),%rcx
lea    0xe8e(%rip),%r8
lea    0xe8b(%rip),%r9
lea    0xe8d(%rip),%rbx
mov    %rbx,(%rsp)
movl   $0x6fe,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1080 <serverconnect@plt>
add    $0x248,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<knh_checkSecurityAlert>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%r14
mov    $0x200,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
xor    %eax,%eax
call   1060 <getclock@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1070 <getmem@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getncpu@plt>
sub    $0x8,%rsp
lea    0xed3(%rip),%r10
lea    0xe56(%rip),%rdx
lea    0xeb1(%rip),%rcx
lea    0xeb1(%rip),%r8
lea    0xeae(%rip),%r9
mov    %r14,%rdi
mov    $0x200,%esi
push   %rax
push   %rbx
push   %r15
push   $0x6fe
push   %r10
call   1030 <snprintf@plt>
add    $0x30,%rsp
mov    %r14,%rdi
call   1080 <serverconnect@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [98 x i8] c"/cgi-bin/security-alert/server?dist=%s&ver=%s&arch=%s(%s)&rev=%d&clock=%u&mem=%u&ncpu=%d&prev=yes\00"
@.str.1 = [7 x i8] c"source\00"
@.str.2 = [4 x i8] c"0.7\00"
@.str.3 = [9 x i8] c"linux_64\00"
@.str.4 = [7 x i8] c"x86_64\00"
define void @knh_checkSecurityAlert() {
%1 = alloca [512 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [512 x i8]* %1 to i8*
%6 = call i32 (...) @getclock()
store i32 %6, i32* %2
%7 = call i32 (...) @getmem()
store i32 %7, i32* %3
%8 = call i32 (...) @getncpu()
store i32 %8, i32* %4
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @snprintf(i8* %9, i32 512, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1790, i32 %10, i32 %11, i32 %12)
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%15 = call i32 @serverconnect(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [98 x i8] c"/cgi-bin/security-alert/server?dist=%s&ver=%s&arch=%s(%s)&rev=%d&clock=%u&mem=%u&ncpu=%d&prev=yes\00"
@.str.1 = [7 x i8] c"source\00"
@.str.2 = [4 x i8] c"0.7\00"
@.str.3 = [9 x i8] c"linux_64\00"
@.str.4 = [7 x i8] c"x86_64\00"
define void @knh_checkSecurityAlert() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getclock()
%4 = tail call i32 (...) @getmem()
%5 = tail call i32 (...) @getncpu()
%6 = call i32 @snprintf(i8* %2, i32 512, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1790, i32 %3, i32 %4, i32 %5)
%7 = call i32 @serverconnect(i8* %2)
ret void
}