#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*/ exifwarn(char *);
int jpg1byte();
int nxtmkr(void) {
  int b;
  int bad = 0;
  while ((b = jpg1byte()) != 0xff)
    bad++;
  while ((b = jpg1byte()) == 0xff)
    ;
  if (bad)
    exifwarn("skipped spurious bytes in JPEG");
  return (b);
}


x86 assembly (clang, -O0):
<nxtmkr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <jpg1byte@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xff,%eax
je     1152 <nxtmkr+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <nxtmkr+0xf>
jmp    1157 <nxtmkr+0x37>
mov    $0x0,%al
call   1030 <jpg1byte@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xff,%eax
jne    1171 <nxtmkr+0x51>
jmp    1157 <nxtmkr+0x37>
cmpl   $0x0,-0x8(%rbp)
je     1187 <nxtmkr+0x67>
lea    0xe7e(%rip),%rdi
call   1040 <exifwarn@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nxtmkr>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <jpg1byte@plt>
add    $0xffffffff,%ebp
cmp    $0xff,%eax
jne    1130 <nxtmkr+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <jpg1byte@plt>
cmp    $0xff,%eax
je     1150 <nxtmkr+0x30>
mov    %eax,%ebx
test   %ebp,%ebp
je     1170 <nxtmkr+0x50>
lea    0xe95(%rip),%rdi
call   1040 <exifwarn@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"skipped spurious bytes in JPEG\00"
define i32 @nxtmkr() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = call i32 (...) @jpg1byte()
store i32 %4, i32* %1
%5 = icmp ne i32 %4, 255
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
br label %10
10: ; preds = %13, %9
%11 = call i32 (...) @jpg1byte()
store i32 %11, i32* %1
%12 = icmp eq i32 %11, 255
br i1 %12, label %13, label %14
13: ; preds = %10
br label %10
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @exifwarn(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [31 x i8] c"skipped spurious bytes in JPEG\00"
define i32 @nxtmkr() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @jpg1byte()
%4 = icmp eq i32 %3, 255
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1, %6
%7 = tail call i32 (...) @jpg1byte()
%8 = icmp eq i32 %7, 255
br i1 %8, label %6, label %9
9: ; preds = %6
%10 = icmp eq i32 %2, 0
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @exifwarn(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 %7
}