#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__ strcmp(char *, char *);
*Traducir(char *palabra, char *diccio) {
  int cont;
  for (cont = 0; cont < 100 * 40; cont += 40)
    if (strcmp(palabra, (diccio + cont)) == 0)
      return (diccio + 100 * 40 + cont);
  return NULL;
}


x86 assembly (clang, -O0):
<Traducir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xfa0,-0x1c(%rbp)
jge    117f <Traducir+0x6f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
add    %rax,%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    116c <Traducir+0x5c>
mov    -0x18(%rbp),%rax
add    $0xfa0,%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <Traducir+0x77>
jmp    1171 <Traducir+0x61>
mov    -0x1c(%rbp),%eax
add    $0x28,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <Traducir+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Traducir>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0xffffffffffffffd8,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1156 <Traducir+0x46>
add    $0x28,%r15
add    $0x28,%rbx
cmp    $0xf78,%rbx
jb     1130 <Traducir+0x20>
xor    %r15d,%r15d
jmp    115d <Traducir+0x4d>
add    $0xfa0,%r15
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @Traducir(i8* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %26, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 4000
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = call i64 @strcmp(i8* %11, i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %10
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 4000
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = bitcast i8* %23 to i32*
store i32* %24, i32** %3
br label %30
25: ; preds = %10
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 40
store i32 %28, i32* %6
br label %7
29: ; preds = %7
store i32* null, i32** %3
br label %30
30: ; preds = %29, %18
%31 = load i32*, i32** %3
ret i32* %31
}

LLVM IR (-O2):
define i32* @Traducir(i8* %0, i8* %1) {
br label %3
3: ; preds = %2, %13
%4 = phi i64 [ 0, %2 ], [ %14, %13 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = tail call i64 @strcmp(i8* %0, i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = and i64 %4, 4294967288
%10 = getelementptr inbounds i8, i8* %1, i64 4000
%11 = getelementptr inbounds i8, i8* %10, i64 %9
%12 = bitcast i8* %11 to i32*
br label %16
13: ; preds = %3
%14 = add nuw nsw i64 %4, 40
%15 = icmp ult i64 %4, 3960
br i1 %15, label %3, label %16
16: ; preds = %13, %8
%17 = phi i32* [ %12, %8 ], [ null, %13 ]
ret i32* %17
}