#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_CUR;
unsigned char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void ignorer_commentaires(FILE *f) {
  unsigned char c;
  while ((c = fgetc(f)) == '#')
    while ((c = fgetc(f)) != '\n')
      ;
  fseek(f, -sizeof(unsigned char), SEEK_CUR);
}


x86 assembly (clang, -O0):
<ignorer_commentaires>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movzbl %al,%eax
cmp    $0x23,%eax
jne    116b <ignorer_commentaires+0x4b>
jmp    1149 <ignorer_commentaires+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movzbl %al,%eax
cmp    $0xa,%eax
je     1166 <ignorer_commentaires+0x46>
jmp    1149 <ignorer_commentaires+0x29>
jmp    112c <ignorer_commentaires+0xc>
mov    -0x8(%rbp),%rdi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1040 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignorer_commentaires>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <fgetc@plt>
cmp    $0x23,%al
jne    114a <ignorer_commentaires+0x2a>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1139 <ignorer_commentaires+0x19>
mov    %rbx,%rdi
jmp    1130 <ignorer_commentaires+0x10>
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1040 <fseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define void @ignorer_commentaires(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = load i32*, i32** %2
%6 = call zeroext i8 @fgetc(i32* %5)
store i8 %6, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 35
br i1 %8, label %9, label %17
9: ; preds = %4
br label %10
10: ; preds = %15, %9
%11 = load i32*, i32** %2
%12 = call zeroext i8 @fgetc(i32* %11)
store i8 %12, i8* %3
%13 = zext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %10
br label %10
16: ; preds = %10
br label %4
17: ; preds = %4
%18 = load i32*, i32** %2
%19 = load i32, i32* @SEEK_CUR
%20 = call i32 @fseek(i32* %18, i32 -1, i32 %19)
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define void @ignorer_commentaires(i32* nocapture %0) {
%2 = tail call zeroext i8 @fgetc(i32* %0)
%3 = icmp eq i8 %2, 35
br i1 %3, label %7, label %11
4: ; preds = %7
%5 = tail call zeroext i8 @fgetc(i32* %0)
%6 = icmp eq i8 %5, 35
br i1 %6, label %10, label %11
7: ; preds = %1, %10
%8 = tail call zeroext i8 @fgetc(i32* %0)
%9 = icmp eq i8 %8, 10
br i1 %9, label %4, label %10
10: ; preds = %7, %4
br label %7
11: ; preds = %4, %1
%12 = load i32, i32* @SEEK_CUR
%13 = tail call i32 @fseek(i32* %0, i32 -1, i32 %12)
ret void
}