#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int buscaIdIndividuo(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int removeRegIndividuo(FILE *arquivo, int id) {
  int offset = buscaIdIndividuo(arquivo, id);
  char sif[2];
  sif[1] = '\0';
  sif[0] = '$';
  if (offset == -1) {
    return 0;
  } else {
    fseek(arquivo, offset, SEEK_SET);
    fputs(sif, arquivo);
    return 1;
  }
}


x86 assembly (clang, -O0):
<removeRegIndividuo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <buscaIdIndividuo@plt>
mov    %eax,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
movb   $0x24,-0x1a(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    116c <removeRegIndividuo+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1195 <removeRegIndividuo+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    0x2e66(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeRegIndividuo>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <buscaIdIndividuo@plt>
movw   $0x24,0xe(%rsp)
cmp    $0xffffffff,%eax
je     1170 <removeRegIndividuo+0x40>
mov    0x2e90(%rip),%rcx
mov    (%rcx),%edx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <fseek@plt>
lea    0xe(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    $0x1,%eax
jmp    1172 <removeRegIndividuo+0x42>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @removeRegIndividuo(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i8]
store i32* %0, i32** %4
store i32 %1, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = call i32 @buscaIdIndividuo(i32* %8, i32 %9)
store i32 %10, i32* %6
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 0, i8* %11
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 36, i8* %12
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %24
16: ; preds = %2
%17 = load i32*, i32** %4
%18 = load i32, i32* %6
%19 = load i32, i32* @SEEK_SET
%20 = call i32 @fseek(i32* %17, i32 %18, i32 %19)
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%22 = load i32*, i32** %4
%23 = call i32 @fputs(i8* %21, i32* %22)
store i32 1, i32* %3
br label %24
24: ; preds = %16, %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @removeRegIndividuo(i32* %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = tail call i32 @buscaIdIndividuo(i32* %0, i32 %1)
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
store i8 36, i8* %5
%7 = icmp eq i32 %4, -1
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @SEEK_SET
%10 = tail call i32 @fseek(i32* %0, i32 %4, i32 %9)
%11 = call i32 @fputs(i8* %5, i32* %0)
br label %12
12: ; preds = %2, %8
%13 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %13
}