#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__ byte_diff(char const *, int, char *);
int /*<<< orphan*/ ip(char const *);
int /*<<< orphan*/ line();
int /*<<< orphan*/ logtype(char const *);
int /*<<< orphan*/ name(char const *);
int /*<<< orphan*/ number(unsigned int);
int /*<<< orphan*/ space();
int /*<<< orphan*/ string(char *);
void log_tx(const char *q, const char qtype[2], const char *control,
            const char servers[64], unsigned int gluelessness) {
  int i = 0;
  string(" + tx ");
  number(gluelessness);
  space();
  logtype(qtype);
  space();
  name(q);
  space();
  name(control);
  for (i = 0; i < 64; i += 4) {
    if (byte_diff(servers + i, 4, "\0\0\0\0")) {
      space();
      ip(servers + i);
    }
  }
  line();
}


x86 assembly (clang, -O0):
<log_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xe56(%rip),%rdi
call   1040 <string@plt>
mov    -0x24(%rbp),%edi
call   1080 <number@plt>
mov    $0x0,%al
call   1030 <space@plt>
mov    -0x10(%rbp),%rdi
call   1070 <logtype@plt>
mov    $0x0,%al
call   1030 <space@plt>
mov    -0x8(%rbp),%rdi
call   1050 <name@plt>
mov    $0x0,%al
call   1030 <space@plt>
mov    -0x18(%rbp),%rdi
call   1050 <name@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x40,-0x28(%rbp)
jge    1248 <log_tx+0xc8>
mov    -0x20(%rbp),%rdi
movslq -0x28(%rbp),%rax
add    %rax,%rdi
mov    $0x4,%esi
lea    0xdf8(%rip),%rdx
call   1060 <byte_diff@plt>
cmp    $0x0,%rax
je     1235 <log_tx+0xb5>
mov    $0x0,%al
call   1030 <space@plt>
mov    -0x20(%rbp),%rdi
movslq -0x28(%rbp),%rax
add    %rax,%rdi
call   10a0 <ip@plt>
jmp    123a <log_tx+0xba>
mov    -0x28(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x28(%rbp)
jmp    11ee <log_tx+0x6e>
mov    $0x0,%al
call   1090 <line@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_tx>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8d,%ebx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r13
lea    0xe61(%rip),%rdi
call   1040 <string@plt>
mov    %ebx,%edi
call   1080 <number@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    %r12,%rdi
call   1070 <logtype@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    %r13,%rdi
call   1050 <name@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    %r14,%rdi
call   1050 <name@plt>
mov    $0xfffffffffffffffc,%rbx
lea    0xe21(%rip),%r14
jmp    11fa <log_tx+0x7a>
nopl   0x0(%rax,%rax,1)
add    $0x4,%rbx
cmp    $0x3c,%rbx
jae    1228 <log_tx+0xa8>
lea    (%r15,%rbx,1),%r12
add    $0x4,%r12
mov    %r12,%rdi
mov    $0x4,%esi
mov    %r14,%rdx
call   1060 <byte_diff@plt>
test   %rax,%rax
je     11f0 <log_tx+0x70>
xor    %eax,%eax
call   1030 <space@plt>
mov    %r12,%rdi
call   10a0 <ip@plt>
jmp    11f0 <log_tx+0x70>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1090 <line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c" + tx \00"
@.str.1 = [5 x i8] zeroinitializer
define void @log_tx(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
store i32 0, i32* %11
%12 = call i32 @string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %10
%14 = call i32 @number(i32 %13)
%15 = call i32 (...) @space()
%16 = load i8*, i8** %7
%17 = call i32 @logtype(i8* %16)
%18 = call i32 (...) @space()
%19 = load i8*, i8** %6
%20 = call i32 @name(i8* %19)
%21 = call i32 (...) @space()
%22 = load i8*, i8** %8
%23 = call i32 @name(i8* %22)
store i32 0, i32* %11
br label %24
24: ; preds = %42, %5
%25 = load i32, i32* %11
%26 = icmp slt i32 %25, 64
br i1 %26, label %27, label %45
27: ; preds = %24
%28 = load i8*, i8** %9
%29 = load i32, i32* %11
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = call i64 @byte_diff(i8* %31, i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %27
%35 = call i32 (...) @space()
%36 = load i8*, i8** %9
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = call i32 @ip(i8* %39)
br label %41
41: ; preds = %34, %27
br label %42
42: ; preds = %41
%43 = load i32, i32* %11
%44 = add nsw i32 %43, 4
store i32 %44, i32* %11
br label %24
45: ; preds = %24
%46 = call i32 (...) @line()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" + tx \00"
@.str.1 = [5 x i8] zeroinitializer
define void @log_tx(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i32 @string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @number(i32 %4)
%8 = tail call i32 (...) @space()
%9 = tail call i32 @logtype(i8* %1)
%10 = tail call i32 (...) @space()
%11 = tail call i32 @name(i8* %0)
%12 = tail call i32 (...) @space()
%13 = tail call i32 @name(i8* %2)
br label %14
14: ; preds = %5, %22
%15 = phi i64 [ 0, %5 ], [ %23, %22 ]
%16 = getelementptr inbounds i8, i8* %3, i64 %15
%17 = tail call i64 @byte_diff(i8* %16, i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %14
%20 = tail call i32 (...) @space()
%21 = tail call i32 @ip(i8* %16)
br label %22
22: ; preds = %14, %19
%23 = add nuw nsw i64 %15, 4
%24 = icmp ult i64 %15, 60
br i1 %24, label %14, label %25
25: ; preds = %22
%26 = tail call i32 (...) @line()
ret void
}