#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*/ cgdefb(char);
int /*<<< orphan*/ cgdefc(char);
int /*<<< orphan*/ gendata();
scalar_t__ isalnum(char);
void gendefs(char *s, int len) {
  int i;
  gendata();
  for (i = 1; i < len - 1; i++) {
    if (isalnum(s[i]))
      cgdefc(s[i]);
    else
      cgdefb(s[i]);
  }
}


x86 assembly (clang, -O0):
<gendefs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <gendata@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11c3 <gendefs+0x83>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <isalnum@plt>
cmp    $0x0,%rax
je     119f <gendefs+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1060 <cgdefc@plt>
jmp    11b0 <gendefs+0x70>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <cgdefb@plt>
jmp    11b5 <gendefs+0x75>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115d <gendefs+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gendefs>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
xor    %eax,%eax
call   1040 <gendata@plt>
cmp    $0x3,%r14d
jl     119c <gendefs+0x5c>
add    $0xffffffff,%r14d
mov    $0x1,%ebx
jmp    117e <gendefs+0x3e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <cgdefb@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
je     119c <gendefs+0x5c>
movsbl (%r15,%rbx,1),%edi
call   1050 <isalnum@plt>
movzbl (%r15,%rbx,1),%ecx
movsbl %cl,%edi
test   %rax,%rax
je     1170 <gendefs+0x30>
call   1060 <cgdefc@plt>
jmp    1175 <gendefs+0x35>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @gendefs(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (...) @gendata()
store i32 1, i32* %5
br label %7
7: ; preds = %35, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %38
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i64 @isalnum(i8 signext %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %12
%21 = load i8*, i8** %3
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = call i32 @cgdefc(i8 signext %25)
br label %34
27: ; preds = %12
%28 = load i8*, i8** %3
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = call i32 @cgdefb(i8 signext %32)
br label %34
34: ; preds = %27, %20
br label %35
35: ; preds = %34
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %7
38: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @gendefs(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (...) @gendata()
%4 = icmp sgt i32 %1, 2
br i1 %4, label %5, label %22
5: ; preds = %2
%6 = add nsw i32 %1, -1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %19
%9 = phi i64 [ 1, %5 ], [ %20, %19 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i64 @isalnum(i8 signext %11)
%13 = icmp eq i64 %12, 0
%14 = load i8, i8* %10
br i1 %13, label %17, label %15
15: ; preds = %8
%16 = tail call i32 @cgdefc(i8 signext %14)
br label %19
17: ; preds = %8
%18 = tail call i32 @cgdefb(i8 signext %14)
br label %19
19: ; preds = %15, %17
%20 = add nuw nsw i64 %9, 1
%21 = icmp eq i64 %20, %7
br i1 %21, label %22, label %8
22: ; preds = %19, %2
ret void
}