xunge/DecIR huggingface dataset:
int search(int *a, int v, int n) {
  int i = 0;
  while (i < n) {
    if (a[i] == v)
      break;
    else
      i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1148 <search+0x48>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
jne    113a <search+0x3a>
jmp    1148 <search+0x48>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <search+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
test   %edx,%edx
jle    1121 <search+0x21>
mov    %edx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %esi,(%rdi,%rax,4)
je     1120 <search+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <search+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %2, %12 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr_pp(int /*<<< orphan*/);
void and_by_ptr_pp(uint32_t x) {
  by_ptr_pp(x);
  and();
}


x86 assembly (clang, -O0):
<and_by_ptr_pp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <by_ptr_pp@plt>
mov    $0x0,%al
call   1030 <and@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_by_ptr_pp>:
push   %rax
call   1040 <by_ptr_pp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <and@plt>

LLVM IR (-O0):
define void @and_by_ptr_pp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr_pp(i32 %3)
%5 = call i32 (...) @and()
ret void
}

LLVM IR (-O2):
define void @and_by_ptr_pp(i32 %0) {
%2 = tail call i32 @by_ptr_pp(i32 %0)
%3 = tail call i32 (...) @and()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _protoid_usage(void) {
  fputs("Usage: protoid protocol...\n", stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_protoid_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_protoid_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Usage: protoid protocol...\0A\00"
@stderr = global i32 0
define i32 @_protoid_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: protoid protocol...\0A\00"
@stderr = global i32 0
define i32 @_protoid_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_HandlersBoundToSyntaxMustNotReturnAValue(long p_position) {
  _Error(p_position, "Handlers bound to syntax must not return a value");
}


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

x86 assembly (clang, -O2):
<Error_HandlersBoundToSyntaxMustNotReturnAValue>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Handlers bound to syntax must not return a value\00"
define void @Error_HandlersBoundToSyntaxMustNotReturnAValue(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Handlers bound to syntax must not return a value\00"
define void @Error_HandlersBoundToSyntaxMustNotReturnAValue(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}
void __asan_report_store16() {}


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

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

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

LLVM IR (-O2):
define void @__asan_report_store16() {
ret void
}
unsigned int unsignedint_ignoring_signedint(unsigned int x, signed int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i32 @unsignedint_ignoring_signedint(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @unsignedint_ignoring_signedint(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int *);
void count_to_20(int counter) {
  int i;
  if (counter <= 20) {
    printf("Address %s = %p\n", "i", (&(i)));
    count_to_20(++counter);
  }
}


x86 assembly (clang, -O0):
<count_to_20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jg     115a <count_to_20+0x3a>
lea    0xec4(%rip),%rdi
lea    0xece(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x4(%rbp)
call   1040 <count_to_20@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_to_20>:
cmp    $0x14,%edi
jg     1153 <count_to_20+0x33>
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xecd(%rip),%rdi
lea    0xed7(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <count_to_20@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Address %s = %p\0A\00"
@.str.1 = [2 x i8] c"i\00"
define void @count_to_20(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 20
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Address %s = %p\0A\00"
@.str.1 = [2 x i8] c"i\00"
define void @count_to_20(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp slt i32 %0, 21
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = add nsw i32 %0, 1
br label %8
8: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_add_flt(float *, float, float);
float xil_fpo_add_flt(float a, float b) {
  float res_flt;
  xip_fpo_add_flt(&res_flt, a, b);
  return res_flt;
}


x86 assembly (clang, -O0):
<xil_fpo_add_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
call   1030 <xip_fpo_add_flt@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_add_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_add_flt@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xil_fpo_add_flt(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call i32 @xip_fpo_add_flt(float* %5, float %6, float %7)
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @xil_fpo_add_flt(float %0, float %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @xip_fpo_add_flt(float* %3, float %0, float %1)
%6 = load float, float* %3
ret float %6
}
short *test_func_01(short *p, int c) {
  *--p = (short)c;
  return p;
}


x86 assembly (clang, -O0):
<test_func_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffe,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cx,-0x2(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_01>:
mov    %si,-0x2(%rdi)
lea    -0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i16* @test_func_01(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i16
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i32 -1
store i16* %8, i16** %3
store i16 %6, i16* %8
%9 = load i16*, i16** %3
ret i16* %9
}

LLVM IR (-O2):
define i16* @test_func_01(i16* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = getelementptr inbounds i16, i16* %0, i64 -1
store i16 %3, i16* %4
ret i16* %4
}
/* Variables and functions */
int zipPrevEncodeLength(int /*<<< orphan*/ *, unsigned int);
int zipPrevLenByteDiff(unsigned char *p, unsigned int len) {
  unsigned int prevlensize;
  do {
    if ((p)[0] < 254) {
      (prevlensize) = 1;
    } else {
      (prevlensize) = 5;
    }
  } while (0);
  ;
  return zipPrevEncodeLength(NULL, len) - prevlensize;
}


x86 assembly (clang, -O0):
<zipPrevLenByteDiff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xfe,%eax
jge    113d <zipPrevLenByteDiff+0x2d>
movl   $0x1,-0x10(%rbp)
jmp    1144 <zipPrevLenByteDiff+0x34>
movl   $0x5,-0x10(%rbp)
jmp    1149 <zipPrevLenByteDiff+0x39>
mov    -0xc(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <zipPrevEncodeLength@plt>
sub    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipPrevLenByteDiff>:
push   %rbx
xor    %ebx,%ebx
cmpb   $0xfe,(%rdi)
setb   %bl
xor    %edi,%edi
call   1030 <zipPrevEncodeLength@plt>
lea    (%rax,%rbx,4),%eax
add    $0xfffffffb,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @zipPrevLenByteDiff(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 254
br i1 %11, label %12, label %13
12: ; preds = %6
store i32 1, i32* %5
br label %14
13: ; preds = %6
store i32 5, i32* %5
br label %14
14: ; preds = %13, %12
br label %15
15: ; preds = %14
%16 = load i32, i32* %4
%17 = call i32 @zipPrevEncodeLength(i32* null, i32 %16)
%18 = load i32, i32* %5
%19 = sub i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @zipPrevLenByteDiff(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp ult i8 %3, -2
%5 = select i1 %4, i32 -1, i32 -5
%6 = tail call i32 @zipPrevEncodeLength(i32* null, i32 %1)
%7 = add i32 %5, %6
ret i32 %7
}
/* Variables and functions */
void *contract_non_null(void const *, char const *, char const *, int,
                        char const *, char *);
void *_contract_ensures_non_null(const void *x, const char *x_s,
                                 const char *file, int line, const char *func) {
  return contract_non_null(x, x_s, file, line, func,
                           "%s:%d: %s: Ensures `%s' != NULL failed.\n");
}


x86 assembly (clang, -O0):
<_contract_ensures_non_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
lea    0xebb(%rip),%r9
call   1030 <contract_non_null@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_contract_ensures_non_null>:
lea    0xee9(%rip),%r9
jmp    1030 <contract_non_null@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"%s:%d: %s: Ensures `%s' != NULL failed.\0A\00"
define i8* @_contract_ensures_non_null(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i8* @contract_non_null(i8* %11, i8* %12, i8* %13, i32 %14, i8* %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i8* %16
}

LLVM IR (-O2):
@.str = [41 x i8] c"%s:%d: %s: Ensures `%s' != NULL failed.\0A\00"
define i8* @_contract_ensures_non_null(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i8* @contract_non_null(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i8* %6
}
/* Variables and functions */
int __mib_flash_write(char *, int, int);
int flash_write(char *buf, int offset, int len) {
  return __mib_flash_write(buf, offset, len);
}


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

x86 assembly (clang, -O2):
<flash_write>:
jmp    1030 <__mib_flash_write@plt>

LLVM IR (-O0):
define i32 @flash_write(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @__mib_flash_write(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @flash_write(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__mib_flash_write(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void FPU_IRQHandler() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @PROFILE_INIT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_write(int, unsigned short, char *);
void outw_p(unsigned short int value, unsigned short int port) {
  check_write((int)port, value, "outw_p");
}


x86 assembly (clang, -O0):
<outw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%edi
lea    0xecf(%rip),%rdx
movzwl -0x2(%rbp),%esi
call   1030 <check_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_p>:
mov    %edi,%eax
lea    0xee7(%rip),%rdx
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <check_write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"outw_p\00"
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = load i16, i16* %3
%8 = call i32 @check_write(i32 %6, i16 zeroext %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"outw_p\00"
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = tail call i32 @check_write(i32 %3, i16 zeroext %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int GenFxnSizeNeeded(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @GenFxnSizeNeeded() {
ret i32 0
}

LLVM IR (-O2):
define i32 @GenFxnSizeNeeded() {
ret i32 0
}
int sniff_create_socket(char const *iface) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sniff_create_socket(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t getGpioPinValu(uint32_t hGPIO, uint32_t nPin) {
  uint32_t *GPIO_IDR;
  GPIO_IDR = (uint32_t *)(hGPIO + 0x10);
  return *GPIO_IDR &= (0x01 << nPin);
}


x86 assembly (clang, -O0):
<getGpioPinValu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x10(%rbp),%rcx
and    (%rcx),%eax
mov    %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGpioPinValu>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %edi,%rcx
and    0x10(%rcx),%eax
mov    %eax,0x10(%rcx)
ret

LLVM IR (-O0):
define i32 @getGpioPinValu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 16
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = and i32 %13, %11
store i32 %14, i32* %12
ret i32 %14
}

LLVM IR (-O2):
define i32 @getGpioPinValu(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 16
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = shl nuw i32 1, %1
%7 = load i32, i32* %5
%8 = and i32 %7, %6
store i32 %8, i32* %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ check_flags();
int /*<<< orphan*/ clear_flags();
int /*<<< orphan*/ dump_image();
int /*<<< orphan*/ read_image();
int main(int argc, char **argv) {
  clear_flags();
  read_image();
  check_flags();
  dump_image();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <clear_flags@plt>
mov    $0x0,%al
call   1040 <read_image@plt>
mov    $0x0,%al
call   1050 <check_flags@plt>
mov    $0x0,%al
call   1030 <dump_image@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <clear_flags@plt>
xor    %eax,%eax
call   1040 <read_image@plt>
xor    %eax,%eax
call   1050 <check_flags@plt>
xor    %eax,%eax
call   1030 <dump_image@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @clear_flags()
%6 = call i32 (...) @read_image()
%7 = call i32 (...) @check_flags()
%8 = call i32 (...) @dump_image()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @clear_flags()
%4 = tail call i32 (...) @read_image()
%5 = tail call i32 (...) @check_flags()
%6 = tail call i32 (...) @dump_image()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int pipe(int fd[2]) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @pipe(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print_line_int32_t(uint32_t i, uint32_t j, int32_t v, int magma) {
  if (magma)
    printf("A[%u,%u]:=%d;\n", i, j, v);
  else
    printf("%u %u %d\n", i, j, v);
}


x86 assembly (clang, -O0):
<print_line_int32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1148 <print_line_int32_t+0x38>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <print_line_int32_t+0x4d>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line_int32_t>:
mov    %edx,%eax
mov    %esi,%edx
mov    %edi,%esi
test   %ecx,%ecx
lea    0xef0(%rip),%rcx
lea    0xeda(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"A[%u,%u]:=%d;\0A\00"
@.str.1 = [10 x i8] c"%u %u %d\0A\00"
define void @print_line_int32_t(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %0, i32 %1, i32 %2)
ret void
}
int msm8996_unclamp_secondary_arm_cpu(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm8996_unclamp_secondary_arm_cpu(i32 %0) {
ret i32 0
}
unsigned int gpio_get(unsigned int pin) {
  gpio_init_inpin(pin);
  volatile unsigned int *Reg =
      ((((volatile void *)0x01E26000) + 0x10 + (pin >> 5) * 0x28) + 0x10);
  return (((*Reg) & (1 << (pin & 0x1F))) != 0);
}


x86 assembly (clang, -O0):
<gpio_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <gpio_init_inpin@plt>
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
imul   $0x28,%eax,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1e26000,%eax
add    $0x10,%rax
add    %rcx,%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_get>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <gpio_init_inpin@plt>
mov    %ebx,%eax
shr    $0x2,%eax
and    $0xfffffff8,%eax
lea    (%rax,%rax,4),%eax
mov    0x1e26020(%rax),%eax
mov    %ebx,%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gpio_get(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @gpio_init_inpin to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
%7 = lshr i32 %6, 5
%8 = mul i32 %7, 40
%9 = zext i32 %8 to i64
%10 = getelementptr i8, i8* getelementptr (i8, i8* inttoptr (i64 31612928 to i8*), i64 16), i64 %9
%11 = getelementptr i8, i8* %10, i64 16
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = load volatile i32, i32* %13
%15 = load i32, i32* %2
%16 = and i32 %15, 31
%17 = shl i32 1, %16
%18 = and i32 %14, %17
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @gpio_get(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @gpio_init_inpin to i32 (i32, ...)*)(i32 %0)
%3 = lshr i32 %0, 5
%4 = mul i32 %3, 40
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 31612944 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 16
%8 = bitcast i8* %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %0, 31
%11 = lshr i32 %9, %10
%12 = and i32 %11, 1
ret i32 %12
}
/* Variables and functions */
void *dlsym(void *handle, const char *name) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @dlsym(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
int wps_validate_wsc_nack(const struct wpabuf *tlvs) { return 0; }


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

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

LLVM IR (-O0):
%struct.wpabuf = type opaque
define i32 @wps_validate_wsc_nack(%struct.wpabuf* %0) {
%2 = alloca %struct.wpabuf*
store %struct.wpabuf* %0, %struct.wpabuf** %2
ret i32 0
}

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_wsc_nack(%struct.wpabuf* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char last_name[20];
  printf("Enter your last name: ");
  scanf("%s", last_name);
  printf("\n\nYou entered %s\n\n", last_name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter your last name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"\0A\0AYou entered %s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter your last name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"\0A\0AYou entered %s\0A\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
void foo732() {}


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

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

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

LLVM IR (-O2):
define void @foo732() {
ret void
}
/* Variables and functions */
int ulz77_encode_file(char const *, char const *, int /*<<< orphan*/);
int ulz77_compress_file(const char *filename_dst, const char *filename_src) {
  return ulz77_encode_file(filename_dst, filename_src, 0);
}


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

x86 assembly (clang, -O2):
<ulz77_compress_file>:
xor    %edx,%edx
jmp    1030 <ulz77_encode_file@plt>

LLVM IR (-O0):
define i32 @ulz77_compress_file(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
%7 = call i32 @ulz77_encode_file(i8* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ulz77_compress_file(i8* %0, i8* %1) {
%3 = tail call i32 @ulz77_encode_file(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void DymosimMessage(const char *message) { printf("%s\n", message); }


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

x86 assembly (clang, -O2):
<DymosimMessage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @DymosimMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @DymosimMessage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar(402);
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffff92,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @putchar(i8 signext -110)
%2 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext -110)
%2 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
int isonum_722(char *p) { return ((p[1] & 0xff) | ((p[0] & 0xff) << 8)); }


x86 assembly (clang, -O0):
<isonum_722>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_722>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @isonum_722(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 255
%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 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @isonum_722(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %4
ret i32 %8
}
/* Type definitions */
struct aiocb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int aio_write(struct aiocb *cb) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<aio_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_write>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_write(%struct.aiocb* %0) {
%2 = alloca %struct.aiocb*
store %struct.aiocb* %0, %struct.aiocb** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_write(%struct.aiocb* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
scalar_t__ isspace(char);
char *column_skip_spaces(char *string) {
  while (*string && isspace(*string))
    string++;
  return string;
}


x86 assembly (clang, -O0):
<column_skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <column_skip_spaces+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <column_skip_spaces+0x47>
jmp    1168 <column_skip_spaces+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <column_skip_spaces+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<column_skip_spaces>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <column_skip_spaces+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <column_skip_spaces+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <column_skip_spaces+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @column_skip_spaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @column_skip_spaces(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
char *malloc(int const);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *add_newline(const char *src) {
  const int l = strlen(src);
  char *dst = malloc(l + 2);
  strcpy(dst, src);
  dst[l] = '\n';
  dst[l + 1] = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<add_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x2,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_newline>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    0x2(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
movslq %r15d,%rax
movw   $0xa,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @add_newline(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 2
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 10, i8* %16
%17 = load i8*, i8** %4
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @add_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 2
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 10, i8* %7
%8 = add nsw i32 %2, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %4, i64 %9
store i8 0, i8* %10
ret i8* %4
}
void initialiseStatesAndConstants(double *states, double *variables) {
  states[0] = 1.0;
}


x86 assembly (clang, -O0):
<initialiseStatesAndConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiseStatesAndConstants>:
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @initialiseStatesAndConstants(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
store double 1.000000e+00, double* %6
ret void
}

LLVM IR (-O2):
define void @initialiseStatesAndConstants(double* nocapture writeonly %0, double* nocapture readnone %1) {
store double 1.000000e+00, double* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
uid_t getuid(void) {
  printf("Evil code ran!\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Evil code ran!\0A\00"
define i32 @getuid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [15 x i8] c"Evil code ran!\00"
define i32 @getuid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __NR_gettid;
int syscall(int /*<<< orphan*/);
int sys_gettid(void) { return syscall(__NR_gettid); }


x86 assembly (clang, -O0):
<sys_gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_gettid = global i32 0
define i32 @sys_gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@__NR_gettid = global i32 0
define i32 @sys_gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ seq;

/* Variables and functions */
int /*<<< orphan*/ Floyd();
int /*<<< orphan*/ matrix_display();
int /*<<< orphan*/ matrix_init(int **, int);
int main() {
  int seq[][3] = {{0, 1, 10}, {0, 3, 30}, {0, 4, 100}, {1, 2, 50},
                  {2, 4, 10}, {3, 2, 20}, {3, 4, 60}};
  int num = sizeof(seq) / sizeof(*seq);
  matrix_init(seq, num);
  matrix_display();
  Floyd();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x54,%edx
call   1040 <memcpy@plt>
movl   $0x7,-0x64(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%esi
call   1030 <matrix_init@plt>
mov    $0x0,%al
call   1060 <matrix_display@plt>
mov    $0x0,%al
call   1050 <Floyd@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xf16(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xefb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xedf(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe8b(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <matrix_init@plt>
xor    %eax,%eax
call   1050 <matrix_display@plt>
xor    %eax,%eax
call   1040 <Floyd@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.seq = [7 x [3 x i32]] [[3 x i32] [i32 0, i32 1, i32 10], [3 x i32] [i32 0, i32 3, i32 30], [3 x i32] [i32 0, i32 4, i32 100], [3 x i32] [i32 1, i32 2, i32 50], [3 x i32] [i32 2, i32 4, i32 10], [3 x i32] [i32 3, i32 2, i32 20], [3 x i32] [i32 3, i32 4, i32 60]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x [3 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x [3 x i32]]* %2 to i8*
store i32 7, i32* %3
%5 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %2, i64 0, i64 0
%6 = bitcast [3 x i32]* %5 to i32**
%7 = load i32, i32* %3
%8 = call i32 @matrix_init(i32** %6, i32 %7)
%9 = call i32 (...) @matrix_display()
%10 = call i32 (...) @Floyd()
ret i32 0
}

LLVM IR (-O2):
@__const.main.seq = [7 x [3 x i32]] [[3 x i32] [i32 0, i32 1, i32 10], [3 x i32] [i32 0, i32 3, i32 30], [3 x i32] [i32 0, i32 4, i32 100], [3 x i32] [i32 1, i32 2, i32 50], [3 x i32] [i32 2, i32 4, i32 10], [3 x i32] [i32 3, i32 2, i32 20], [3 x i32] [i32 3, i32 4, i32 60]]
define i32 @main() {
%1 = alloca [7 x [3 x i32]]
%2 = bitcast [7 x [3 x i32]]* %1 to i8*
%3 = bitcast [7 x [3 x i32]]* %1 to i32**
%4 = call i32 @matrix_init(i32** %3, i32 7)
%5 = call i32 (...) @matrix_display()
%6 = call i32 (...) @Floyd()
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int digit_to_int(char digit) {
  char buffer[] = {'\0', '\0'};
  buffer[0] = digit;
  return atoi(buffer);
}


x86 assembly (clang, -O0):
<digit_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
lea    -0x3(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_int>:
push   %rax
movw   $0x0,0x6(%rsp)
mov    %dil,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <atoi@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @digit_to_int(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %5, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @atoi(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @digit_to_int(i8 signext %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 0, i16* %2
store i8 %0, i8* %3
%4 = call i32 @atoi(i8* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ add_file(char const *, int /*<<< orphan*/);
void add_url(const char *url) { add_file(url, 0); }


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

x86 assembly (clang, -O2):
<add_url>:
xor    %esi,%esi
jmp    1030 <add_file@plt>

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

LLVM IR (-O2):
define void @add_url(i8* %0) {
%2 = tail call i32 @add_file(i8* %0, i32 0)
ret void
}
void gtk_event_box_new() {}


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

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

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

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