#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*/ ems1Serr(char *, int, int *);
int /*<<< orphan*/ ems1Stok(char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
size_t strlen(char *);
void emsSyser(const char *token, int systat) {
  size_t meslen;
  char mesval[200 + 1];
  ;
  mesval[0] = '\0';
  ems1Serr(mesval, 200, &systat);
  meslen = strlen(mesval);
  if (meslen == 0) {
    sprintf(mesval, "No translation for System status value %d", systat);
  }
  ems1Stok(token, mesval);
  return;
}


x86 assembly (clang, -O0):
<emsSyser>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xf0(%rbp)
lea    -0xf0(%rbp),%rdi
mov    $0xc8,%esi
lea    -0xc(%rbp),%rdx
call   1050 <ems1Serr@plt>
lea    -0xf0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    119f <emsSyser+0x5f>
lea    -0xf0(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe66(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1040 <ems1Stok@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emsSyser>:
push   %rbx
sub    $0xe0,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rdx
mov    $0xc8,%esi
call   1040 <ems1Serr@plt>
cmpb   $0x0,0x10(%rsp)
jne    1174 <emsSyser+0x44>
mov    0xc(%rsp),%edx
lea    0xe96(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1050 <sprintf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <ems1Stok@plt>
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"No translation for System status value %d\00"
define void @emsSyser(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca [201 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 0
store i8 0, i8* %7
%8 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 0
%9 = call i32 @ems1Serr(i8* %8, i32 200, i32* %4)
%10 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 0
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 0
%16 = load i32, i32* %4
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %14, %2
%19 = load i8*, i8** %3
%20 = getelementptr inbounds [201 x i8], [201 x i8]* %6, i64 0, i64 0
%21 = call i32 @ems1Stok(i8* %19, i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"No translation for System status value %d\00"
define void @emsSyser(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [201 x i8]
store i32 %1, i32* %3
%5 = getelementptr inbounds [201 x i8], [201 x i8]* %4, i64 0, i64 0
store i8 0, i8* %5
%6 = call i32 @ems1Serr(i8* %5, i32 200, i32* %3)
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %2
%13 = call i32 @ems1Stok(i8* %0, i8* %5)
ret void
}