#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 */
long ConstExpression();
int /*<<< orphan*/ ConsumeComma();
int /*<<< orphan*/ ErrorSkip(char *);
int /*<<< orphan*/ TgtTranslateSet(unsigned int, unsigned char);
void DoCharMap(void) {
  long Index;
  long Code;
  Index = ConstExpression();
  if (Index < 0 || Index > 255) {
    ErrorSkip("Index range error");
    return;
  }
  ConsumeComma();
  Code = ConstExpression();
  if (Code < 0 || Code > 255) {
    ErrorSkip("Code range error");
    return;
  }
  TgtTranslateSet((unsigned)Index, (unsigned char)Code);
}


x86 assembly (clang, -O0):
<DoCharMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ConstExpression@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     116c <DoCharMap+0x2c>
cmpq   $0xff,-0x8(%rbp)
jle    117d <DoCharMap+0x3d>
lea    0xe8d(%rip),%rdi
call   1030 <ErrorSkip@plt>
jmp    11cb <DoCharMap+0x8b>
mov    $0x0,%al
call   1040 <ConsumeComma@plt>
mov    $0x0,%al
call   1050 <ConstExpression@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     11a8 <DoCharMap+0x68>
cmpq   $0xff,-0x10(%rbp)
jle    11b9 <DoCharMap+0x79>
lea    0xe63(%rip),%rdi
call   1030 <ErrorSkip@plt>
jmp    11cb <DoCharMap+0x8b>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movzbl %al,%esi
call   1060 <TgtTranslateSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCharMap>:
push   %rbx
xor    %eax,%eax
call   1050 <ConstExpression@plt>
cmp    $0x100,%rax
jb     115d <DoCharMap+0x1d>
lea    0xea9(%rip),%rdi
pop    %rbx
jmp    1030 <ErrorSkip@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <ConsumeComma@plt>
xor    %eax,%eax
call   1050 <ConstExpression@plt>
cmp    $0x100,%rax
jb     1183 <DoCharMap+0x43>
lea    0xe95(%rip),%rdi
pop    %rbx
jmp    1030 <ErrorSkip@plt>
movzbl %al,%esi
mov    %ebx,%edi
pop    %rbx
jmp    1060 <TgtTranslateSet@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Index range error\00"
@.str.1 = [17 x i8] c"Code range error\00"
define void @DoCharMap() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @ConstExpression()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i64, i64* %1
%8 = icmp sgt i64 %7, 255
br i1 %8, label %9, label %11
9: ; preds = %6, %0
%10 = call i32 @ErrorSkip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %27
11: ; preds = %6
%12 = call i32 (...) @ConsumeComma()
%13 = call i64 (...) @ConstExpression()
store i64 %13, i64* %2
%14 = load i64, i64* %2
%15 = icmp slt i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %11
%17 = load i64, i64* %2
%18 = icmp sgt i64 %17, 255
br i1 %18, label %19, label %21
19: ; preds = %16, %11
%20 = call i32 @ErrorSkip(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %27
21: ; preds = %16
%22 = load i64, i64* %1
%23 = trunc i64 %22 to i32
%24 = load i64, i64* %2
%25 = trunc i64 %24 to i8
%26 = call i32 @TgtTranslateSet(i32 %23, i8 zeroext %25)
br label %27
27: ; preds = %21, %19, %9
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Index range error\00"
@.str.1 = [17 x i8] c"Code range error\00"
define void @DoCharMap() {
%1 = tail call i64 (...) @ConstExpression()
%2 = icmp ugt i64 %1, 255
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @ErrorSkip(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %15
5: ; preds = %0
%6 = tail call i32 (...) @ConsumeComma()
%7 = tail call i64 (...) @ConstExpression()
%8 = icmp ugt i64 %7, 255
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @ErrorSkip(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %15
11: ; preds = %5
%12 = trunc i64 %1 to i32
%13 = trunc i64 %7 to i8
%14 = tail call i32 @TgtTranslateSet(i32 %12, i8 zeroext %13)
br label %15
15: ; preds = %11, %9, %3
ret void
}