#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*/ ems1Fcerr(char *, int *);
int /*<<< orphan*/ emsSetc(char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void emsFacer(const char *token, int fstat) {
  int meslen;
  char mesval[200];
  ;
  strcpy(mesval, "");
  ems1Fcerr(mesval, &fstat);
  meslen = strlen(mesval);
  if (meslen == 0) {
    (void)sprintf(mesval, "Failed get facility error for value %d", fstat);
    meslen = strlen(mesval);
  }
  emsSetc(token, mesval);
  return;
}


x86 assembly (clang, -O0):
<emsFacer>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <ems1Fcerr@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    11c3 <emsFacer+0x73>
lea    -0xe0(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe51(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <emsSetc@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emsFacer>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    %rdi,%r14
mov    %esi,0xc(%rsp)
lea    0xebe(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <ems1Fcerr@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jne    11ae <emsFacer+0x5e>
mov    0xc(%rsp),%edx
lea    0xe67(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1050 <emsSetc@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [39 x i8] c"Failed get facility error for value %d\00"
define void @emsFacer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [200 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%10 = call i32 @ems1Fcerr(i8* %9, i32* %4)
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%17 = load i32, i32* %4
%18 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
store i32 %20, i32* %5
br label %21
21: ; preds = %15, %2
%22 = load i8*, i8** %3
%23 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%24 = call i32 @emsSetc(i8* %22, i8* %23)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [39 x i8] c"Failed get facility error for value %d\00"
define void @emsFacer(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [200 x i8]
store i32 %1, i32* %3
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @ems1Fcerr(i8* %5, i32* %3)
%8 = call i32 @strlen(i8* %5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @strlen(i8* %5)
br label %14
14: ; preds = %10, %2
%15 = call i32 @emsSetc(i8* %0, i8* %5)
ret void
}