#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 */
typedef int /*<<< orphan*/ tmpop;
struct imap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chkone(struct imap *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void chkonecr(struct imap *ci, const char *op, int hli) {
  char tmpop[32];
  snprintf(tmpop, sizeof(tmpop), "%sb", op);
  chkone(ci, tmpop, hli);
  snprintf(tmpop, sizeof(tmpop), "%sw", op);
  chkone(ci, tmpop, hli);
  snprintf(tmpop, sizeof(tmpop), "%sd", op);
  chkone(ci, tmpop, hli);
}


x86 assembly (clang, -O0):
<chkonecr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x20,%esi
lea    0xeb9(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <chkone@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x20,%esi
lea    0xe94(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <chkone@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x20,%esi
lea    0xe6f(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <chkone@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chkonecr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r15d
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xec6(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbp,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <chkone@plt>
lea    0xea2(%rip),%rdx
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbp,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <chkone@plt>
lea    0xe81(%rip),%rdx
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbp,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <chkone@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.imap = type { i32 }
@.str = [4 x i8] c"%sb\00"
@.str.1 = [4 x i8] c"%sw\00"
@.str.2 = [4 x i8] c"%sd\00"
define void @chkonecr(%struct.imap* %0, i8* %1, i32 %2) {
%4 = alloca %struct.imap*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [32 x i8]
store %struct.imap* %0, %struct.imap** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = call i32 @snprintf(i8* %8, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load %struct.imap*, %struct.imap** %4
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%13 = load i32, i32* %6
%14 = call i32 @chkone(%struct.imap* %11, i8* %12, i32 %13)
%15 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %5
%17 = call i32 @snprintf(i8* %15, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = load %struct.imap*, %struct.imap** %4
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%20 = load i32, i32* %6
%21 = call i32 @chkone(%struct.imap* %18, i8* %19, i32 %20)
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%23 = load i8*, i8** %5
%24 = call i32 @snprintf(i8* %22, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load %struct.imap*, %struct.imap** %4
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%27 = load i32, i32* %6
%28 = call i32 @chkone(%struct.imap* %25, i8* %26, i32 %27)
ret void
}

LLVM IR (-O2):
%struct.imap = type { i32 }
@.str = [4 x i8] c"%sb\00"
@.str.1 = [4 x i8] c"%sw\00"
@.str.2 = [4 x i8] c"%sd\00"
define void @chkonecr(%struct.imap* %0, i8* %1, i32 %2) {
%4 = alloca [32 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = call i32 @chkone(%struct.imap* %0, i8* %5, i32 %2)
%8 = call i32 @snprintf(i8* %5, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%9 = call i32 @chkone(%struct.imap* %0, i8* %5, i32 %2)
%10 = call i32 @snprintf(i8* %5, i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%11 = call i32 @chkone(%struct.imap* %0, i8* %5, i32 %2)
ret void
}