#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 */
struct nameserver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nameserver_probe_failed(struct nameserver *const);
int /*<<< orphan*/ nameserver_up(struct nameserver *const);
void nameserver_probe_callback(int result, char type, int count, int ttl,
                               void *addresses, void *arg) {
  struct nameserver *const ns = (struct nameserver *)arg;
  (void)type;
  (void)count;
  (void)ttl;
  (void)addresses;
  if (result == 0 || result == 3) {
    nameserver_up(ns);
  } else
    nameserver_probe_failed(ns);
}


x86 assembly (clang, -O0):
<nameserver_probe_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115b <nameserver_probe_callback+0x3b>
cmpl   $0x3,-0x4(%rbp)
jne    1169 <nameserver_probe_callback+0x49>
mov    -0x28(%rbp),%rdi
call   1040 <nameserver_up@plt>
jmp    1172 <nameserver_probe_callback+0x52>
mov    -0x28(%rbp),%rdi
call   1030 <nameserver_probe_failed@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nameserver_probe_callback>:
cmp    $0x3,%edi
je     1129 <nameserver_probe_callback+0x9>
test   %edi,%edi
jne    1131 <nameserver_probe_callback+0x11>
mov    %r9,%rdi
jmp    1040 <nameserver_up@plt>
mov    %r9,%rdi
jmp    1030 <nameserver_probe_failed@plt>

LLVM IR (-O0):
%struct.nameserver = type { i32 }
define void @nameserver_probe_callback(i32 %0, i8 signext %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca %struct.nameserver*
store i32 %0, i32* %7
store i8 %1, i8* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%14 = load i8*, i8** %12
%15 = bitcast i8* %14 to %struct.nameserver*
store %struct.nameserver* %15, %struct.nameserver** %13
%16 = load i8, i8* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i8*, i8** %11
%20 = load i32, i32* %7
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %6
%23 = load i32, i32* %7
%24 = icmp eq i32 %23, 3
br i1 %24, label %25, label %28
25: ; preds = %22, %6
%26 = load %struct.nameserver*, %struct.nameserver** %13
%27 = call i32 @nameserver_up(%struct.nameserver* %26)
br label %31
28: ; preds = %22
%29 = load %struct.nameserver*, %struct.nameserver** %13
%30 = call i32 @nameserver_probe_failed(%struct.nameserver* %29)
br label %31
31: ; preds = %28, %25
ret void
}

LLVM IR (-O2):
%struct.nameserver = type { i32 }
define void @nameserver_probe_callback(i32 %0, i8 signext %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* %5) {
%7 = bitcast i8* %5 to %struct.nameserver*
switch i32 %0, label %10 [
i32 3, label %8
i32 0, label %8
]
8: ; preds = %6, %6
%9 = tail call i32 @nameserver_up(%struct.nameserver* %7)
br label %12
10: ; preds = %6
%11 = tail call i32 @nameserver_probe_failed(%struct.nameserver* %7)
br label %12
12: ; preds = %10, %8
ret void
}