#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__ strncmp(char const *, char *, int);
int trackerclient_supports_uri(void *_me __attribute__((__unused__)),
                               const char *uri) {
  if (0 == strncmp(uri, "udp://", 6)) {
    return 0;
  } else if (0 == strncmp(uri, "http://", 7)) {
    return 1;
  } else if (0 == strncmp(uri, "dht://", 6)) {
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<trackerclient_supports_uri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114f <trackerclient_supports_uri+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    11be <trackerclient_supports_uri+0xae>
mov    -0x18(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    117e <trackerclient_supports_uri+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    11be <trackerclient_supports_uri+0xae>
mov    -0x18(%rbp),%rdi
lea    0xe86(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11ad <trackerclient_supports_uri+0x9d>
movl   $0x0,-0x4(%rbp)
jmp    11be <trackerclient_supports_uri+0xae>
jmp    11b2 <trackerclient_supports_uri+0xa2>
jmp    11b7 <trackerclient_supports_uri+0xa7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trackerclient_supports_uri>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1165 <trackerclient_supports_uri+0x55>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1160 <trackerclient_supports_uri+0x50>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
jmp    1165 <trackerclient_supports_uri+0x55>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"udp://\00"
@.str.1 = [8 x i8] c"http://\00"
@.str.2 = [7 x i8] c"dht://\00"
define i32 @trackerclient_supports_uri(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%8 = icmp eq i64 0, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %23
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i64 @strncmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%13 = icmp eq i64 0, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %3
br label %23
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = call i64 @strncmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 6)
%18 = icmp eq i64 0, %17
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 0, i32* %3
br label %23
20: ; preds = %15
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
store i32 0, i32* %3
br label %23
23: ; preds = %22, %19, %14, %9
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [7 x i8] c"udp://\00"
@.str.1 = [8 x i8] c"http://\00"
@.str.2 = [7 x i8] c"dht://\00"
define i32 @trackerclient_supports_uri(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 6)
br label %10
10: ; preds = %8, %5, %2
%11 = phi i32 [ 0, %2 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %11
}