#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void do_usage_if(int b, int line) {
  const static char *eeprog_usage =
      "eeprog "
      "0.7.6"
      ", a 24Cxx EEPROM reader/writer\n"
      "Copyright (c) 2003-2004 by Stefano Barbato - All rights reserved.\n"
      "Usage: eeprog [-fqxdh] [-16|-8] [ -r addr[:count] | -w addr ]  "
      "/dev/i2c-N  i2c-address\n"
      "\n"
      "  Address modes: \n"
      "	-8		Use 8bit address mode for 24c0x...24C16 [default]\n"
      "	-16		Use 16bit address mode for 24c32...24C256\n"
      "  Actions: \n"
      "	-r addr[:count]	Read [count] (1 if omitted) bytes from [addr]\n"
      "			and print them to the standard output\n"
      "	-w addr		Write input (stdin) at address [addr] of the EEPROM\n"
      "	-t n		write timeout in ms (default 10)\n"
      "	-h		Print this help\n"
      "  Options: \n"
      "	-x		Set hex output mode\n"
      "	-d		Dummy mode, display what *would* have been done\n"
      "	-f		Disable warnings and don't ask confirmation\n"
      "	-q		Quiet mode\n"
      "\n"
      "The following environment variables could be set instead of the "
      "command\n"
      "line arguments:\n"
      "	EEPROG_DEV		device name(/dev/i2c-N)\n"
      "	EEPROG_I2C_ADDR		i2c-address\n"
      "\n"
      "	Examples\n"
      "	1- read 64 bytes from the EEPROM at address 0x54 on bus 0 starting\n"
      "	   at address 123 (decimal)\n"
      "		eeprog /dev/i2c-0 0x54 -r 123:64\n"
      "	2- prints the hex codes of the first 32 bytes read from bus 1 \n"
      "	   at address 0x22\n"
      "		eeprog /dev/i2c-1 0x51 -x -r 0x22:0x20\n"
      "	3- write the current timestamp at address 0x200 of the EEPROM on \n"
      "	   bus 0 at address 0x33 \n"
      "		date | eeprog /dev/i2c-0 0x33 -w 0x200\n";
  if (!b)
    return;
  fprintf(stderr, "%s\n[line %d]\n", eeprog_usage, line);
  exit(1);
}


x86 assembly (clang, -O0):
<do_usage_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113e <do_usage_if+0x1e>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2ee2(%rip),%rdx
mov    -0x8(%rbp),%ecx
lea    0x13a0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_usage_if>:
test   %edi,%edi
jne    1125 <do_usage_if+0x5>
ret
push   %rax
mov    %esi,%ecx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0x13c0(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@do_usage_if.eeprog_usage = internal global i8* getelementptr inbounds ([1272 x i8], [1272 x i8]* @.str, i32 0, i32 0)
@.str = [1272 x i8] c"eeprog 0.7.6, a 24Cxx EEPROM reader/writer\0ACopyright (c) 2003-2004 by Stefano Barbato - All rights reserved.\0AUsage: eeprog [-fqxdh] [-16|-8] [ -r addr[:count] | -w addr ] /dev/i2c-N i2c-address\0A\0A Address modes: \0A\09-8\09\09Use 8bit address mode for 24c0x...24C16 [default]\0A\09-16\09\09Use 16bit address mode for 24c32...24C256\0A Actions: \0A\09-r addr[:count]\09Read [count] (1 if omitted) bytes from [addr]\0A\09\09\09and print them to the standard output\0A\09-w addr\09\09Write input (stdin) at address [addr] of the EEPROM\0A\09-t n\09\09write timeout in ms (default 10)\0A\09-h\09\09Print this help\0A Options: \0A\09-x\09\09Set hex output mode\0A\09-d\09\09Dummy mode, display what *would* have been done\0A\09-f\09\09Disable warnings and don't ask confirmation\0A\09-q\09\09Quiet mode\0A\0AThe following environment variables could be set instead of the command\0Aline arguments:\0A\09EEPROG_DEV\09\09device name(/dev/i2c-N)\0A\09EEPROG_I2C_ADDR\09\09i2c-address\0A\0A\09Examples\0A\091- read 64 bytes from the EEPROM at address 0x54 on bus 0 starting\0A\09 at address 123 (decimal)\0A\09\09eeprog /dev/i2c-0 0x54 -r 123:64\0A\092- prints the hex codes of the first 32 bytes read from bus 1 \0A\09 at address 0x22\0A\09\09eeprog /dev/i2c-1 0x51 -x -r 0x22:0x20\0A\093- write the current timestamp at address 0x200 of the EEPROM on \0A\09 bus 0 at address 0x33 \0A\09\09date | eeprog /dev/i2c-0 0x33 -w 0x200\0A\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"%s\0A[line %d]\0A\00"
define void @do_usage_if(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** @do_usage_if.eeprog_usage
%11 = load i32, i32* %4
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [1272 x i8] c"eeprog 0.7.6, a 24Cxx EEPROM reader/writer\0ACopyright (c) 2003-2004 by Stefano Barbato - All rights reserved.\0AUsage: eeprog [-fqxdh] [-16|-8] [ -r addr[:count] | -w addr ] /dev/i2c-N i2c-address\0A\0A Address modes: \0A\09-8\09\09Use 8bit address mode for 24c0x...24C16 [default]\0A\09-16\09\09Use 16bit address mode for 24c32...24C256\0A Actions: \0A\09-r addr[:count]\09Read [count] (1 if omitted) bytes from [addr]\0A\09\09\09and print them to the standard output\0A\09-w addr\09\09Write input (stdin) at address [addr] of the EEPROM\0A\09-t n\09\09write timeout in ms (default 10)\0A\09-h\09\09Print this help\0A Options: \0A\09-x\09\09Set hex output mode\0A\09-d\09\09Dummy mode, display what *would* have been done\0A\09-f\09\09Disable warnings and don't ask confirmation\0A\09-q\09\09Quiet mode\0A\0AThe following environment variables could be set instead of the command\0Aline arguments:\0A\09EEPROG_DEV\09\09device name(/dev/i2c-N)\0A\09EEPROG_I2C_ADDR\09\09i2c-address\0A\0A\09Examples\0A\091- read 64 bytes from the EEPROM at address 0x54 on bus 0 starting\0A\09 at address 123 (decimal)\0A\09\09eeprog /dev/i2c-0 0x54 -r 123:64\0A\092- prints the hex codes of the first 32 bytes read from bus 1 \0A\09 at address 0x22\0A\09\09eeprog /dev/i2c-1 0x51 -x -r 0x22:0x20\0A\093- write the current timestamp at address 0x200 of the EEPROM on \0A\09 bus 0 at address 0x33 \0A\09\09date | eeprog /dev/i2c-0 0x33 -w 0x200\0A\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"%s\0A[line %d]\0A\00"
define void @do_usage_if(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1272 x i8], [1272 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
}