#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*/ printf(char *, int, char *);
scalar_t__ strstr(char *, char *);
void find_track(char search_for[], char track_list[][80]) {
  int i;
  for (i = 0; i < 5; i++) {
    if (strstr(track_list[i], search_for)) {
      printf("\nTrack %i: '%s'\n", i, track_list[i]);
    }
  }
}


x86 assembly (clang, -O0):
<find_track>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1194 <find_track+0x74>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
imul   $0x50,%rax,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1181 <find_track+0x61>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rax
imul   $0x50,%rax,%rax
add    %rax,%rdx
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <find_track+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <find_track+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_track>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     114c <find_track+0x2c>
lea    0xebe(%rip),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
lea    0x50(%rbx),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1174 <find_track+0x54>
lea    0xe99(%rip),%rdi
mov    $0x1,%esi
mov    %r15,%rdx
call   1030 <printf@plt>
lea    0xa0(%rbx),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     119f <find_track+0x7f>
lea    0xe6e(%rip),%rdi
mov    $0x2,%esi
mov    %r15,%rdx
call   1030 <printf@plt>
lea    0xf0(%rbx),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     11ca <find_track+0xaa>
lea    0xe43(%rip),%rdi
mov    $0x3,%esi
mov    %r15,%rdx
call   1030 <printf@plt>
add    $0x140,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     11fa <find_track+0xda>
lea    0xe18(%rip),%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0ATrack %i: '%s'\0A\00"
define void @find_track(i8* %0, [80 x i8]* %1) {
%3 = alloca i8*
%4 = alloca [80 x i8]*
%5 = alloca i32
store i8* %0, i8** %3
store [80 x i8]* %1, [80 x i8]** %4
store i32 0, i32* %5
br label %6
6: ; preds = %27, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load [80 x i8]*, [80 x i8]** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 %12
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%15 = load i8*, i8** %3
%16 = call i64 @strstr(i8* %14, i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %9
%19 = load i32, i32* %5
%20 = load [80 x i8]*, [80 x i8]** %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %20, i64 %22
%24 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %19, i8* %24)
br label %26
26: ; preds = %18, %9
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0ATrack %i: '%s'\0A\00"
define void @find_track(i8* %0, [80 x i8]* %1) {
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = tail call i64 @strstr(i8* %3, i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 0, i8* %3)
br label %8
8: ; preds = %2, %6
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 1, i64 0
%10 = tail call i64 @strstr(i8* %9, i8* %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i8* %9)
br label %14
14: ; preds = %12, %8
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 2, i64 0
%16 = tail call i64 @strstr(i8* %15, i8* %0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 2, i8* %15)
br label %20
20: ; preds = %18, %14
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 3, i64 0
%22 = tail call i64 @strstr(i8* %21, i8* %0)
%23 = icmp eq i64 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %20
%25 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 3, i8* %21)
br label %26
26: ; preds = %24, %20
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 4, i64 0
%28 = tail call i64 @strstr(i8* %27, i8* %0)
%29 = icmp eq i64 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 4, i8* %27)
br label %32
32: ; preds = %30, %26
ret void
}