#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*/ e(int);
int /*<<< orphan*/ set_err(char *);
ass_res() {
  char c, *pc;
  int i;
  int s_extend;
  set_err("ass_res");
  c = -1;
  i = c;
  s_extend = i == -1;
  pc = &c;
  i = (*pc++ = 01777);
  switch (i) {
  case 01777:
    e(1);
    break;
  case -1:
    if (!s_extend)
      e(2);
    break;
  case 0377:
    if (s_extend)
      e(3);
    break;
  default:
    e(4);
  }
}


x86 assembly (clang, -O0):
<ass_res>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1040 <set_err@plt>
movb   $0xff,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0xffffffff,%eax
sete   %al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0xff,(%rax)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xffffffff,%eax
je     11b8 <ass_res+0x98>
jmp    1183 <ass_res+0x63>
mov    -0x1c(%rbp),%eax
sub    $0xff,%eax
je     11d1 <ass_res+0xb1>
jmp    1196 <ass_res+0x76>
mov    -0x1c(%rbp),%eax
sub    $0x3ff,%eax
jne    11ea <ass_res+0xca>
jmp    11a9 <ass_res+0x89>
mov    $0x1,%edi
call   1030 <e@plt>
jmp    11f4 <ass_res+0xd4>
cmpl   $0x0,-0x18(%rbp)
jne    11cc <ass_res+0xac>
mov    $0x2,%edi
call   1030 <e@plt>
jmp    11f4 <ass_res+0xd4>
cmpl   $0x0,-0x18(%rbp)
je     11e5 <ass_res+0xc5>
mov    $0x3,%edi
call   1030 <e@plt>
jmp    11f4 <ass_res+0xd4>
mov    $0x4,%edi
call   1030 <e@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ass_res>:
lea    0xee9(%rip),%rdi
jmp    1030 <set_err@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ass_res\00"
define i32 @ass_res() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @set_err(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8 -1, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
store i32 %11, i32* %5
store i8* %2, i8** %3
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
store i8 -1, i8* %12
store i32 -1, i32* %4
%14 = load i32, i32* %4
switch i32 %14, label %29 [
i32 1023, label %15
i32 -1, label %17
i32 255, label %23
]
15: ; preds = %0
%16 = call i32 @e(i32 1)
br label %31
17: ; preds = %0
%18 = load i32, i32* %5
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = call i32 @e(i32 2)
br label %22
22: ; preds = %20, %17
br label %31
23: ; preds = %0
%24 = load i32, i32* %5
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @e(i32 3)
br label %28
28: ; preds = %26, %23
br label %31
29: ; preds = %0
%30 = call i32 @e(i32 4)
br label %31
31: ; preds = %29, %28, %22, %15
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [8 x i8] c"ass_res\00"
define i32 @ass_res() {
%1 = tail call i32 @set_err(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}