xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *progname) {
  fprintf(stderr, "usage: %s -f pcap\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"usage: %s -f pcap\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"usage: %s -f pcap\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ d_free(void *);
void *d_malloc(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, void *, int /*<<< orphan*/);
void *d_realloc(void *ptr, uint16_t size) {
  void *p_ptr = d_malloc(size);
  if (p_ptr == NULL)
    return NULL;
  memcpy(p_ptr, ptr, size);
  d_free(ptr);
  return p_ptr;
}


x86 assembly (clang, -O0):
<d_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <d_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1163 <d_realloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1184 <d_realloc+0x54>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <d_free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_realloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1050 <d_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <d_realloc+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   1030 <d_free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @d_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = call i8* @d_malloc(i32 %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %20
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = call i32 @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %4
%18 = call i32 @d_free(i8* %17)
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %12, %11
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @d_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @d_malloc(i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
%7 = tail call i32 @d_free(i8* %0)
br label %8
8: ; preds = %2, %5
ret i8* %3
}
unsigned char bytesEqual(char *a, char *b, unsigned char len) {
  while (len--)
    if (*a++ != *b++)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<bytesEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0x19(%rbp)
cmp    $0x0,%al
je     115e <bytesEqual+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1159 <bytesEqual+0x59>
movb   $0x0,-0x1(%rbp)
jmp    1162 <bytesEqual+0x62>
jmp    1111 <bytesEqual+0x11>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytesEqual>:
mov    %edx,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %cl,%r8b
je     1128 <bytesEqual+0x28>
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <bytesEqual+0x10>
xor    %eax,%eax
ret
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @bytesEqual(i8* nocapture %0, i8* nocapture %1, i8 zeroext %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i8 [ %2, %3 ], [ %10, %9 ]
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add i8 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i8 [ 0, %9 ], [ 1, %4 ]
ret i8 %17
}
/* Variables and functions */
int f();
int main(void) { return f(); }


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void test_1(void *ptr) {
  free(ptr);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<test_1>:
push   %rbx
mov    %rdi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @test_1(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void *Cyc_Absyn_compress(void *);
int Cyc_Tcutil_is_typedef_type(void *t) {
  int *_T0;
  int _T1;
  void *_T2 = Cyc_Absyn_compress(t);
  _T0 = (int *)_T2;
  _T1 = *_T0;
  if (_T1 != 8)
    goto _TL2C;
  return 1;
_TL2C:
  return 0;
  ;
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_is_typedef_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Cyc_Absyn_compress@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
je     1149 <Cyc_Tcutil_is_typedef_type+0x39>
jmp    1155 <Cyc_Tcutil_is_typedef_type+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <Cyc_Tcutil_is_typedef_type+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_is_typedef_type>:
push   %rax
call   1030 <Cyc_Absyn_compress@plt>
xor    %ecx,%ecx
cmpl   $0x8,(%rax)
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Cyc_Tcutil_is_typedef_type(i8* %0) {
%2 = tail call i8* @Cyc_Absyn_compress(i8* %0)
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 8
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ bool_read(int, int /*<<< orphan*/ *, int);
uint8_t read_uint8(int fd, uint8_t *integer) {
  return bool_read(fd, integer, 1);
}


x86 assembly (clang, -O0):
<read_uint8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <bool_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint8>:
mov    $0x1,%edx
jmp    1030 <bool_read@plt>

LLVM IR (-O0):
define i32 @read_uint8(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 = load i32*, i32** %4
%7 = call i32 @bool_read(i32 %5, i32* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @read_uint8(i32 %0, i32* %1) {
%3 = tail call i32 @bool_read(i32 %0, i32* %1, i32 1)
ret i32 %3
}
void func1(int n) {}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @func1(i32 %0) {
ret void
}
void co_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @co_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xd5() {
  Assert_real((isgraph(213) == 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_isgraph.c",
              1070, ("isgraph should be 0 for 0xd5"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xd5>:
push   %rax
mov    $0xd5,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x42e,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd5\00"
define void @t_isgraph_0xd5() {
%1 = call i64 @isgraph(i32 213)
%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 1070, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd5\00"
define void @t_isgraph_0xd5() {
%1 = tail call i64 @isgraph(i32 213)
%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 1070, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
short ptoh(short i) {
  return (((unsigned char *)&i)[0] << 8) + (short)((unsigned char *)&i)[1];
}


x86 assembly (clang, -O0):
<ptoh>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
movswl %cx,%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptoh>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @ptoh(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%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 = bitcast i16* %2 to i8*
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i16
%12 = sext i16 %11 to i32
%13 = add nsw i32 %7, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @ptoh(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int q_isblank(int c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<q_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <q_isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @q_isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @q_isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
double kmToMillimetres(double km) { return km * 1000000.0; }


x86 assembly (clang, -O0):
<kmToMillimetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmToMillimetres>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @kmToMillimetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @kmToMillimetres(double %0) {
%2 = fmul double %0, 1.000000e+06
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
scalar_t__ isspace(char);
char fread_letter(FILE *fp) {
  char c;
  do {
    c = getc(fp);
  } while (isspace(c));
  return c;
}


x86 assembly (clang, -O0):
<fread_letter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    112c <fread_letter+0xc>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread_letter>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <getc@plt>
mov    %eax,%ebx
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1130 <fread_letter+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define signext i8 @fread_letter(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
br label %4
4: ; preds = %7, %1
%5 = load i32*, i32** %2
%6 = call signext i8 @getc(i32* %5)
store i8 %6, i8* %3
br label %7
7: ; preds = %4
%8 = load i8, i8* %3
%9 = call i64 @isspace(i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load i8, i8* %3
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @fread_letter(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 @getc(i32* %0)
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void print_help(char *argv0) {
  printf("Usage: %s [OPTION]... DEVICE\n", argv0);
  puts("io_hand -- communicate with serial port");
  puts("  -h            display this help and exit");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: %s [OPTION]... DEVICE\0A\00"
@.str.1 = [40 x i8] c"io_hand -- communicate with serial port\00"
@.str.2 = [43 x i8] c" -h display this help and exit\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: %s [OPTION]... DEVICE\0A\00"
@.str.1 = [40 x i8] c"io_hand -- communicate with serial port\00"
@.str.2 = [43 x i8] c" -h display this help and exit\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void encoder_uninit(void) {}


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

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

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

LLVM IR (-O2):
define void @encoder_uninit() {
ret void
}
/* Variables and functions */
void *memchr(const void *cs, int c, int n) {
  char *cp = (char *)cs;
  for (; *cp != '\0'; cp++) {
    if (*cp == (unsigned char)c) {
      return (void *)cp;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <memchr+0x5e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1148 <memchr+0x48>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <memchr+0x66>
jmp    114d <memchr+0x4d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1116 <memchr+0x16>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <memchr+0x23>
mov    %rdi,%rax
movzbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <memchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3
%7 = and i32 %1, 255
br label %8
8: ; preds = %6, %13
%9 = phi i8 [ %4, %6 ], [ %15, %13 ]
%10 = phi i8* [ %0, %6 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %3
%18 = phi i8* [ null, %3 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ os_printoutput(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void llsif_remove_xml() {
  char cmd[2048] = {0};
  sprintf(cmd, "adb shell \"su -c 'rm %s/GameEngineActivity.xml'\"",
          "/data/data/klb.android.lovelive_en/shared_prefs");
  os_printoutput(cmd);
}


x86 assembly (clang, -O0):
<llsif_remove_xml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
lea    -0x800(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1040 <memset@plt>
lea    -0x800(%rbp),%rdi
lea    0xea4(%rip),%rsi
lea    0xece(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x800(%rbp),%rdi
call   1030 <os_printoutput@plt>
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llsif_remove_xml>:
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rbx
mov    $0x800,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xeaf(%rip),%rsi
lea    0xed9(%rip),%rdx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <os_printoutput@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"adb shell \22su -c 'rm %s/GameEngineActivity.xml'\22\00"
@.str.1 = [48 x i8] c"/data/data/klb.android.lovelive_en/shared_prefs\00"
define void @llsif_remove_xml() {
%1 = alloca [2048 x i8]
%2 = bitcast [2048 x i8]* %1 to i8*
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%6 = call i32 @os_printoutput(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"adb shell \22su -c 'rm %s/GameEngineActivity.xml'\22\00"
@.str.1 = [48 x i8] c"/data/data/klb.android.lovelive_en/shared_prefs\00"
define void @llsif_remove_xml() {
%1 = alloca [2048 x i8]
%2 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @os_printoutput(i8* %2)
ret void
}
/* Variables and functions */
char *my_strchr(char *firstArgument, int secondArgument) {
  for (;; firstArgument++) {
    if (*firstArgument == secondArgument) {
      return firstArgument;
    }
    if (!*firstArgument) {
      return NULL;
    }
  }
}


x86 assembly (clang, -O0):
<my_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1128 <my_strchr+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <my_strchr+0x58>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1142 <my_strchr+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1158 <my_strchr+0x58>
jmp    1147 <my_strchr+0x47>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <my_strchr+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strchr>:
mov    %rdi,%rax
movsbl (%rdi),%ecx
cmp    %esi,%ecx
je     1120 <my_strchr+0x20>
nopw   0x0(%rax,%rax,1)
test   %cl,%cl
je     1121 <my_strchr+0x21>
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <my_strchr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @my_strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %20, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = load i8*, i8** %4
store i8* %13, i8** %3
br label %23
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %14
store i8* null, i8** %3
br label %23
19: ; preds = %14
br label %20
20: ; preds = %19
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
br label %6
23: ; preds = %18, %12
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @my_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, %1
br i1 %5, label %15, label %6
6: ; preds = %2, %10
%7 = phi i8 [ %12, %10 ], [ %3, %2 ]
%8 = phi i8* [ %11, %10 ], [ %0, %2 ]
%9 = icmp eq i8 %7, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %6
15: ; preds = %10, %6, %2
%16 = phi i8* [ %0, %2 ], [ null, %6 ], [ %11, %10 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ MMA8491Q_BULK_READ(int, int, char *);
int /*<<< orphan*/ MMA8491Q_DisEnable();
int /*<<< orphan*/ MMA8491Q_Enable();
int MMA8491_ReadRaw(char *data) {
  char r = 0;
  MMA8491Q_Enable();
  MMA8491Q_BULK_READ(1, 6, data);
  MMA8491Q_DisEnable();
  return 1;
}


x86 assembly (clang, -O0):
<MMA8491_ReadRaw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    $0x0,%al
call   1050 <MMA8491Q_Enable@plt>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
mov    $0x6,%esi
call   1040 <MMA8491Q_BULK_READ@plt>
mov    $0x0,%al
call   1030 <MMA8491Q_DisEnable@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMA8491_ReadRaw>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <MMA8491Q_Enable@plt>
mov    $0x1,%edi
mov    $0x6,%esi
mov    %rbx,%rdx
call   1040 <MMA8491Q_BULK_READ@plt>
xor    %eax,%eax
call   1030 <MMA8491Q_DisEnable@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @MMA8491_ReadRaw(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = call i32 (...) @MMA8491Q_Enable()
%5 = load i8*, i8** %2
%6 = call i32 @MMA8491Q_BULK_READ(i32 1, i32 6, i8* %5)
%7 = call i32 (...) @MMA8491Q_DisEnable()
ret i32 1
}

LLVM IR (-O2):
define i32 @MMA8491_ReadRaw(i8* %0) {
%2 = tail call i32 (...) @MMA8491Q_Enable()
%3 = tail call i32 @MMA8491Q_BULK_READ(i32 1, i32 6, i8* %0)
%4 = tail call i32 (...) @MMA8491Q_DisEnable()
ret i32 1
}
void abort_coordination(void) {}


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

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

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

LLVM IR (-O2):
define void @abort_coordination() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void riskyCode() {
  printf("Calling exit from C code\n");
  exit(1);
}


x86 assembly (clang, -O0):
<riskyCode>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<riskyCode>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Calling exit from C code\0A\00"
define void @riskyCode() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"Calling exit from C code\00"
define void @riskyCode() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void gtk_button_get_alignment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_get_alignment() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HRF_pollreg(int, int, int);
void _wait_ready(void) {
  ;
  HRF_pollreg(0x27, 0x80, 0x80);
}


x86 assembly (clang, -O0):
<_wait_ready>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%edi
mov    $0x80,%edx
mov    %edx,%esi
call   1030 <HRF_pollreg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait_ready>:
mov    $0x27,%edi
mov    $0x80,%esi
mov    $0x80,%edx
jmp    1030 <HRF_pollreg@plt>

LLVM IR (-O0):
define void @_wait_ready() {
%1 = call i32 @HRF_pollreg(i32 39, i32 128, i32 128)
ret void
}

LLVM IR (-O2):
define void @_wait_ready() {
%1 = tail call i32 @HRF_pollreg(i32 39, i32 128, i32 128)
ret void
}
int fn1(unsigned p1) { return -p1; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %edi,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @fn1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = sub i32 0, %0
ret i32 %2
}
int ptr_compare(void *vptr, int *x) { return (x != vptr); }


x86 assembly (clang, -O0):
<ptr_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_compare>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @ptr_compare(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = icmp ne i32* %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ptr_compare(i8* readnone %0, i32* readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = icmp ne i32* %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
double Q_v(double Q_v_convection, double Q_v_gradp, double Q_v_time,
           double Q_v_viscous) {
  return Q_v_convection + Q_v_gradp + Q_v_time + Q_v_viscous;
}


x86 assembly (clang, -O0):
<Q_v>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_v>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @Q_v(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fadd double %9, %10
%12 = load double, double* %7
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @Q_v(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, %1
%6 = fadd double %5, %2
%7 = fadd double %6, %3
ret double %7
}
/* Variables and functions */
int add(int, int);
char *add_001() {
  int rel = add(3, 4);
  do {
    return 7 == rel ? NULL
                    : "expect ["
                      "7"
                      "]";
  } while (0);
  ;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x7,%edx
lea    0xec7(%rip),%rax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x7,%eax
lea    0xed4(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"expect [7]\00"
define i8* @add_001() {
%1 = alloca i32
%2 = call i32 @add(i32 3, i32 4)
store i32 %2, i32* %1
br label %3
3: ; preds = %0
%4 = load i32, i32* %1
%5 = icmp eq i32 7, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* null, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
br label %8
8: ; preds = %3
ret i8* %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"expect [7]\00"
define i8* @add_001() {
%1 = tail call i32 @add(i32 3, i32 4)
%2 = icmp eq i32 %1, 7
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
int test_imm_E5uint16_mem(unsigned short *val) {
  return ((*val) & (-0xE5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E5uint16_mem>:
movzwl (%rdi),%eax
test   $0xff1b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -229
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int b_compareRange(unsigned int const *, unsigned int const *,
                   int /*<<< orphan*/, int /*<<< orphan*/, int);
int b_compareDigits(const unsigned *lrg, const unsigned *sml, int lrg_size,
                    int sml_size) {
  if (lrg_size > sml_size)
    return 1;
  else if (lrg_size < sml_size)
    return -1;
  return b_compareRange(lrg, sml, 0, 0, lrg_size);
}


x86 assembly (clang, -O0):
<b_compareDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    113e <b_compareDigits+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1173 <b_compareDigits+0x63>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1156 <b_compareDigits+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <b_compareDigits+0x63>
jmp    115b <b_compareDigits+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%r8d
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <b_compareRange@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_compareDigits>:
mov    $0x1,%eax
cmp    %ecx,%edx
jg     1120 <b_compareDigits+0x10>
mov    $0xffffffff,%eax
jge    1121 <b_compareDigits+0x11>
ret
mov    %edx,%r8d
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <b_compareRange@plt>

LLVM IR (-O0):
define i32 @b_compareDigits(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %8
%11 = load i32, i32* %9
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 1, i32* %5
br label %25
14: ; preds = %4
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 -1, i32* %5
br label %25
19: ; preds = %14
br label %20
20: ; preds = %19
%21 = load i32*, i32** %6
%22 = load i32*, i32** %7
%23 = load i32, i32* %8
%24 = call i32 @b_compareRange(i32* %21, i32* %22, i32 0, i32 0, i32 %23)
store i32 %24, i32* %5
br label %25
25: ; preds = %20, %18, %13
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @b_compareDigits(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %3
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = icmp slt i32 %2, %3
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @b_compareRange(i32* %0, i32* %1, i32 0, i32 0, i32 %2)
br label %10
10: ; preds = %6, %4, %8
%11 = phi i32 [ %9, %8 ], [ 1, %4 ], [ -1, %6 ]
ret i32 %11
}
void fatal(text) char *text;
{
  error(text);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
xor    %eax,%eax
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* %3)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* %0)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
int do_guest(char *, char *);
int do_exit(char *username) {
  static char path[] = "/etc"
                       "/"
                       "ponyguests"
                       "/ponyguests-delete-guest";
  return do_guest(path, username);
}


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f09(%rip),%rdi
call   1030 <do_guest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_exit>:
mov    %rdi,%rsi
lea    0x2f16(%rip),%rdi
jmp    1030 <do_guest@plt>

LLVM IR (-O0):
@do_exit.path = internal global [40 x i8] c"/etc/ponyguests/ponyguests-delete-guest\00"
define i32 @do_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @do_guest(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @do_exit.path, i64 0, i64 0), i8* %3)
ret i32 %4
}

LLVM IR (-O2):
@do_exit.path = internal global [40 x i8] c"/etc/ponyguests/ponyguests-delete-guest\00"
define i32 @do_exit(i8* %0) {
%2 = tail call i32 @do_guest(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @do_exit.path, i64 0, i64 0), i8* %0)
ret i32 %2
}
int iscale(int value, int numer, int denom) {
  return (long)value * (long)numer / (long)denom;
}


x86 assembly (clang, -O0):
<iscale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscale>:
mov    %edx,%ecx
movslq %edi,%rdx
movslq %esi,%rax
imul   %rdx,%rax
movslq %ecx,%rsi
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1121 <iscale+0x21>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
define i32 @iscale(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %8, %10
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = sdiv i64 %11, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @iscale(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = sext i32 %1 to i64
%6 = mul nsw i64 %5, %4
%7 = sext i32 %2 to i64
%8 = sdiv i64 %6, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
double ceil(double);
double floor(double);
double round(double x) {
  if (x >= 0)
    return floor(x + 0.5);
  else
    return ceil(x - 0.5);
}


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115b <round+0x3b>
movsd  0xeb9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <round+0x56>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1137 <round+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1030 <ceil@plt>
addsd  0xec1(%rip),%xmm0
jmp    1040 <floor@plt>

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = call double @llvm.floor.f64(double %8)
store double %9, double* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fsub double %11, 5.000000e-01
%13 = call double @llvm.ceil.f64(double %12)
store double %13, double* %2
br label %14
14: ; preds = %10, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call double @llvm.floor.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call double @llvm.ceil.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
/* Variables and functions */
void *memcpy(void *dest, const void *src, size_t n) {
  unsigned i;
  for (i = 0; i < n; i++) {
    ((char *)dest)[i] = ((char *)src)[i];
  }
  return dest;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1146 <memcpy+0x46>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <memcpy+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111f <memcpy+0x1f>
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rdi,1),%ecx
mov    %cl,(%rax,%rdi,1)
add    $0x1,%edi
cmp    %rdx,%rdi
jb     1110 <memcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
%10 = add nuw nsw i64 %6, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %2
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret i8* %0
}
unsigned char mc_hex2byte(char hex[2]) {
  unsigned char n = ((hex[0]) - (((hex[0]) <= '9') ? '0' : ('a' - 10)));
  n <<= 4;
  n |= ((hex[1]) - (((hex[1]) <= '9') ? '0' : ('a' - 10)));
  return n;
}


x86 assembly (clang, -O0):
<mc_hex2byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%esi
mov    $0x57,%ecx
mov    $0x30,%edx
cmp    $0x39,%esi
cmovle %edx,%ecx
sub    %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%esi
mov    $0x57,%eax
mov    $0x30,%edx
cmp    $0x39,%esi
cmovle %edx,%eax
sub    %eax,%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_hex2byte>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
xor    %edx,%edx
cmp    $0x3a,%al
setge  %dl
lea    (%rdx,%rdx,8),%edx
add    %al,%dl
shl    $0x4,%dl
cmp    $0x3a,%cl
mov    $0xd0,%esi
mov    $0xa9,%eax
cmovl  %esi,%eax
add    %cl,%al
or     %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @mc_hex2byte(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 57
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 48, i32 87
%15 = sub nsw i32 %7, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 4
%20 = trunc i32 %19 to i8
store i8 %20, i8* %3
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 57
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 48, i32 87
%32 = sub nsw i32 %24, %31
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = or i32 %34, %32
%36 = trunc i32 %35 to i8
store i8 %36, i8* %3
%37 = load i8, i8* %3
ret i8 %37
}

LLVM IR (-O2):
define zeroext i8 @mc_hex2byte(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp slt i8 %2, 58
%4 = select i1 %3, i8 0, i8 9
%5 = add i8 %4, %2
%6 = shl i8 %5, 4
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp slt i8 %8, 58
%10 = select i1 %9, i8 -48, i8 -87
%11 = add i8 %10, %8
%12 = or i8 %11, %6
ret i8 %12
}
void omap_temp_sensor_prepare_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_temp_sensor_prepare_idle() {
ret void
}