#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 */
scalar_t__ CSSValueIsLength(char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
int CSSValueIsBorderWidth(const char *str) {
  if (str == NULL)
    return 0;
  return (!strcmp(str, "thin") || !strcmp(str, "medium") ||
          !strcmp(str, "thick") || CSSValueIsLength(str));
}


x86 assembly (clang, -O0):
<CSSValueIsBorderWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <CSSValueIsBorderWidth+0x23>
movl   $0x0,-0x4(%rbp)
jmp    11c1 <CSSValueIsBorderWidth+0xa1>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     11b6 <CSSValueIsBorderWidth+0x96>
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     11b6 <CSSValueIsBorderWidth+0x96>
mov    -0x10(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     11b6 <CSSValueIsBorderWidth+0x96>
mov    -0x10(%rbp),%rdi
call   1030 <CSSValueIsLength@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSSValueIsBorderWidth>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1179 <CSSValueIsBorderWidth+0x59>
mov    %rdi,%rbx
lea    0xece(%rip),%rsi
call   1040 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     117b <CSSValueIsBorderWidth+0x5b>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     117b <CSSValueIsBorderWidth+0x5b>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     117b <CSSValueIsBorderWidth+0x5b>
mov    %rbx,%rdi
call   1030 <CSSValueIsLength@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
jmp    117b <CSSValueIsBorderWidth+0x5b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"thin\00"
@.str.1 = [7 x i8] c"medium\00"
@.str.2 = [6 x i8] c"thick\00"
define i32 @CSSValueIsBorderWidth(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %26
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = call i64 @CSSValueIsLength(i8* %20)
%22 = icmp ne i64 %21, 0
br label %23
23: ; preds = %19, %15, %11, %7
%24 = phi i1 [ true, %15 ], [ true, %11 ], [ true, %7 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %2
br label %26
26: ; preds = %23, %6
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"thin\00"
@.str.1 = [7 x i8] c"medium\00"
@.str.2 = [6 x i8] c"thick\00"
define i32 @CSSValueIsBorderWidth(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = tail call i64 @CSSValueIsLength(i8* %0)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %3, %6, %9, %12, %1
%17 = phi i32 [ 0, %1 ], [ 1, %9 ], [ 1, %6 ], [ 1, %3 ], [ %15, %12 ]
ret i32 %17
}