#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 BUFSIZ;
char *strchr(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int remove_accid(char *s) {
  int c;
  char t[BUFSIZ], *p;
  for (c = 'a'; c <= 'g'; c++) {
    p = strchr(s, c);
    if (p != NULL) {
      strcpy(t, p);
      strcpy(s, t);
      return 1;
    }
  }
  for (c = 'A'; c <= 'G'; c++) {
    p = strchr(s, c);
    if (p != NULL) {
      strcpy(t, p);
      strcpy(s, t);
      return 1;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<remove_accid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x61,-0x14(%rbp)
cmpl   $0x67,-0x14(%rbp)
jg     11c4 <remove_accid+0xa4>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     11b1 <remove_accid+0x91>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x40(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    123e <remove_accid+0x11e>
jmp    11b6 <remove_accid+0x96>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <remove_accid+0x3f>
movl   $0x41,-0x14(%rbp)
cmpl   $0x47,-0x14(%rbp)
jg     1230 <remove_accid+0x110>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     121d <remove_accid+0xfd>
mov    -0x40(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x40(%rbp),%rsi
mov    -0x10(%rbp),%rdi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    123e <remove_accid+0x11e>
jmp    1222 <remove_accid+0x102>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cb <remove_accid+0xab>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_accid>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    $0x61,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x62,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x63,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x64,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x65,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x66,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x67,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x41,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x42,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x43,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x44,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x45,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x46,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    1255 <remove_accid+0x135>
mov    %r14,%rdi
mov    $0x47,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     126b <remove_accid+0x14b>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
define i32 @remove_accid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %3
%9 = load i32, i32* @BUFSIZ
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %5
%12 = alloca i8, i64 %10
store i64 %10, i64* %6
store i32 97, i32* %4
br label %13
13: ; preds = %28, %1
%14 = load i32, i32* %4
%15 = icmp sle i32 %14, 103
br i1 %15, label %16, label %31
16: ; preds = %13
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = call i8* @strchr(i8* %17, i32 %18)
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %27
22: ; preds = %16
%23 = load i8*, i8** %7
%24 = call i32 @strcpy(i8* %12, i8* %23)
%25 = load i8*, i8** %3
%26 = call i32 @strcpy(i8* %25, i8* %12)
store i32 1, i32* %2
store i32 1, i32* %8
br label %51
27: ; preds = %16
br label %28
28: ; preds = %27
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %13
31: ; preds = %13
store i32 65, i32* %4
br label %32
32: ; preds = %47, %31
%33 = load i32, i32* %4
%34 = icmp sle i32 %33, 71
br i1 %34, label %35, label %50
35: ; preds = %32
%36 = load i8*, i8** %3
%37 = load i32, i32* %4
%38 = call i8* @strchr(i8* %36, i32 %37)
store i8* %38, i8** %7
%39 = load i8*, i8** %7
%40 = icmp ne i8* %39, null
br i1 %40, label %41, label %46
41: ; preds = %35
%42 = load i8*, i8** %7
%43 = call i32 @strcpy(i8* %12, i8* %42)
%44 = load i8*, i8** %3
%45 = call i32 @strcpy(i8* %44, i8* %12)
store i32 1, i32* %2
store i32 1, i32* %8
br label %51
46: ; preds = %35
br label %47
47: ; preds = %46
%48 = load i32, i32* %4
%49 = add nsw i32 %48, 1
store i32 %49, i32* %4
br label %32
50: ; preds = %32
store i32 1, i32* %2
store i32 1, i32* %8
br label %51
51: ; preds = %50, %41, %22
%52 = load i8*, i8** %5
%53 = load i32, i32* %2
ret i32 %53
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define i32 @remove_accid(i8* %0) {
%2 = load i32, i32* @BUFSIZ
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 97)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %46
7: ; preds = %1
%8 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 98)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %46
10: ; preds = %7
%11 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 99)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %46
13: ; preds = %10
%14 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 100)
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %46
16: ; preds = %13
%17 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 101)
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %46
19: ; preds = %16
%20 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 102)
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %46
22: ; preds = %19
%23 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 103)
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %46
25: ; preds = %22
%26 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 65)
%27 = icmp eq i8* %26, null
br i1 %27, label %28, label %46
28: ; preds = %25
%29 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 66)
%30 = icmp eq i8* %29, null
br i1 %30, label %31, label %46
31: ; preds = %28
%32 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 67)
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %46
34: ; preds = %31
%35 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 68)
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %46
37: ; preds = %34
%38 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 69)
%39 = icmp eq i8* %38, null
br i1 %39, label %40, label %46
40: ; preds = %37
%41 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 70)
%42 = icmp eq i8* %41, null
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 71)
%45 = icmp eq i8* %44, null
br i1 %45, label %50, label %46
46: ; preds = %25, %28, %31, %34, %37, %40, %43, %1, %7, %10, %13, %16, %19, %22
%47 = phi i8* [ %5, %1 ], [ %8, %7 ], [ %11, %10 ], [ %14, %13 ], [ %17, %16 ], [ %20, %19 ], [ %23, %22 ], [ %26, %25 ], [ %29, %28 ], [ %32, %31 ], [ %35, %34 ], [ %38, %37 ], [ %41, %40 ], [ %44, %43 ]
%48 = call i32 @strcpy(i8* %4, i8* %47)
%49 = call i32 @strcpy(i8* %0, i8* %4)
br label %50
50: ; preds = %46, %43
ret i32 1
}