xunge/DecIR huggingface dataset:
int main() {
  int a, b, c;
  if (a) {
    return 0;
    c = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1128 <main+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char valueToXDigit(int v) {
  ;
  if (v >= 0xA)
    return 'A' + (v - 0xA);
  else
    return '0' + v;
}


x86 assembly (clang, -O0):
<valueToXDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1122 <valueToXDigit+0x22>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    112b <valueToXDigit+0x2b>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueToXDigit>:
cmp    $0xa,%edi
mov    $0x37,%ecx
mov    $0x30,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @valueToXDigit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 10
%9 = add nsw i32 65, %8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = add nsw i32 48, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %11, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @valueToXDigit(i32 %0) {
%2 = icmp sgt i32 %0, 9
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 55, i8 48
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_check_stability(float *, float *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  float a[] = {1.000000000000000, 1.593750000000000, 1.750000000000000,
               1.031250000000000, 0.312500000000000};
  float b[] = {0.031250000000000, -0.093750000000000, 0.156250000000000,
               -0.093750000000000, 0.031250000000000};
  assert(__ESBMC_check_stability(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec6(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <__ESBMC_check_stability@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xef0(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <__ESBMC_check_stability@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [5 x float] [float 1.000000e+00, float 1.593750e+00, float 1.750000e+00, float 1.031250e+00, float 3.125000e-01]
@__const.main.b = [5 x float] [float 3.125000e-02, float -9.375000e-02, float 1.562500e-01, float -9.375000e-02, float 3.125000e-02]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x float]
%3 = alloca [5 x float]
store i32 0, i32* %1
%4 = bitcast [5 x float]* %2 to i8*
%5 = bitcast [5 x float]* %3 to i8*
%6 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x float], [5 x float]* %3, i64 0, i64 0
%8 = call i32 @__ESBMC_check_stability(float* %6, float* %7)
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [5 x float] [float 1.000000e+00, float 1.593750e+00, float 1.750000e+00, float 1.031250e+00, float 3.125000e-01]
@__const.main.b = [5 x float] [float 3.125000e-02, float -9.375000e-02, float 1.562500e-01, float -9.375000e-02, float 3.125000e-02]
define i32 @main() {
%1 = alloca [5 x float]
%2 = alloca [5 x float]
%3 = bitcast [5 x float]* %1 to i8*
%4 = bitcast [5 x float]* %2 to i8*
%5 = getelementptr inbounds [5 x float], [5 x float]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x float], [5 x float]* %2, i64 0, i64 0
%7 = call i32 @__ESBMC_check_stability(float* %5, float* %6)
%8 = call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void basicRemover(void *item) { free(item); }


x86 assembly (clang, -O0):
<basicRemover>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basicRemover>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @basicRemover(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @basicRemover(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
unsigned char strlen(char const *);
void _separator_draw(const char *banner_text) {
  unsigned char i = strlen(banner_text);
  do {
    putchar('=');
    i--;
  } while (i);
  puts("");
}


x86 assembly (clang, -O0):
<_separator_draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %al,-0x9(%rbp)
mov    $0x3d,%edi
call   1030 <putchar@plt>
mov    -0x9(%rbp),%al
add    $0xff,%al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1148 <_separator_draw+0x18>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_separator_draw>:
push   %rbx
call   1040 <strlen@plt>
mov    %eax,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xff,%bl
jne    1130 <_separator_draw+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @_separator_draw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call zeroext i8 @strlen(i8* %4)
store i8 %5, i8* %3
br label %6
6: ; preds = %10, %1
%7 = call i32 @putchar(i8 signext 61)
%8 = load i8, i8* %3
%9 = add i8 %8, -1
store i8 %9, i8* %3
br label %10
10: ; preds = %6
%11 = load i8, i8* %3
%12 = icmp ne i8 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %10
%14 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @_separator_draw(i8* %0) {
%2 = tail call zeroext i8 @strlen(i8* %0)
br label %3
3: ; preds = %3, %1
%4 = phi i8 [ %2, %1 ], [ %6, %3 ]
%5 = tail call i32 @putchar(i8 signext 61)
%6 = add i8 %4, -1
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xf2() {
  Assert_real((isalpha(242) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1215, ("isalpha should be 0 for 0xf2"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xf2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf2,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4bf,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xf2>:
push   %rax
mov    $0xf2,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4bf,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf2\00"
define void @t_isalpha_0xf2() {
%1 = call i64 @isalpha(i32 242)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf2\00"
define void @t_isalpha_0xf2() {
%1 = tail call i64 @isalpha(i32 242)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void LCDIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000060))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<LCDIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x60(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIntEnable>:
mov    %rsi,0x60(%rdi)
ret

LLVM IR (-O0):
define void @LCDIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 96
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @LCDIntEnable(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 96
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int __raw_readl(int);
int /*<<< orphan*/ __raw_writel(unsigned int, int);
void ethernet_reset(void) {
  unsigned int v;
  v = __raw_readl(0x80010020);
  __raw_writel(v | 0x00000001, 0x80010020);
  while (__raw_readl(0x80010020) & 0x00000001)
    ;
}


x86 assembly (clang, -O0):
<ethernet_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80010020,%edi
call   1040 <__raw_readl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x1,%edi
mov    $0x80010020,%esi
call   1030 <__raw_writel@plt>
mov    $0x80010020,%edi
call   1040 <__raw_readl@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1160 <ethernet_reset+0x40>
jmp    1145 <ethernet_reset+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethernet_reset>:
push   %rax
mov    $0x80010020,%edi
call   1040 <__raw_readl@plt>
or     $0x1,%eax
mov    %eax,%edi
mov    $0x80010020,%esi
call   1030 <__raw_writel@plt>
nopw   0x0(%rax,%rax,1)
mov    $0x80010020,%edi
call   1040 <__raw_readl@plt>
test   $0x1,%al
jne    1140 <ethernet_reset+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @ethernet_reset() {
%1 = alloca i32
%2 = call i32 @__raw_readl(i32 -2147418080)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 1
%5 = call i32 @__raw_writel(i32 %4, i32 -2147418080)
br label %6
6: ; preds = %10, %0
%7 = call i32 @__raw_readl(i32 -2147418080)
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @ethernet_reset() {
%1 = tail call i32 @__raw_readl(i32 -2147418080)
%2 = or i32 %1, 1
%3 = tail call i32 @__raw_writel(i32 %2, i32 -2147418080)
br label %4
4: ; preds = %4, %0
%5 = tail call i32 @__raw_readl(i32 -2147418080)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(
      stderr,
      "Usage:  %s [-aElnru] command [file ...]\n"
      "\t%s [-aElnru] [-e command] [-f command_file] [-I[extension]]\n"
      "\t    [-i[extension]] [file ...]\n",
      getprogname(), getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [134 x i8] c"Usage: %s [-aElnru] command [file ...]\0A\09%s [-aElnru] [-e command] [-f command_file] [-I[extension]]\0A\09 [-i[extension]] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i8* (...) @getprogname()
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [134 x i8] c"Usage: %s [-aElnru] command [file ...]\0A\09%s [-aElnru] [-e command] [-f command_file] [-I[extension]]\0A\09 [-i[extension]] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i8* (...) @getprogname()
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void XtGetKeyboardFocusWidget() {}


x86 assembly (clang, -O0):
<XtGetKeyboardFocusWidget>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XtGetKeyboardFocusWidget>:
ret

LLVM IR (-O0):
define void @XtGetKeyboardFocusWidget() {
ret void
}

LLVM IR (-O2):
define void @XtGetKeyboardFocusWidget() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: %s [-vd] -i <input> -o <output>\n"
          "\t %s [-v] -p <progname>\n",
          getprogname(), getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"Usage: %s [-vd] -i <input> -o <output>\0A\09 %s [-v] -p <progname>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i8* (...) @getprogname()
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"Usage: %s [-vd] -i <input> -o <output>\0A\09 %s [-v] -p <progname>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i8* (...) @getprogname()
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int ReadEeprom(int /*<<< orphan*/);
unsigned long ReadEepromWord(int WordAddress) {
  unsigned long word;
  int i, j;
  for (i = 0, word = 0L; i < 2; i++)
    word |= ((j = ReadEeprom(WordAddress++)) << (i * 8));
  return (word);
}


x86 assembly (clang, -O0):
<ReadEepromWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1167 <ReadEepromWord+0x57>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <ReadEeprom@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
cltq
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <ReadEepromWord+0x1a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadEepromWord>:
push   %rbp
push   %rbx
push   %rax
lea    0x1(%rdi),%ebx
call   1030 <ReadEeprom@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <ReadEeprom@plt>
shl    $0x8,%eax
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @ReadEepromWord(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i64 0, i64* %3
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = call i32 @ReadEeprom(i32 %10)
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 8
%15 = shl i32 %12, %14
%16 = sext i32 %15 to i64
%17 = load i64, i64* %3
%18 = or i64 %17, %16
store i64 %18, i64* %3
br label %19
19: ; preds = %9
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @ReadEepromWord(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @ReadEeprom(i32 %0)
%4 = tail call i32 @ReadEeprom(i32 %2)
%5 = shl i32 %4, 8
%6 = or i32 %3, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
int test_imm_F3int64_lowword_mem(long long *val) {
  return ((*val) & (0xF3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F3int64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xf3,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F3int64_lowword_mem>:
testb  $0xf3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F3int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 243
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F3int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 243
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double rangam(double);
double ranchi(int d) {
  double y;
  y = 2.0 * rangam(0.5 * (double)d);
  return y;
}


x86 assembly (clang, -O0):
<ranchi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee0(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <rangam@plt>
movaps %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranchi>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <rangam@plt>
addsd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ranchi(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fmul double 5.000000e-01, %5
%7 = call double @rangam(double %6)
%8 = fmul double 2.000000e+00, %7
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @ranchi(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 5.000000e-01
%4 = tail call double @rangam(double %3)
%5 = fmul double %4, 2.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ baz(int);
int main(void) {
  baz(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <baz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <baz@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @baz(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @baz(i32 2)
ret i32 0
}
/* Type definitions */
typedef unsigned long int32_t;

/* Variables and functions */
size_t int32_size(int32_t v) {
  if (v < 0) {
    return 10;
  } else if (v < (1UL << 7)) {
    return 1;
  } else if (v < (1UL << 14)) {
    return 2;
  } else if (v < (1UL << 21)) {
    return 3;
  } else if (v < (1UL << 28)) {
    return 4;
  } else {
    return 5;
  }
}


x86 assembly (clang, -O0):
<int32_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jae    1120 <int32_size+0x20>
movq   $0xa,-0x8(%rbp)
jmp    1194 <int32_size+0x94>
cmpq   $0x80,-0x10(%rbp)
jae    113b <int32_size+0x3b>
movq   $0x1,-0x8(%rbp)
jmp    1194 <int32_size+0x94>
cmpq   $0x4000,-0x10(%rbp)
jae    1156 <int32_size+0x56>
movq   $0x2,-0x8(%rbp)
jmp    1194 <int32_size+0x94>
cmpq   $0x200000,-0x10(%rbp)
jae    1171 <int32_size+0x71>
movq   $0x3,-0x8(%rbp)
jmp    1194 <int32_size+0x94>
cmpq   $0x10000000,-0x10(%rbp)
10
jae    118c <int32_size+0x8c>
movq   $0x4,-0x8(%rbp)
jmp    1194 <int32_size+0x94>
movq   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int32_size>:
mov    $0x1,%eax
cmp    $0x80,%rdi
jb     113a <int32_size+0x3a>
mov    $0x2,%eax
cmp    $0x4000,%rdi
jb     113a <int32_size+0x3a>
mov    $0x3,%eax
cmp    $0x200000,%rdi
jb     113a <int32_size+0x3a>
cmp    $0x10000000,%rdi
mov    $0x5,%eax
sbb    $0x0,%rax
ret

LLVM IR (-O0):
define i64 @int32_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ult i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 10, i64* %2
br label %24
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp ult i64 %8, 128
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 1, i64* %2
br label %24
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp ult i64 %12, 16384
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 2, i64* %2
br label %24
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp ult i64 %16, 2097152
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 3, i64* %2
br label %24
19: ; preds = %15
%20 = load i64, i64* %3
%21 = icmp ult i64 %20, 268435456
br i1 %21, label %22, label %23
22: ; preds = %19
store i64 4, i64* %2
br label %24
23: ; preds = %19
store i64 5, i64* %2
br label %24
24: ; preds = %23, %22, %18, %14, %10, %6
%25 = load i64, i64* %2
ret i64 %25
}

LLVM IR (-O2):
define i64 @int32_size(i64 %0) {
%2 = icmp ult i64 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 16384
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 2097152
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i64 %0, 268435456
%9 = select i1 %8, i64 4, i64 5
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i64 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i64 %11
}
int mini(int x, int y) {
  if (x <= y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<mini>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <mini+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <mini+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @mini(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @mini(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
double cos(double);
double fpu_fcos(double a) {
  double b;
  b = cos(a);
  return b;
}


x86 assembly (clang, -O0):
<fpu_fcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpu_fcos>:
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @fpu_fcos(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @cos(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @fpu_fcos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int util_rndGet(int /*<<< orphan*/, unsigned long long);
void util_rndBuf(uint8_t *buf, size_t sz) {
  uint64_t a = 6364136223846793005ULL;
  uint64_t c = 1442695040888963407ULL;
  uint64_t x = util_rndGet(0, 1ULL << 60);
  for (size_t i = 0; i < sz; i++) {
    x = (a * x + c);
    buf[i] = (uint8_t)((x >> 32) & 0xFF);
  }
  return;
}


x86 assembly (clang, -O0):
<util_rndBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4c957f2d,-0x14(%rbp)
movl   $0xf767814f,-0x18(%rbp)
xor    %edi,%edi
movabs $0x1000000000000000,%rsi
call   1030 <util_rndGet@plt>
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1194 <util_rndBuf+0x84>
mov    -0x14(%rbp),%eax
imul   -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
and    $0xff,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114a <util_rndBuf+0x3a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_rndBuf>:
movabs $0x1000000000000000,%rsi
xor    %edi,%edi
jmp    1030 <util_rndGet@plt>

LLVM IR (-O0):
define void @util_rndBuf(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
store i32 1284865837, i32* %5
store i32 -144211633, i32* %6
%9 = call i32 @util_rndGet(i32 0, i64 1152921504606846976)
store i32 %9, i32* %7
store i64 0, i64* %8
br label %10
10: ; preds = %27, %2
%11 = load i64, i64* %8
%12 = load i64, i64* %4
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %30
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %6
%19 = add nsw i32 %17, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
%21 = ashr i32 %20, 32
%22 = and i32 %21, 255
%23 = sext i32 %22 to i64
%24 = load i64*, i64** %3
%25 = load i64, i64* %8
%26 = getelementptr inbounds i64, i64* %24, i64 %25
store i64 %23, i64* %26
br label %27
27: ; preds = %14
%28 = load i64, i64* %8
%29 = add i64 %28, 1
store i64 %29, i64* %8
br label %10
30: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @util_rndBuf(i64* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @util_rndGet(i32 0, i64 1152921504606846976)
ret void
}
int cofs(char *s, char c) {
  int i;
  for (i = 0; (s[i] != '\0') && (s[i] != c); ++i) {
    ;
  }
  if (s[i] == '\0') {
    return -1;
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<cofs>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1147 <cofs+0x47>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1157 <cofs+0x57>
jmp    116a <cofs+0x6a>
jmp    115c <cofs+0x5c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <cofs+0x15>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    118b <cofs+0x8b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1191 <cofs+0x91>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cofs>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%eax
add    $0x1,%ecx
test   %al,%al
je     1123 <cofs+0x23>
add    $0x1,%rdi
cmp    %sil,%al
jne    1110 <cofs+0x10>
cmp    $0x1,%al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cofs(i8* %0, i8 signext %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 = %28, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %21, %23
br label %25
25: ; preds = %15, %7
%26 = phi i1 [ false, %7 ], [ %24, %15 ]
br i1 %26, label %27, label %31
27: ; preds = %25
br label %28
28: ; preds = %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %7
31: ; preds = %25
%32 = load i8*, i8** %4
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %31
store i32 -1, i32* %3
br label %42
40: ; preds = %31
%41 = load i32, i32* %6
store i32 %41, i32* %3
br label %42
42: ; preds = %40, %39
%43 = load i32, i32* %3
ret i32 %43
}

LLVM IR (-O2):
define i32 @cofs(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %1
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = trunc i64 %4 to i32
%13 = select i1 %7, i32 -1, i32 %12
ret i32 %13
}
int easy_inet_is_ipaddr(const char *host) {
  unsigned char c, *p;
  p = (unsigned char *)host;
  while ((c = (*p++)) != '\0') {
    if ((c != '.') && (c < '0' || c > '9')) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<easy_inet_is_ipaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     1168 <easy_inet_is_ipaddr+0x68>
movzbl -0x11(%rbp),%eax
cmp    $0x2e,%eax
je     1163 <easy_inet_is_ipaddr+0x63>
movzbl -0x11(%rbp),%eax
cmp    $0x30,%eax
jl     1157 <easy_inet_is_ipaddr+0x57>
movzbl -0x11(%rbp),%eax
cmp    $0x39,%eax
jle    1163 <easy_inet_is_ipaddr+0x63>
movl   $0x0,-0x4(%rbp)
jmp    116f <easy_inet_is_ipaddr+0x6f>
jmp    1110 <easy_inet_is_ipaddr+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<easy_inet_is_ipaddr>:
movzbl (%rdi),%eax
add    $0x1,%rdi
cmp    $0x2e,%al
je     1100 <easy_inet_is_ipaddr>
test   %al,%al
je     1118 <easy_inet_is_ipaddr+0x18>
add    $0xc6,%al
cmp    $0xf5,%al
ja     1100 <easy_inet_is_ipaddr>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @easy_inet_is_ipaddr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %26, %1
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %5
%10 = load i8, i8* %8
store i8 %10, i8* %4
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %7
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = icmp ne i32 %15, 46
br i1 %16, label %17, label %26
17: ; preds = %13
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = icmp slt i32 %19, 48
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i8, i8* %4
%23 = zext i8 %22 to i32
%24 = icmp sgt i32 %23, 57
br i1 %24, label %25, label %26
25: ; preds = %21, %17
store i32 0, i32* %2
br label %28
26: ; preds = %21, %13
br label %7
27: ; preds = %7
store i32 1, i32* %2
br label %28
28: ; preds = %27, %25
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @easy_inet_is_ipaddr(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %4, %6 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
switch i8 %5, label %7 [
i8 0, label %10
i8 46, label %6
]
6: ; preds = %2, %7
br label %2
7: ; preds = %2
%8 = add i8 %5, -58
%9 = icmp ult i8 %8, -10
br i1 %9, label %10, label %6
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
bool _is_path_separator(char c) { return c == '/'; }


x86 assembly (clang, -O0):
<_is_path_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_path_separator>:
xor    %eax,%eax
cmp    $0x2f,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @_is_path_separator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 47
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @_is_path_separator(i8 signext %0) {
%2 = icmp eq i8 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, long);
int main(int argc, const char *argv[]) {
  long nc;
  nc = 0;
  int c;
  while ((c = getchar()) != '\n') {
    ++nc;
  }
  printf("%ld\n", nc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xa,%eax
je     1162 <main+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x1e>
mov    -0x18(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%eax
jne    1130 <main+0x10>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
br label %8
8: ; preds = %11, %2
%9 = call i32 (...) @getchar()
store i32 %9, i32* %7
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %6
%13 = add nsw i64 %12, 1
store i64 %13, i64* %6
br label %8
14: ; preds = %8
%15 = load i64, i64* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %7, %3 ]
%5 = tail call i32 (...) @getchar()
%6 = icmp eq i32 %5, 10
%7 = add nuw nsw i64 %4, 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
unsigned blend_screen(register unsigned color1, register unsigned color2) {
  return ((((color1) ^ 255) * ((color2) ^ 255) / 255) ^ 255);
}


x86 assembly (clang, -O0):
<blend_screen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xff,%ecx
imul   %ecx,%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
xor    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_screen>:
xor    $0xff,%edi
xor    $0xff,%esi
imul   %edi,%esi
mov    $0x80808081,%eax
imul   %rsi,%rax
shr    $0x27,%rax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @blend_screen(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 = xor i32 %5, 255
%7 = load i32, i32* %4
%8 = xor i32 %7, 255
%9 = mul i32 %6, %8
%10 = udiv i32 %9, 255
%11 = xor i32 %10, 255
ret i32 %11
}

LLVM IR (-O2):
define i32 @blend_screen(i32 %0, i32 %1) {
%3 = xor i32 %0, 255
%4 = xor i32 %1, 255
%5 = mul i32 %4, %3
%6 = udiv i32 %5, 255
%7 = xor i32 %6, 255
ret i32 %7
}
int args_no_variadic_end(void *user_data, char *value) {
  (void)user_data;
  (void)value;
  return 0;
}


x86 assembly (clang, -O0):
<args_no_variadic_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_no_variadic_end>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @args_no_variadic_end(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @args_no_variadic_end(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void second(float gallon, int size, float cost) {
  printf("gallon price $%.2f\n", gallon);
  printf("tank capacity : %d\n", size);
  printf("Total: $%.2f\n", cost);
}


x86 assembly (clang, -O0):
<second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<second>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
mov    %edi,%ebx
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"gallon price $%.2f\0A\00"
@.str.1 = [20 x i8] c"tank capacity : %d\0A\00"
@.str.2 = [14 x i8] c"Total: $%.2f\0A\00"
define void @second(float %0, i32 %1, float %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to float
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %10)
%12 = load float, float* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float %12)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"gallon price $%.2f\0A\00"
@.str.1 = [20 x i8] c"tank capacity : %d\0A\00"
@.str.2 = [14 x i8] c"Total: $%.2f\0A\00"
define void @second(float %0, i32 %1, float %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %0)
%5 = sitofp i32 %1 to float
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float %2)
ret void
}
/* Variables and functions */
unsigned long rng_nix(unsigned char *, unsigned long, void (*)());
unsigned long rng_get_bytes(unsigned char *buf, unsigned long len,
                            void (*callback)(void)) {
  unsigned long x;
  x = rng_nix(buf, len, callback);
  if (x != 0) {
    return x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rng_get_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <rng_nix@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1151 <rng_get_bytes+0x41>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <rng_get_bytes+0x49>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_get_bytes>:
jmp    1030 <rng_nix@plt>

LLVM IR (-O0):
define i64 @rng_get_bytes(i8* %0, i64 %1, void ()* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca void ()*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store void ()* %2, void ()** %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load void ()*, void ()** %7
%12 = bitcast void ()* %11 to void (...)*
%13 = call i64 @rng_nix(i8* %9, i64 %10, void (...)* %12)
store i64 %13, i64* %8
%14 = load i64, i64* %8
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = load i64, i64* %8
store i64 %17, i64* %4
br label %19
18: ; preds = %3
store i64 0, i64* %4
br label %19
19: ; preds = %18, %16
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
define i64 @rng_get_bytes(i8* %0, i64 %1, void ()* %2) {
%4 = bitcast void ()* %2 to void (...)*
%5 = tail call i64 @rng_nix(i8* %0, i64 %1, void (...)* %4)
ret i64 %5
}
unsigned short getShort(const unsigned char *pt) {
  return ((pt[0] << 8) | pt[1]);
}


x86 assembly (clang, -O0):
<getShort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getShort>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @getShort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @getShort(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
int length(int A[]) {
  int i;
  for (i = 0; i < 10; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    112c <length+0x2c>
jmp    111e <length+0x1e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @length(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @length(i32* nocapture readnone %0) {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void B9(void) { printf("Test2\n"); }


x86 assembly (clang, -O0):
<B9>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<B9>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Test2\0A\00"
define void @B9() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"Test2\00"
define void @B9() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
void wr_sj(s) char *s;
{
  wr_s(s);
  wr_j(s);
}


x86 assembly (clang, -O0):
<wr_sj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <wr_s@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <wr_j@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr_sj>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <wr_s@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <wr_j@plt>

LLVM IR (-O0):
define void @wr_sj(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @wr_s to i32 (i8*, ...)*)(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @wr_j to i32 (i8*, ...)*)(i8* %5)
ret void
}

LLVM IR (-O2):
define void @wr_sj(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @wr_s to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @wr_j to i32 (i8*, ...)*)(i8* %0)
ret void
}