#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ isxdigit(char);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
int strlen(char *);
int is_backslash_hex(char *input, int *pcode) {
  if (strlen(input) < 4)
    return 0;
  if (input[0] != '\\')
    return 0;
  if (input[1] != 'x')
    return 0;
  if (!isxdigit(input[2]))
    return 0;
  if (!isxdigit(input[3]))
    return 0;
  char buf[3];
  buf[0] = input[2];
  buf[1] = input[3];
  buf[2] = 0;
  if (sscanf(buf, "%x", pcode) != 1) {
    fprintf(stderr,
            "Miller: internal coding error detected in file %s at line %d.\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/0-wiz-0/miller/refs/heads/master/c/lib/"
            "mlrutil.c",
            320);
    exit(1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_backslash_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jge    117e <is_backslash_hex+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1262 <is_backslash_hex+0x112>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     119a <is_backslash_hex+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1262 <is_backslash_hex+0x112>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
je     11b7 <is_backslash_hex+0x67>
movl   $0x0,-0x4(%rbp)
jmp    1262 <is_backslash_hex+0x112>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1070 <isxdigit@plt>
cmp    $0x0,%eax
jne    11d9 <is_backslash_hex+0x89>
movl   $0x0,-0x4(%rbp)
jmp    1262 <is_backslash_hex+0x112>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%edi
call   1070 <isxdigit@plt>
cmp    $0x0,%eax
jne    11fb <is_backslash_hex+0xab>
movl   $0x0,-0x4(%rbp)
jmp    1262 <is_backslash_hex+0x112>
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0x1b(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x1a(%rbp)
movb   $0x0,-0x19(%rbp)
lea    -0x1b(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xdde(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     125b <is_backslash_hex+0x10b>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
lea    0xdc3(%rip),%rsi
lea    0xdfb(%rip),%rdx
mov    $0x140,%ecx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_backslash_hex>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x4,%eax
jl     11c0 <is_backslash_hex+0x70>
cmpb   $0x5c,(%rbx)
jne    11c0 <is_backslash_hex+0x70>
cmpb   $0x78,0x1(%rbx)
jne    11c0 <is_backslash_hex+0x70>
movsbl 0x2(%rbx),%edi
call   1070 <isxdigit@plt>
test   %eax,%eax
je     11c0 <is_backslash_hex+0x70>
movsbl 0x3(%rbx),%edi
call   1070 <isxdigit@plt>
test   %eax,%eax
je     11c0 <is_backslash_hex+0x70>
mov    0x2(%rbx),%al
mov    %al,0xd(%rsp)
mov    0x3(%rbx),%al
mov    %al,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xe57(%rip),%rsi
lea    0xd(%rsp),%rdi
mov    %r14,%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    11cb <is_backslash_hex+0x7b>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
lea    0xe28(%rip),%rsi
lea    0xe60(%rip),%rdx
mov    $0x140,%ecx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
@stderr = global i32 0
@.str.1 = [63 x i8] c"Miller: internal coding error detected in file %s at line %d.\0A\00"
@.str.2 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0-wiz-0/miller/refs/heads/master/c/lib/mlrutil.c\00"
define i32 @is_backslash_hex(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca [3 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %58
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 92
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 0, i32* %3
br label %58
18: ; preds = %11
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 120
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %3
br label %58
25: ; preds = %18
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = load i8, i8* %27
%29 = call i32 @isxdigit(i8 signext %28)
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %25
store i32 0, i32* %3
br label %58
32: ; preds = %25
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i64 3
%35 = load i8, i8* %34
%36 = call i32 @isxdigit(i8 signext %35)
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %32
store i32 0, i32* %3
br label %58
39: ; preds = %32
%40 = load i8*, i8** %4
%41 = getelementptr inbounds i8, i8* %40, i64 2
%42 = load i8, i8* %41
%43 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
store i8 %42, i8* %43
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i64 3
%46 = load i8, i8* %45
%47 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 1
store i8 %46, i8* %47
%48 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 2
store i8 0, i8* %48
%49 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%50 = load i32*, i32** %5
%51 = call i32 @sscanf(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %50)
%52 = icmp ne i32 %51, 1
br i1 %52, label %53, label %57
53: ; preds = %39
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 320)
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %39
store i32 1, i32* %3
br label %58
58: ; preds = %57, %38, %31, %24, %17, %10
%59 = load i32, i32* %3
ret i32 %59
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
@stderr = global i32 0
@.str.1 = [63 x i8] c"Miller: internal coding error detected in file %s at line %d.\0A\00"
@.str.2 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0-wiz-0/miller/refs/heads/master/c/lib/mlrutil.c\00"
define i32 @is_backslash_hex(i8* %0, i32* %1) {
%3 = alloca [3 x i8]
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, 4
br i1 %5, label %36, label %6
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 92
br i1 %8, label %9, label %36
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 120
br i1 %12, label %13, label %36
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %0, i64 2
%15 = load i8, i8* %14
%16 = tail call i32 @isxdigit(i8 signext %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %36, label %18
18: ; preds = %13
%19 = getelementptr inbounds i8, i8* %0, i64 3
%20 = load i8, i8* %19
%21 = tail call i32 @isxdigit(i8 signext %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %36, label %23
23: ; preds = %18
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%25 = load i8, i8* %14
store i8 %25, i8* %24
%26 = load i8, i8* %19
%27 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %26, i8* %27
%28 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %28
%29 = call i32 @sscanf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%30 = icmp eq i32 %29, 1
br i1 %30, label %35, label %31
31: ; preds = %23
%32 = load i32, i32* @stderr
%33 = tail call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 320)
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %23
br label %36
36: ; preds = %18, %13, %9, %6, %2, %35
%37 = phi i32 [ 1, %35 ], [ 0, %2 ], [ 0, %6 ], [ 0, %9 ], [ 0, %13 ], [ 0, %18 ]
ret i32 %37
}