const char *x86_fpreg_str(unsigned i) {
  static const char *nams[] = {"xmm0", "xmm1", "xmm2", "xmm3",
                               "xmm4", "xmm5", "xmm6", "xmm7"};
  do
    if (!(i < (sizeof(nams) / sizeof((nams)[0]))))
      ice("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/src/"
          "cc1/out/x86_64.c",
          170, __func__, "bad fp reg index %d", i);
  while (0);
  return nams[i];
}


x86 assembly (clang, -O0):
<x86_fpreg_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x8,%rax
jb     114d <x86_fpreg_str+0x3d>
mov    -0x4(%rbp),%r8d
lea    0xef5(%rip),%rdi
mov    $0xaa,%esi
lea    0xf7c(%rip),%rdx
lea    0xf83(%rip),%rcx
mov    $0x0,%al
call   1030 <ice@plt>
jmp    1152 <x86_fpreg_str+0x42>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0x2ed2(%rip),%rax
mov    (%rax,%rcx,8),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_fpreg_str>:
push   %rbx
mov    %edi,%ebx
cmp    $0x8,%edi
jb     113c <x86_fpreg_str+0x2c>
lea    0xf29(%rip),%rdi
lea    0xfb5(%rip),%rdx
lea    0xfbc(%rip),%rcx
mov    $0xaa,%esi
mov    %ebx,%r8d
xor    %eax,%eax
call   1030 <ice@plt>
mov    %ebx,%eax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@x86_fpreg_str.nams = internal global [8 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0)]
@.str = [5 x i8] c"xmm0\00"
@.str.1 = [5 x i8] c"xmm1\00"
@.str.2 = [5 x i8] c"xmm2\00"
@.str.3 = [5 x i8] c"xmm3\00"
@.str.4 = [5 x i8] c"xmm4\00"
@.str.5 = [5 x i8] c"xmm5\00"
@.str.6 = [5 x i8] c"xmm6\00"
@.str.7 = [5 x i8] c"xmm7\00"
@.str.8 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/src/cc1/out/x86_64.c\00"
@__func__.x86_fpreg_str = [14 x i8] c"x86_fpreg_str\00"
@.str.9 = [20 x i8] c"bad fp reg index %d\00"
define i8* @x86_fpreg_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = icmp ult i64 %5, 8
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @ice to i32 (i8*, i32, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.8, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.x86_fpreg_str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %3
br label %11
11: ; preds = %10
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds [8 x i8*], [8 x i8*]* @x86_fpreg_str.nams, i64 0, i64 %13
%15 = load i8*, i8** %14
ret i8* %15
}

LLVM IR (-O2):
@reltable.x86_fpreg_str = internal unnamed_addr constant [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.x86_fpreg_str to i64)) to i32)]
@.str = [5 x i8] c"xmm0\00"
@.str.1 = [5 x i8] c"xmm1\00"
@.str.2 = [5 x i8] c"xmm2\00"
@.str.3 = [5 x i8] c"xmm3\00"
@.str.4 = [5 x i8] c"xmm4\00"
@.str.5 = [5 x i8] c"xmm5\00"
@.str.6 = [5 x i8] c"xmm6\00"
@.str.7 = [5 x i8] c"xmm7\00"
@.str.8 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/src/cc1/out/x86_64.c\00"
@__func__.x86_fpreg_str = [14 x i8] c"x86_fpreg_str\00"
@.str.9 = [20 x i8] c"bad fp reg index %d\00"
define i8* @x86_fpreg_str(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @ice to i32 (i8*, i32, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.8, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.x86_fpreg_str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = zext i32 %0 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.x86_fpreg_str to i8*), i64 %7)
ret i8* %8
}