#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*/ cclc(int);
int /*<<< orphan*/ ccrgl(int);
int /*<<< orphan*/ cdlam(int *, int /*<<< orphan*/, int /*<<< orphan*/, int,
                         int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ cdreg(int *, int /*<<< orphan*/, int /*<<< orphan*/, int,
                         int /*<<< orphan*/);
int /*<<< orphan*/ cssa(int, int, unsigned short *, int *);
int /*<<< orphan*/ printf(char *);
void isr(void) {
  int ext, q;
  unsigned short d;
  cdreg(&ext, 0, 0, 1, 0);
  d = 0xFF;
  cssa(16, ext, &d, &q);
  d = 0;
  cssa(16, ext, &d, &q);
  cdlam(&ext, 0, 0, 1, 0, NULL);
  cclc(ext);
  ccrgl(ext);
  printf("ISR\n");
}


x86 assembly (clang, -O0):
<isr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
xor    %r8d,%r8d
mov    $0x1,%ecx
mov    %r8d,%esi
mov    %r8d,%edx
call   1060 <cdreg@plt>
movw   $0xff,-0xa(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x10,%edi
lea    -0xa(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <cssa@plt>
movw   $0x0,-0xa(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x10,%edi
lea    -0xa(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <cssa@plt>
lea    -0x4(%rbp),%rdi
xor    %r8d,%r8d
mov    $0x1,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r8d,%esi
mov    %r8d,%edx
call   1080 <cdlam@plt>
mov    -0x4(%rbp),%edi
call   1050 <cclc@plt>
mov    -0x4(%rbp),%edi
call   1070 <ccrgl@plt>
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isr>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
call   1060 <cdreg@plt>
movw   $0xff,0x6(%rsp)
mov    0x8(%rsp),%esi
lea    0x6(%rsp),%rbx
lea    0xc(%rsp),%r15
mov    $0x10,%edi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1040 <cssa@plt>
movw   $0x0,0x6(%rsp)
mov    0x8(%rsp),%esi
mov    $0x10,%edi
mov    %rbx,%rdx
mov    %r15,%rcx
call   1040 <cssa@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1080 <cdlam@plt>
mov    0x8(%rsp),%edi
call   1050 <cclc@plt>
mov    0x8(%rsp),%edi
call   1070 <ccrgl@plt>
lea    0xe0e(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ISR\0A\00"
define void @isr() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = call i32 @cdreg(i32* %1, i32 0, i32 0, i32 1, i32 0)
store i16 255, i16* %3
%5 = load i32, i32* %1
%6 = call i32 @cssa(i32 16, i32 %5, i16* %3, i32* %2)
store i16 0, i16* %3
%7 = load i32, i32* %1
%8 = call i32 @cssa(i32 16, i32 %7, i16* %3, i32* %2)
%9 = call i32 @cdlam(i32* %1, i32 0, i32 0, i32 1, i32 0, i32* null)
%10 = load i32, i32* %1
%11 = call i32 @cclc(i32 %10)
%12 = load i32, i32* %1
%13 = call i32 @ccrgl(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"ISR\00"
define void @isr() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i16* %3 to i8*
%7 = call i32 @cdreg(i32* %1, i32 0, i32 0, i32 1, i32 0)
store i16 255, i16* %3
%8 = load i32, i32* %1
%9 = call i32 @cssa(i32 16, i32 %8, i16* %3, i32* %2)
store i16 0, i16* %3
%10 = load i32, i32* %1
%11 = call i32 @cssa(i32 16, i32 %10, i16* %3, i32* %2)
%12 = call i32 @cdlam(i32* %1, i32 0, i32 0, i32 1, i32 0, i32* null)
%13 = load i32, i32* %1
%14 = call i32 @cclc(i32 %13)
%15 = load i32, i32* %1
%16 = call i32 @ccrgl(i32 %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}