#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 */
size_t strlen(unsigned char *);
void fillgoodsymb(int **goodsymb, unsigned char *temp) {
  size_t i;
  for (i = 0; i < 256; ++i) {
    (*goodsymb)[i] = 0;
  }
  for (i = 0; i < strlen(temp); ++i) {
    (*goodsymb)[temp[i]] = 1;
  }
}


x86 assembly (clang, -O0):
<fillgoodsymb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x100,-0x18(%rbp)
jae    1159 <fillgoodsymb+0x49>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <fillgoodsymb+0x18>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jae    11ad <fillgoodsymb+0x9d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
movl   $0x1,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1161 <fillgoodsymb+0x51>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillgoodsymb>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    (%rdi),%r14
mov    $0x400,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movzbl (%r15),%eax
test   %rax,%rax
je     117e <fillgoodsymb+0x5e>
movl   $0x1,(%r14,%rax,4)
mov    %r15,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%rax
jb     117e <fillgoodsymb+0x5e>
mov    $0x1,%ebx
xchg   %ax,%ax
movzbl (%r15,%rbx,1),%eax
movl   $0x1,(%r14,%rax,4)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cmp    %rax,%rbx
jb     1160 <fillgoodsymb+0x40>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fillgoodsymb(i32** %0, i8* %1) {
%3 = alloca i32**
%4 = alloca i8*
%5 = alloca i64
store i32** %0, i32*** %3
store i8* %1, i8** %4
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 256
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32**, i32*** %3
%11 = load i32*, i32** %10
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %9
%15 = load i64, i64* %5
%16 = add i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
store i64 0, i64* %5
br label %18
18: ; preds = %32, %17
%19 = load i64, i64* %5
%20 = load i8*, i8** %4
%21 = call i64 @strlen(i8* %20)
%22 = icmp ult i64 %19, %21
br i1 %22, label %23, label %35
23: ; preds = %18
%24 = load i32**, i32*** %3
%25 = load i32*, i32** %24
%26 = load i8*, i8** %4
%27 = load i64, i64* %5
%28 = getelementptr inbounds i8, i8* %26, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i64
%31 = getelementptr inbounds i32, i32* %25, i64 %30
store i32 1, i32* %31
br label %32
32: ; preds = %23
%33 = load i64, i64* %5
%34 = add i64 %33, 1
store i64 %34, i64* %5
br label %18
35: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @fillgoodsymb(i32** nocapture %0, i8* nocapture %1) {
%3 = load i32*, i32** %0
%4 = bitcast i32* %3 to i8*
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %21, label %7
7: ; preds = %2
%8 = zext i8 %5 to i64
%9 = getelementptr inbounds i32, i32* %3, i64 %8
store i32 1, i32* %9
%10 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%11 = icmp ugt i64 %10, 1
br i1 %11, label %12, label %21
12: ; preds = %7, %12
%13 = phi i64 [ %18, %12 ], [ 1, %7 ]
%14 = getelementptr inbounds i8, i8* %1, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = getelementptr inbounds i32, i32* %3, i64 %16
store i32 1, i32* %17
%18 = add nuw i64 %13, 1
%19 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%20 = icmp ult i64 %18, %19
br i1 %20, label %12, label %21
21: ; preds = %12, %7, %2
ret void
}