xunge/DecIR huggingface dataset:
unsigned int atoulong(char *s) {
  register unsigned int dest = 0;
  register unsigned char c;
  while ((c = *s - '0') < 10) {
    ++s;
    dest = dest * 10 + c;
  }
  return dest;
}


x86 assembly (clang, -O0):
<atoulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %al,-0xd(%rbp)
movzbl %al,%eax
cmp    $0xa,%eax
jge    1146 <atoulong+0x46>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
imul   $0xa,-0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atoulong+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoulong>:
mov    (%rdi),%cl
add    $0xd0,%cl
xor    %eax,%eax
cmp    $0x9,%cl
ja     1138 <atoulong+0x38>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0xd0,%cl
add    $0x1,%rdi
cmp    $0xa,%cl
jb     1120 <atoulong+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoulong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %16
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %3, %1 ]
%7 = phi i8* [ %10, %5 ], [ %0, %1 ]
%8 = phi i32 [ %12, %5 ], [ 0, %1 ]
%9 = zext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = mul i32 %8, 10
%12 = add i32 %11, %9
%13 = load i8, i8* %10
%14 = add i8 %13, -48
%15 = icmp ult i8 %14, 10
br i1 %15, label %5, label %16
16: ; preds = %5, %1
%17 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %17
}
/* Variables and functions */
void system__secondary_stack__ss_stackIP(void *t, size_t size) {}


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

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

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

