#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 */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
void ns_name_rollback(const u_char *src, const u_char **dnptrs,
                      const u_char **lastdnptr) {
  while (dnptrs < lastdnptr && *dnptrs != NULL) {
    if (*dnptrs >= src) {
      *dnptrs = NULL;
      break;
    }
    dnptrs++;
  }
}


x86 assembly (clang, -O0):
<ns_name_rollback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x18(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1131 <ns_name_rollback+0x31>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1141 <ns_name_rollback+0x41>
jmp    1173 <ns_name_rollback+0x73>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
jb     1162 <ns_name_rollback+0x62>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1173 <ns_name_rollback+0x73>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ns_name_rollback+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_name_rollback>:
cmp    %rdx,%rsi
jae    1126 <ns_name_rollback+0x26>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsi),%rax
test   %rax,%rax
je     1126 <ns_name_rollback+0x26>
cmp    %rdi,%rax
jae    1127 <ns_name_rollback+0x27>
add    $0x8,%rsi
cmp    %rdx,%rsi
jb     1110 <ns_name_rollback+0x10>
ret
movq   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @ns_name_rollback(i32* %0, i32** %1, i32** %2) {
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32**
store i32* %0, i32** %4
store i32** %1, i32*** %5
store i32** %2, i32*** %6
br label %7
7: ; preds = %24, %3
%8 = load i32**, i32*** %5
%9 = load i32**, i32*** %6
%10 = icmp ult i32** %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32**, i32*** %5
%13 = load i32*, i32** %12
%14 = icmp ne i32* %13, null
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ false, %7 ], [ %14, %11 ]
br i1 %16, label %17, label %27
17: ; preds = %15
%18 = load i32**, i32*** %5
%19 = load i32*, i32** %18
%20 = load i32*, i32** %4
%21 = icmp uge i32* %19, %20
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = load i32**, i32*** %5
store i32* null, i32** %23
br label %27
24: ; preds = %17
%25 = load i32**, i32*** %5
%26 = getelementptr inbounds i32*, i32** %25, i32 1
store i32** %26, i32*** %5
br label %7
27: ; preds = %22, %15
ret void
}

LLVM IR (-O2):
define void @ns_name_rollback(i32* readnone %0, i32** %1, i32** readnone %2) {
%4 = icmp ult i32** %1, %2
br i1 %4, label %5, label %15
5: ; preds = %3, %12
%6 = phi i32** [ %13, %12 ], [ %1, %3 ]
%7 = load i32*, i32** %6
%8 = icmp eq i32* %7, null
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = icmp ult i32* %7, %0
br i1 %10, label %12, label %11
11: ; preds = %9
store i32* null, i32** %6
br label %15
12: ; preds = %9
%13 = getelementptr inbounds i32*, i32** %6, i64 1
%14 = icmp ult i32** %13, %2
br i1 %14, label %5, label %15
15: ; preds = %5, %12, %3, %11
ret void
}