#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*/ codemode(int, int, int);
int /*<<< orphan*/ error(char *);
int findmode(char *, int *);
int standard3(int code, char *label, char *mnemo, char *oper) {
  register int add;
  int value;
  add = findmode(oper, &value);
  if (add == 0x10) {
    add = 0x30;
  }
  codemode(code, add, value);
  if (add <= 0x10) {
    error("Bad addressing mode");
  }
  return 0;
}


x86 assembly (clang, -O0):
<standard3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <findmode@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jne    1168 <standard3+0x38>
movl   $0x30,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
call   1030 <codemode@plt>
cmpl   $0x10,-0x24(%rbp)
jg     118c <standard3+0x5c>
lea    0xe79(%rip),%rdi
call   1050 <error@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard3>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%rsi
mov    %rcx,%rdi
call   1040 <findmode@plt>
cmp    $0x10,%eax
mov    $0x30,%ebp
cmovne %eax,%ebp
mov    0x4(%rsp),%edx
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <codemode@plt>
cmp    $0x10,%ebp
jg     116b <standard3+0x3b>
lea    0xe9a(%rip),%rdi
call   1050 <error@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Bad addressing mode\00"
define i32 @standard3(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = load i8*, i8** %8
%12 = call i32 @findmode(i8* %11, i32* %10)
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = icmp eq i32 %13, 16
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 48, i32* %9
br label %16
16: ; preds = %15, %4
%17 = load i32, i32* %5
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = call i32 @codemode(i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %9
%22 = icmp sle i32 %21, 16
br i1 %22, label %23, label %25
23: ; preds = %16
%24 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %23, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Bad addressing mode\00"
define i32 @standard3(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 @findmode(i8* %3, i32* %5)
%8 = icmp eq i32 %7, 16
%9 = select i1 %8, i32 48, i32 %7
%10 = load i32, i32* %5
%11 = call i32 @codemode(i32 %0, i32 %9, i32 %10)
%12 = icmp slt i32 %9, 17
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %4
ret i32 0
}