#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*/ emsSetc(char const *, char *);
int /*<<< orphan*/ emsSeti(char const *, int);
int strspn(char *, char *);
void emsErrno(const char *token, int errval) {
  char mess[200 + 1];
  ;
  ems1Serr(mess, 200, &errval);
  mess[200] = '\0';
  if (strspn(mess, " ") != 200) {
    emsSetc(token, mess);
  } else {
    emsSetc(token, "No translation for errno");
    emsSetc(token, " ");
    emsSeti(token, errval);
  }
  return;
}


x86 assembly (clang, -O0):
<emsErrno>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xe0(%rbp),%rdi
mov    $0xc8,%esi
lea    -0xc(%rbp),%rdx
call   1060 <ems1Serr@plt>
movb   $0x0,-0x18(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strspn@plt>
cmp    $0xc8,%eax
je     119e <emsErrno+0x5e>
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <emsSetc@plt>
jmp    11ca <emsErrno+0x8a>
mov    -0x8(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1050 <emsSetc@plt>
mov    -0x8(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1050 <emsSetc@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <emsSeti@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emsErrno>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    $0xc8,%esi
call   1060 <ems1Serr@plt>
movb   $0x0,0xd8(%rsp)
lea    0xe89(%rip),%rsi
mov    %r14,%rdi
call   1040 <strspn@plt>
cmp    $0xc8,%eax
jne    11b2 <emsErrno+0x72>
lea    0xe75(%rip),%rsi
mov    %rbx,%rdi
call   1050 <emsSetc@plt>
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1050 <emsSetc@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <emsSeti@plt>
jmp    11bf <emsErrno+0x7f>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <emsSetc@plt>
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [25 x i8] c"No translation for errno\00"
define void @emsErrno(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [201 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [201 x i8], [201 x i8]* %5, i64 0, i64 0
%7 = call i32 @ems1Serr(i8* %6, i32 200, i32* %4)
%8 = getelementptr inbounds [201 x i8], [201 x i8]* %5, i64 0, i64 200
store i8 0, i8* %8
%9 = getelementptr inbounds [201 x i8], [201 x i8]* %5, i64 0, i64 0
%10 = call i32 @strspn(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i32 %10, 200
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = getelementptr inbounds [201 x i8], [201 x i8]* %5, i64 0, i64 0
%15 = call i32 @emsSetc(i8* %13, i8* %14)
br label %24
16: ; preds = %2
%17 = load i8*, i8** %3
%18 = call i32 @emsSetc(i8* %17, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%19 = load i8*, i8** %3
%20 = call i32 @emsSetc(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = call i32 @emsSeti(i8* %21, i32 %22)
br label %24
24: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [25 x i8] c"No translation for errno\00"
define void @emsErrno(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
%6 = call i32 @ems1Serr(i8* %5, i32 200, i32* %3)
%7 = getelementptr inbounds [201 x i8], [201 x i8]* %4, i64 0, i64 200
store i8 0, i8* %7
%8 = call i32 @strspn(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 200
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @emsSetc(i8* %0, i8* %5)
br label %17
12: ; preds = %2
%13 = call i32 @emsSetc(i8* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @emsSetc(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = call i32 @emsSeti(i8* %0, i32 %15)
br label %17
17: ; preds = %12, %10
ret void
}