#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*/ fprintf(int /*<<< orphan*/, char *, char *, int, int, char,
                           char);
int /*<<< orphan*/ stderr;
int recode(unsigned char *seq, int n, int *qascii, int nsqx) {
  int i, j;
  char save_c;
  for (i = 0; i < n; i++) {
    save_c = seq[i];
    if (seq[i] > '@' || seq[i] == '*')
      seq[i] = qascii[seq[i]];
    if (seq[i] > nsqx && seq[i] != 59) {
      fprintf(stderr,
              "*** Warning [%s:%d] - unrecognized residue at %d:%c - %2d\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/"
              "server/wsgi/bmrbapi/submodules/fasta36/src/initfa.c",
              1471, i, save_c, save_c);
      seq[i] = qascii['X'];
    }
  }
  seq[i] = 0;
  return i;
}


x86 assembly (clang, -O0):
<recode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1218 <recode+0x108>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x25(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jg     1171 <recode+0x61>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1191 <recode+0x81>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
mov    (%rax,%rcx,4),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    -0x1c(%rbp),%eax
jle    1205 <recode+0xf5>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x3b,%eax
je     1205 <recode+0xf5>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%r8d
mov    -0x25(%rbp),%al
lea    0xe2e(%rip),%rsi
lea    0xe62(%rip),%rdx
mov    $0x5bf,%ecx
movsbl %al,%r9d
movsbl -0x25(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    0x160(%rax),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    120a <recode+0xfa>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <recode+0x1d>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
test   %esi,%esi
jle    11ba <recode+0xaa>
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %esi,0x14(%rsp)
mov    %esi,%r13d
xor    %ebp,%ebp
lea    0xefc(%rip),%r14
jmp    1159 <recode+0x49>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r13
je     11b4 <recode+0xa4>
movzbl (%rbx,%rbp,1),%eax
cmp    $0x40,%rax
ja     1169 <recode+0x59>
mov    %eax,%ecx
cmp    $0x2a,%al
jne    1171 <recode+0x61>
movzbl (%r12,%rax,4),%ecx
mov    %cl,(%rbx,%rbp,1)
cmp    $0x3b,%cl
je     1150 <recode+0x40>
movzbl %cl,%ecx
cmp    %r15d,%ecx
jle    1150 <recode+0x40>
mov    0x2e5b(%rip),%rcx
mov    (%rcx),%edi
movsbl %al,%r9d
mov    %r9d,(%rsp)
lea    0xe6a(%rip),%rsi
mov    %r14,%rdx
mov    $0x5bf,%ecx
mov    %ebp,%r8d
call   1030 <fprintf@plt>
movzbl 0x160(%r12),%eax
mov    %al,(%rbx,%rbp,1)
jmp    1150 <recode+0x40>
mov    0x14(%rsp),%eax
jmp    11bc <recode+0xac>
xor    %eax,%eax
mov    %eax,%ecx
movb   $0x0,(%rbx,%rcx,1)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"*** Warning [%s:%d] - unrecognized residue at %d:%c - %2d\0A\00"
@.str.1 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/server/wsgi/bmrbapi/submodules/fasta36/src/initfa.c\00"
define i32 @recode(i8* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %12
12: ; preds = %84, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %87
16: ; preds = %12
%17 = load i8*, i8** %5
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
store i8 %21, i8* %11
%22 = load i8*, i8** %5
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = icmp sgt i32 %27, 64
br i1 %28, label %37, label %29
29: ; preds = %16
%30 = load i8*, i8** %5
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = icmp eq i32 %35, 42
br i1 %36, label %37, label %52
37: ; preds = %29, %16
%38 = load i32*, i32** %7
%39 = load i8*, i8** %5
%40 = load i32, i32* %9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = zext i8 %43 to i64
%45 = getelementptr inbounds i32, i32* %38, i64 %44
%46 = load i32, i32* %45
%47 = trunc i32 %46 to i8
%48 = load i8*, i8** %5
%49 = load i32, i32* %9
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %48, i64 %50
store i8 %47, i8* %51
br label %52
52: ; preds = %37, %29
%53 = load i8*, i8** %5
%54 = load i32, i32* %9
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %53, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = load i32, i32* %8
%60 = icmp sgt i32 %58, %59
br i1 %60, label %61, label %83
61: ; preds = %52
%62 = load i8*, i8** %5
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = icmp ne i32 %67, 59
br i1 %68, label %69, label %83
69: ; preds = %61
%70 = load i32, i32* @stderr
%71 = load i32, i32* %9
%72 = load i8, i8* %11
%73 = load i8, i8* %11
%74 = call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.1, i64 0, i64 0), i32 1471, i32 %71, i8 signext %72, i8 signext %73)
%75 = load i32*, i32** %7
%76 = getelementptr inbounds i32, i32* %75, i64 88
%77 = load i32, i32* %76
%78 = trunc i32 %77 to i8
%79 = load i8*, i8** %5
%80 = load i32, i32* %9
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %79, i64 %81
store i8 %78, i8* %82
br label %83
83: ; preds = %69, %61, %52
br label %84
84: ; preds = %83
%85 = load i32, i32* %9
%86 = add nsw i32 %85, 1
store i32 %86, i32* %9
br label %12
87: ; preds = %12
%88 = load i8*, i8** %5
%89 = load i32, i32* %9
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %88, i64 %90
store i8 0, i8* %91
%92 = load i32, i32* %9
ret i32 %92
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"*** Warning [%s:%d] - unrecognized residue at %d:%c - %2d\0A\00"
@.str.1 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/server/wsgi/bmrbapi/submodules/fasta36/src/initfa.c\00"
define i32 @recode(i8* nocapture %0, i32 %1, i32* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %36
6: ; preds = %4
%7 = getelementptr inbounds i32, i32* %2, i64 88
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %6, %33
%10 = phi i64 [ 0, %6 ], [ %34, %33 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp ugt i8 %12, 64
%14 = icmp eq i8 %12, 42
%15 = or i1 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %9
%17 = zext i8 %12 to i64
%18 = getelementptr inbounds i32, i32* %2, i64 %17
%19 = load i32, i32* %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %11
br label %21
21: ; preds = %9, %16
%22 = phi i8 [ %12, %9 ], [ %20, %16 ]
%23 = zext i8 %22 to i32
%24 = icmp sle i32 %23, %3
%25 = icmp eq i8 %22, 59
%26 = or i1 %25, %24
br i1 %26, label %33, label %27
27: ; preds = %21
%28 = load i32, i32* @stderr
%29 = trunc i64 %10 to i32
%30 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.1, i64 0, i64 0), i32 1471, i32 %29, i8 signext %12, i8 signext %12)
%31 = load i32, i32* %7
%32 = trunc i32 %31 to i8
store i8 %32, i8* %11
br label %33
33: ; preds = %21, %27
%34 = add nuw nsw i64 %10, 1
%35 = icmp eq i64 %34, %8
br i1 %35, label %36, label %9
36: ; preds = %33, %4
%37 = phi i32 [ 0, %4 ], [ %1, %33 ]
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %0, i64 %38
store i8 0, i8* %39
ret i32 %37
}