LLVM IR (-O2):
define void @system__secondary_stack__ss_stackIP(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
struct rtattr {
  int dummy;
};
typedef int /*<<< orphan*/ __s32;

/* Variables and functions */
scalar_t__ RTA_DATA(struct rtattr const *);
__s32 rta_getattr_s32(const struct rtattr *rta) {
  return *(__s32 *)RTA_DATA(rta);
}


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

x86 assembly (clang, -O2):
<rta_getattr_s32>:
push   %rax
call   1030 <RTA_DATA@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_s32(%struct.rtattr* %0) {
%2 = alloca %struct.rtattr*
store %struct.rtattr* %0, %struct.rtattr** %2
%3 = load %struct.rtattr*, %struct.rtattr** %2
%4 = call i64 @RTA_DATA(%struct.rtattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_s32(%struct.rtattr* %0) {
%2 = tail call i64 @RTA_DATA(%struct.rtattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
void SecureRPCInitAuth(unsigned short name_len, char *name) {}


x86 assembly (clang, -O0):
<SecureRPCInitAuth>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SecureRPCInitAuth(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @SecureRPCInitAuth(i16 zeroext %0, i8* nocapture %1) {
ret void
}
unsigned char eeprom_get_char(unsigned int addr) { return 0; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @eeprom_get_char(i32 %0) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
scalar_t__ zero_or_ten(int);
void alloc_may_be_negative_Good_FP() { malloc(zero_or_ten(1) - 5); }


x86 assembly (clang, -O0):
<alloc_may_be_negative_Good_FP>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <zero_or_ten@plt>
mov    %rax,%rdi
sub    $0x5,%rdi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_may_be_negative_Good_FP>:
push   %rax
mov    $0x1,%edi
call   1040 <zero_or_ten@plt>
lea    -0x5(%rax),%rdi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @alloc_may_be_negative_Good_FP() {
%1 = call i64 @zero_or_ten(i32 1)
%2 = sub nsw i64 %1, 5
%3 = call i32 @malloc(i64 %2)
ret void
}

LLVM IR (-O2):
define void @alloc_may_be_negative_Good_FP() {
%1 = tail call i64 @zero_or_ten(i32 1)
%2 = add nsw i64 %1, -5
%3 = tail call i32 @malloc(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void cprint(char *color, char *text) { printf("\e%s%s\e[0m", color, text); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"\1B%s%s\1B[0m\00"
define void @cprint(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 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B%s%s\1B[0m\00"
define void @cprint(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
char *int2char() {}


x86 assembly (clang, -O0):
<int2char>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @int2char() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @int2char() {
ret i8* undef
}
moveto(col, row) int col, row;
{ printf("\33[%u;%uH", row, col); }


x86 assembly (clang, -O0):
<moveto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveto>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define i32 @moveto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%u;%uH\00"
define i32 @moveto(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret i32 undef
}
int cmp_intersections(const void *p1, const void *p2) {
  float f1 = *(float *)p1;
  float f2 = *(float *)p2;
  if (f1 < f2) {
    return -1;
  } else if (f1 == f2) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<cmp_intersections>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1145 <cmp_intersections+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <cmp_intersections+0x6d>
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jne    1166 <cmp_intersections+0x66>
jp     1166 <cmp_intersections+0x66>
movl   $0x0,-0x4(%rbp)
jmp    116d <cmp_intersections+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_intersections>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movaps %xmm0,%xmm2
cmpneqss %xmm1,%xmm2
movd   %xmm2,%ecx
and    $0x1,%ecx
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_intersections(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
store float %10, float* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to float*
%13 = load float, float* %12
store float %13, float* %7
%14 = load float, float* %6
%15 = load float, float* %7
%16 = fcmp olt float %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load float, float* %6
%20 = load float, float* %7
%21 = fcmp oeq float %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %3
br label %24
23: ; preds = %18
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_intersections(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp une float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int alpha(char c) {
  return ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_');
}


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     112d <alpha+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    115d <alpha+0x5d>
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1150 <alpha+0x50>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    115d <alpha+0x5d>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
cmp    $0x5f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %22, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 65, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %22, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %6
%23 = phi i1 [ true, %14 ], [ true, %6 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = icmp eq i8 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void eeprom_update_dword(uint32_t *__p, uint32_t __value) {}


x86 assembly (clang, -O0):
<eeprom_update_dword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @eeprom_update_dword(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @eeprom_update_dword(i32* nocapture %0, i32 %1) {
ret void
}
int avl_dup_ok() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @avl_dup_ok() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool sh4_addr_in_sq_area(uint32_t addr) {
  return (addr & 0xfc000000) == 0xe0000000;
}


x86 assembly (clang, -O0):
<sh4_addr_in_sq_area>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfc000000,%eax
cmp    $0xe0000000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh4_addr_in_sq_area>:
and    $0xfc000000,%edi
xor    %eax,%eax
cmp    $0xe0000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @sh4_addr_in_sq_area(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -67108864
%5 = icmp eq i32 %4, -536870912
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sh4_addr_in_sq_area(i32 %0) {
%2 = and i32 %0, -67108864
%3 = icmp eq i32 %2, -536870912
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void timefunc(int value) {
  if (value != 1) {
    printf("FAIL: test14\n");
    exit(1);
  }
  printf("PASS: test14\n");
  exit(0);
}


x86 assembly (clang, -O0):
<timefunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     114b <timefunc+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<timefunc>:
push   %rax
cmp    $0x1,%edi
jne    1139 <timefunc+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"FAIL: test14\0A\00"
@.str.1 = [14 x i8] c"PASS: test14\0A\00"
define void @timefunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"PASS: test14\00"
@str.2 = [13 x i8] c"FAIL: test14\00"
define void @timefunc(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
int warning(const char *msg) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @warning(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ UpdaterLogToFileEx(int, char *);
void UpdaterLogToFile(char *file) { UpdaterLogToFileEx((1), file); }


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

x86 assembly (clang, -O2):
<UpdaterLogToFile>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <UpdaterLogToFileEx@plt>

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

LLVM IR (-O2):
define void @UpdaterLogToFile(i8* %0) {
%2 = tail call i32 @UpdaterLogToFileEx(i32 1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CPIR(int, int, int);
void op_ED_0xb1(void) {
  CPIR(12, 17, 4);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0xb1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x4,%edx
call   1030 <CPIR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0xb1>:
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x4,%edx
jmp    1030 <CPIR@plt>

LLVM IR (-O0):
define void @op_ED_0xb1() {
%1 = call i32 @CPIR(i32 12, i32 17, i32 4)
ret void
}

LLVM IR (-O2):
define void @op_ED_0xb1() {
%1 = tail call i32 @CPIR(i32 12, i32 17, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putcar(int /*<<< orphan*/);
void print(char *str) {
  char const *ptr = str;
  while (*ptr) {
    putcar(*ptr++);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <print+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <putcar@plt>
jmp    1124 <print+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putcar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 @putcar(i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putcar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PathActionHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void PathActionUpdated() { UAVObjUpdated(PathActionHandle()); }


x86 assembly (clang, -O0):
<PathActionUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PathActionHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathActionUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <PathActionHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @PathActionUpdated() {
%1 = call i32 (...) @PathActionHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathActionUpdated() {
%1 = tail call i32 (...) @PathActionHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
struct eloop {
  int dummy;
};

/* Variables and functions */
int eloop_q_timeout_add(struct eloop *, int, unsigned int, int /*<<< orphan*/,
                        void (*)(void *), void *);
int eloop_q_timeout_add_sec(struct eloop *eloop, int queue,
                            unsigned int seconds, void (*callback)(void *),
                            void *arg) {
  return eloop_q_timeout_add(eloop, queue, seconds, 0, callback, arg);
}


x86 assembly (clang, -O0):
<eloop_q_timeout_add_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %ecx,%ecx
call   1030 <eloop_q_timeout_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eloop_q_timeout_add_sec>:
mov    %r8,%r9
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <eloop_q_timeout_add@plt>

LLVM IR (-O0):
%struct.eloop = type { i32 }
define i32 @eloop_q_timeout_add_sec(%struct.eloop* %0, i32 %1, i32 %2, void (i8*)* %3, i8* %4) {
%6 = alloca %struct.eloop*
%7 = alloca i32
%8 = alloca i32
%9 = alloca void (i8*)*
%10 = alloca i8*
store %struct.eloop* %0, %struct.eloop** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store void (i8*)* %3, void (i8*)** %9
store i8* %4, i8** %10
%11 = load %struct.eloop*, %struct.eloop** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load void (i8*)*, void (i8*)** %9
%15 = load i8*, i8** %10
%16 = call i32 @eloop_q_timeout_add(%struct.eloop* %11, i32 %12, i32 %13, i32 0, void (i8*)* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.eloop = type { i32 }
define i32 @eloop_q_timeout_add_sec(%struct.eloop* %0, i32 %1, i32 %2, void (i8*)* %3, i8* %4) {
%6 = tail call i32 @eloop_q_timeout_add(%struct.eloop* %0, i32 %1, i32 %2, i32 0, void (i8*)* %3, i8* %4)
ret i32 %6
}
/* Type definitions */
struct Chabu_ByteBuffer_Data {
  int dummy;
};

/* Variables and functions */
int Chabu_ByteBuffer_xferWithMax(struct Chabu_ByteBuffer_Data *,
                                 struct Chabu_ByteBuffer_Data *,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ INT_MAX;
int Chabu_ByteBuffer_xferAllPossible(struct Chabu_ByteBuffer_Data *trg,
                                     struct Chabu_ByteBuffer_Data *src) {
  return Chabu_ByteBuffer_xferWithMax(trg, src, INT_MAX);
}


x86 assembly (clang, -O0):
<Chabu_ByteBuffer_xferAllPossible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
call   1030 <Chabu_ByteBuffer_xferWithMax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Chabu_ByteBuffer_xferAllPossible>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <Chabu_ByteBuffer_xferWithMax@plt>

LLVM IR (-O0):
%struct.Chabu_ByteBuffer_Data = type { i32 }
@INT_MAX = global i32 0
define i32 @Chabu_ByteBuffer_xferAllPossible(%struct.Chabu_ByteBuffer_Data* %0, %struct.Chabu_ByteBuffer_Data* %1) {
%3 = alloca %struct.Chabu_ByteBuffer_Data*
%4 = alloca %struct.Chabu_ByteBuffer_Data*
store %struct.Chabu_ByteBuffer_Data* %0, %struct.Chabu_ByteBuffer_Data** %3
store %struct.Chabu_ByteBuffer_Data* %1, %struct.Chabu_ByteBuffer_Data** %4
%5 = load %struct.Chabu_ByteBuffer_Data*, %struct.Chabu_ByteBuffer_Data** %3
%6 = load %struct.Chabu_ByteBuffer_Data*, %struct.Chabu_ByteBuffer_Data** %4
%7 = load i32, i32* @INT_MAX
%8 = call i32 @Chabu_ByteBuffer_xferWithMax(%struct.Chabu_ByteBuffer_Data* %5, %struct.Chabu_ByteBuffer_Data* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.Chabu_ByteBuffer_Data = type { i32 }
@INT_MAX = global i32 0
define i32 @Chabu_ByteBuffer_xferAllPossible(%struct.Chabu_ByteBuffer_Data* %0, %struct.Chabu_ByteBuffer_Data* %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i32 @Chabu_ByteBuffer_xferWithMax(%struct.Chabu_ByteBuffer_Data* %0, %struct.Chabu_ByteBuffer_Data* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void read_into_array(int arr[], int size) {
  for (int i = 0; i < size; i++) {
    scanf("%d", &arr[i]);
  }
}


x86 assembly (clang, -O0):
<read_into_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <read_into_array+0x4b>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <read_into_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_into_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <read_into_array+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <read_into_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read_into_array(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_repeat_alpha(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    ft_putchar('\n');
    return (0);
  }
  ft_repeat_alpha(argv[1]);
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1156 <main+0x36>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
jmp    1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ft_repeat_alpha@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1030 <ft_repeat_alpha@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @ft_putchar(i8 signext 10)
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @ft_repeat_alpha(i8* %13)
%15 = call i32 @ft_putchar(i8 signext 10)
store i32 0, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_repeat_alpha(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
#define EACCES 131
#define EINVAL 130
#define EPERM 129
#define ERANGE 128
int errno;
void assignSemInitializeError() {
  switch (errno) {
  case EACCES:
    errno = EPERM;
    break;
  case EINVAL:
    break;
  case EPERM:
    break;
  case ERANGE:
    errno = EINVAL;
    break;
  }
}


x86 assembly (clang, -O0):
<assignSemInitializeError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x8(%rbp)
sub    $0x3,%eax
ja     115c <assignSemInitializeError+0x5c>
mov    -0x8(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2ea6(%rip),%rax
movl   $0x81,(%rax)
jmp    115c <assignSemInitializeError+0x5c>
jmp    115c <assignSemInitializeError+0x5c>
jmp    115c <assignSemInitializeError+0x5c>
mov    0x2e8a(%rip),%rax
movl   $0x82,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignSemInitializeError>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
cmp    $0x83,%ecx
je     1120 <assignSemInitializeError+0x20>
cmp    $0x80,%ecx
jne    1127 <assignSemInitializeError+0x27>
mov    $0x82,%ecx
jmp    1125 <assignSemInitializeError+0x25>
mov    $0x81,%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
@errno = global i32 0
define void @assignSemInitializeError() {
%1 = load i32, i32* @errno
switch i32 %1, label %6 [
i32 131, label %2
i32 130, label %3
i32 129, label %4
i32 128, label %5
]
2: ; preds = %0
store i32 129, i32* @errno
br label %6
3: ; preds = %0
br label %6
4: ; preds = %0
br label %6
5: ; preds = %0
store i32 130, i32* @errno
br label %6
6: ; preds = %0, %5, %4, %3, %2
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @assignSemInitializeError() {
%1 = load i32, i32* @errno
switch i32 %1, label %5 [
i32 131, label %3
i32 128, label %2
]
2: ; preds = %0
br label %3
3: ; preds = %0, %2
%4 = phi i32 [ 130, %2 ], [ 129, %0 ]
store i32 %4, i32* @errno
br label %5
5: ; preds = %3, %0
ret void
}
int valid_key_length(int key_length_in_bits) {
  if (key_length_in_bits == 128)
    return 1;
  else if (key_length_in_bits == 192)
    return 1;
  else if (key_length_in_bits == 256)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<valid_key_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jne    1120 <valid_key_length+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1159 <valid_key_length+0x59>
cmpl   $0xc0,-0x8(%rbp)
jne    1139 <valid_key_length+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1159 <valid_key_length+0x59>
cmpl   $0x100,-0x8(%rbp)
jne    1152 <valid_key_length+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <valid_key_length+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_key_length>:
mov    $0x1,%eax
cmp    $0x80,%edi
je     111f <valid_key_length+0x1f>
cmp    $0xc0,%edi
je     111f <valid_key_length+0x1f>
cmp    $0x100,%edi
je     111f <valid_key_length+0x1f>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @valid_key_length(i32 %0) {
switch i32 %0, label %2 [
i32 128, label %3
i32 192, label %3
i32 256, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t htons(uint16_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @htons(i32 returned %0) {
ret i32 %0
}
char lastcharofstring(char *string) {
  int x;
  for (x = 0; string[x] != 0; x++)
    ;
  if (x > 0)
    return (string[x - 1]);
  return (0);
}


x86 assembly (clang, -O0):
<lastcharofstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <lastcharofstring+0x37>
jmp    1129 <lastcharofstring+0x29>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <lastcharofstring+0xf>
cmpl   $0x0,-0x14(%rbp)
jle    1159 <lastcharofstring+0x59>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    115d <lastcharofstring+0x5d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastcharofstring>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <lastcharofstring+0x10>
cmp    $0x1,%eax
jne    1122 <lastcharofstring+0x22>
xor    %eax,%eax
ret
add    $0xfffffffe,%eax
mov    (%rdi,%rax,1),%al
ret

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

LLVM IR (-O2):
define signext i8 @lastcharofstring(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = add i64 %3, 4294967295
%13 = and i64 %12, 4294967295
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
br label %16
16: ; preds = %8, %11
%17 = phi i8 [ %15, %11 ], [ 0, %8 ]
ret i8 %17
}
char *prevSlash(char *ptr) {
  for (ptr -= 2; *ptr != '/'; ptr--)
    ;
  return ptr + 1;
}


x86 assembly (clang, -O0):
<prevSlash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     113a <prevSlash+0x3a>
jmp    1129 <prevSlash+0x29>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <prevSlash+0x14>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prevSlash>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x2f,-0x2(%rax)
lea    -0x1(%rax),%rax
jne    1110 <prevSlash+0x10>
ret

LLVM IR (-O0):
define i8* @prevSlash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -2
store i8* %4, i8** %2
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 47
br i1 %9, label %10, label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 -1
store i8* %13, i8** %2
br label %5
14: ; preds = %5
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
ret i8* %16
}

LLVM IR (-O2):
define i8* @prevSlash(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -2
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ %2, %1 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 47
%7 = getelementptr inbounds i8, i8* %4, i64 -1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %9
}
/* Variables and functions */
bool nrf53_errata_50(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_50() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_something_bad();
int /*<<< orphan*/ test_something_good();
int main(int argc, const char **argv) {
  test_something_bad();
  test_something_good();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_something_bad@plt>
xor    %eax,%eax
call   1030 <test_something_good@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_something_bad()
%4 = tail call i32 (...) @test_something_good()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ usb_init();
void board_init(void) {
  uart_init();
  usb_init();
}


x86 assembly (clang, -O0):
<board_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart_init@plt>
mov    $0x0,%al
call   1040 <usb_init@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @board_init() {
%1 = call i32 (...) @uart_init()
%2 = call i32 (...) @usb_init()
ret void
}

LLVM IR (-O2):
define void @board_init() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 (...) @usb_init()
ret void
}
void swap() { static void *w; }


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

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

LLVM IR (-O0):
@swap.w = internal global i8* null
define void @swap() {
ret void
}

LLVM IR (-O2):
define void @swap() {
ret void
}
void do_math(int *x) {
  printf("%s: X before: %d\n", __func__, *x);
  *x += 5;
  printf("%s: X after: %d\n", __func__, *x);
}


x86 assembly (clang, -O0):
<do_math>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x5,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xecb(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_math>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edx
lea    0xee0(%rip),%rdi
lea    0xeeb(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%edx
add    $0x5,%edx
mov    %edx,(%rbx)
lea    0xedb(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s: X before: %d\0A\00"
@__func__.do_math = [8 x i8] c"do_math\00"
@.str.1 = [17 x i8] c"%s: X after: %d\0A\00"
define void @do_math(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.do_math, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 5
store i32 %8, i32* %6
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.do_math, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s: X before: %d\0A\00"
@__func__.do_math = [8 x i8] c"do_math\00"
@.str.1 = [17 x i8] c"%s: X after: %d\0A\00"
define void @do_math(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.do_math, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 5
store i32 %5, i32* %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.do_math, i64 0, i64 0), i32 %5)
ret void
}
int inet_aton(const char *cp, struct in_addr *inp) {}


x86 assembly (clang, -O0):
<inet_aton>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.in_addr = type opaque
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.in_addr*
store i8* %0, i8** %4
store %struct.in_addr* %1, %struct.in_addr** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.in_addr = type opaque
define i32 @inet_aton(i8* nocapture readnone %0, %struct.in_addr* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ num_primo(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int num;
  printf("Introduzaca un numero: ");
  scanf("%d", &num);
  num_primo(num);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <num_primo@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <num_primo@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Introduzaca un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @num_primo(i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"Introduzaca un numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @num_primo(i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char const *, int, int, int /*<<< orphan*/ *);
int stub1(unsigned char const *, int, int, int /*<<< orphan*/ *);
int fputc(int chr, FILE *stream) {
  const unsigned char c = (unsigned char)chr;
  return (*fwrite)(&c, 1, 1, stream);
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rax
mov    %rsi,%rcx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fputc(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32*, i32** %4
%9 = call i32 @fwrite(i8* %5, i32 1, i32 1, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 @fwrite(i8* %3, i32 1, i32 1, i32* %1)
ret i32 %5
}
/* Type definitions */
struct ms {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DPRINTF(char *);
void ms_adb_init(struct ms *self) { DPRINTF("ADB init\n"); }


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

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

LLVM IR (-O0):
%struct.ms = type { i32 }
@.str = [10 x i8] c"ADB init\0A\00"
define void @ms_adb_init(%struct.ms* %0) {
%2 = alloca %struct.ms*
store %struct.ms* %0, %struct.ms** %2
%3 = call i32 @DPRINTF(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ms = type { i32 }
@.str = [10 x i8] c"ADB init\0A\00"
define void @ms_adb_init(%struct.ms* nocapture readnone %0) {
%2 = tail call i32 @DPRINTF(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}