xunge/DecIR huggingface dataset:
void ap9x_pci_setup_wmac_led_pin(unsigned wmac, int pin) {}


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

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

LLVM IR (-O0):
define void @ap9x_pci_setup_wmac_led_pin(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 @ap9x_pci_setup_wmac_led_pin(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_SetPlayMode(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *);
void UPnPAVTransport_SetPlayMode(void *upnptoken, unsigned int InstanceID,
                                 char *NewPlayMode) {
  printf("Invoke: UPnPAVTransport_SetPlayMode(%u,%s);\r\n", InstanceID,
         NewPlayMode);
  UPnPResponse_AVTransport_SetPlayMode(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPAVTransport_SetPlayMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_AVTransport_SetPlayMode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_SetPlayMode>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_AVTransport_SetPlayMode@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Invoke: UPnPAVTransport_SetPlayMode(%u,%s);\0D\0A\00"
define void @UPnPAVTransport_SetPlayMode(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_AVTransport_SetPlayMode(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Invoke: UPnPAVTransport_SetPlayMode(%u,%s);\0D\0A\00"
define void @UPnPAVTransport_SetPlayMode(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
%5 = tail call i32 @UPnPResponse_AVTransport_SetPlayMode(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Hello() { printf("Hello World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @Hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void __clk_put(struct clk *clk) {}


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

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define void @__clk_put(%struct.clk* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_hex_actual(void *, int, int /*<<< orphan*/);
void dump_hex(void *pp, int len) { dump_hex_actual(pp, len, 0); }


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

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

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

LLVM IR (-O2):
define void @dump_hex(i8* %0, i32 %1) {
%3 = tail call i32 @dump_hex_actual(i8* %0, i32 %1, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ parityb(int);
uint32_t parity(int x) {
  x ^= (x >> 16);
  x ^= (x >> 8);
  return parityb(x);
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <parityb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %eax,%edi
mov    %edi,%eax
sar    $0x8,%eax
xor    %eax,%edi
jmp    1030 <parityb@plt>

LLVM IR (-O0):
define i32 @parity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @parityb(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 8
%5 = xor i32 %4, %3
%6 = tail call i32 @parityb(i32 %5)
ret i32 %6
}
char *strcat(char *dst, const char *src) {
  char *cp = dst;
  while (*cp)
    cp++;
  while ((*cp++ = *src++))
    ;
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int toint(char);
int individual_credential_issue(char fascn[40]) {
  int temp;
  temp = toint(fascn[20]);
  return (temp);
}


x86 assembly (clang, -O0):
<individual_credential_issue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x14(%rax),%edi
call   1030 <toint@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<individual_credential_issue>:
movsbl 0x14(%rdi),%edi
jmp    1030 <toint@plt>

LLVM IR (-O0):
define i32 @individual_credential_issue(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 20
%6 = load i8, i8* %5
%7 = call i32 @toint(i8 signext %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @individual_credential_issue(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 20
%3 = load i8, i8* %2
%4 = tail call i32 @toint(i8 signext %3)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int parityb(int);
int parity(uint32_t x) {
  x ^= (x >> 16);
  x ^= (x >> 8);
  return parityb(x);
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <parityb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %eax,%edi
mov    %edi,%eax
sar    $0x8,%eax
xor    %eax,%edi
jmp    1030 <parityb@plt>

LLVM IR (-O0):
define i32 @parity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @parityb(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = ashr i32 %3, 8
%5 = xor i32 %4, %3
%6 = tail call i32 @parityb(i32 %5)
ret i32 %6
}
f() { return 0xfffffffffffffff; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @f() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
void tearDown() {
  clear();
  endwin();
}


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

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

LLVM IR (-O0):
define void @tearDown() {
%1 = call i32 (...) @clear()
%2 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @tearDown() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @endwin()
ret void
}
int sumRange(int start, int end) {
  int i;
  int sum;
  sum = 0;
  for (i = start; i < end; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sumRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113a <sumRange+0x3a>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <sumRange+0x17>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumRange>:
xor    %eax,%eax
cmp    %esi,%edi
jge    1122 <sumRange+0x22>
mov    %edi,%ecx
not    %ecx
add    %esi,%ecx
lea    0x1(%rdi),%eax
imul   %ecx,%eax
sub    %edi,%esi
add    $0xfffffffe,%esi
imul   %rcx,%rsi
shr    %rsi
add    %edi,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @sumRange(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = xor i32 %0, -1
%6 = add i32 %5, %1
%7 = add nsw i32 %0, 1
%8 = mul i32 %6, %7
%9 = zext i32 %6 to i33
%10 = add i32 %1, -2
%11 = sub i32 %10, %0
%12 = zext i32 %11 to i33
%13 = mul i33 %9, %12
%14 = lshr i33 %13, 1
%15 = trunc i33 %14 to i32
%16 = add i32 %8, %0
%17 = add i32 %16, %15
br label %18
18: ; preds = %4, %2
%19 = phi i32 [ 0, %2 ], [ %17, %4 ]
ret i32 %19
}
/* Variables and functions */
char *strcpy(char *, char const *);
int strlen(char const *);
scalar_t__ xmalloc(int);
char *str_copy(const char *s) {
  char *copy = (char *)xmalloc(sizeof(char) * (strlen(s) + 1));
  return strcpy(copy, s);
}


x86 assembly (clang, -O0):
<str_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <xmalloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @str_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @xmalloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i8* @strcpy(i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @str_copy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @xmalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}
int util_endswith(char *source, char *postfix) {
  return strlen(source) > strlen(postfix)
             ? (strcmp((char *)(source + strlen(source) - strlen(postfix)),
                       postfix) == 0)
             : 0;
}


x86 assembly (clang, -O0):
<util_endswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jbe    11a9 <util_endswith+0x89>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b3 <util_endswith+0x93>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b3 <util_endswith+0x93>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_endswith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%r15
jbe    115f <util_endswith+0x3f>
add    %r15,%rbx
sub    %rcx,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @util_endswith(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 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = icmp ugt i64 %6, %8
br i1 %9, label %10, label %23
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8*, i8** %4
%16 = call i64 @strlen(i8* %15)
%17 = sub i64 0, %16
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8*, i8** %4
%20 = call i32 @strcmp(i8* %18, i8* %19)
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
br label %24
23: ; preds = %2
br label %24
24: ; preds = %23, %10
%25 = phi i32 [ %22, %10 ], [ 0, %23 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @util_endswith(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ugt i64 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
%8 = sub i64 0, %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = tail call i32 @strcmp(i8* %9, i8* dereferenceable(1) %1)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %6
%14 = phi i32 [ %12, %6 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
float funPrintInt(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void funCalculateArea(void) {
  float k;
  float fArea;
  printf("enter k ");
  scanf("%f", &k);
  fArea = funPrintInt(k);
  printf("area = %f", fArea);
}


x86 assembly (clang, -O0):
<funCalculateArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
call   1030 <funPrintInt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funCalculateArea>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1030 <funPrintInt@plt>
cvtss2sd %xmm0,%xmm0
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"enter k \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"area = %f\00"
define void @funCalculateArea() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 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), float* %1)
%5 = load float, float* %1
%6 = call float @funPrintInt(float %5)
store float %6, float* %2
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"enter k \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"area = %f\00"
define void @funCalculateArea() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 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), float* %1)
%5 = load float, float* %1
%6 = call float @funPrintInt(float %5)
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %7)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int current_time();
scalar_t__ difftime(int, int);
int /*<<< orphan*/ gmtime(int *);
int mktime(int /*<<< orphan*/);
signed int get_tz_offset(void) {
  time_t now = current_time();
  time_t later = mktime(gmtime(&now));
  if (later == -1) {
    return 0;
  } else {
    return (signed int)difftime(now, later);
  }
}


x86 assembly (clang, -O0):
<get_tz_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <current_time@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %eax,%edi
call   1050 <mktime@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    117b <get_tz_offset+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1189 <get_tz_offset+0x49>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <difftime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tz_offset>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <current_time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1060 <gmtime@plt>
mov    %eax,%edi
call   1050 <mktime@plt>
cmp    $0xffffffff,%eax
je     1176 <get_tz_offset+0x36>
mov    0xc(%rsp),%edi
mov    %eax,%esi
call   1030 <difftime@plt>
mov    %rax,%rbx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_tz_offset() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @current_time()
store i32 %4, i32* %2
%5 = call i32 @gmtime(i32* %2)
%6 = call i32 @mktime(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %15
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i64 @difftime(i32 %11, i32 %12)
%14 = trunc i64 %13 to i32
store i32 %14, i32* %1
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_tz_offset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @current_time()
store i32 %3, i32* %1
%4 = call i32 @gmtime(i32* %1)
%5 = call i32 @mktime(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i64 @difftime(i32 %8, i32 %5)
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %0, %7
%12 = phi i32 [ %10, %7 ], [ 0, %0 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, size_t);
int strlen(char const *);
unsigned char *cJSONUtils_strdup(const unsigned char *str) {
  size_t len = 0;
  unsigned char *copy = NULL;
  len = strlen((const char *)str) + 1;
  if (!(copy = (unsigned char *)malloc(len))) {
    return NULL;
  }
  memcpy(copy, str, len);
  return copy;
}


x86 assembly (clang, -O0):
<cJSONUtils_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1182 <cJSONUtils_strdup+0x52>
movq   $0x0,-0x8(%rbp)
jmp    119b <cJSONUtils_strdup+0x6b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSONUtils_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1163 <cJSONUtils_strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <cJSONUtils_strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @cJSONUtils_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 0, i64* %4
store i8* null, i8** %5
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %1
store i8* null, i8** %2
br label %21
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = load i64, i64* %4
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %5
store i8* %20, i8** %2
br label %21
21: ; preds = %15, %14
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @cJSONUtils_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
int compare_int_ptr(const void *v_int1, const void *v_int2) {
  int *int1 = (int *)v_int1;
  int *int2 = (int *)v_int2;
  return (*int1 - *int2);
}


x86 assembly (clang, -O0):
<compare_int_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int_ptr>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_int_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_int_ptr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
int test_imm_FAuint16_reg(unsigned short val) {
  return ((val) & (-0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff06,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FAuint16_reg>:
test   $0xff06,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -250
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int unpackInt16(const uint8_t *buffer) { return buffer[0] | buffer[1] << 8; }


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

x86 assembly (clang, -O2):
<unpackInt16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @unpackInt16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @unpackInt16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  unsigned int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void fly_thread_sleep(unsigned int nanosec) {
  struct timespec delay;
  delay.tv_sec = nanosec / 1000000000;
  delay.tv_nsec = nanosec % 1000000000;
  nanosleep(&delay, NULL);
}


x86 assembly (clang, -O0):
<fly_thread_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fly_thread_sleep>:
push   %rax
mov    %edi,%eax
shr    $0x9,%eax
imul   $0x44b83,%rax,%rax
shr    $0x27,%rax
mov    %eax,(%rsp)
imul   $0x3b9aca00,%eax,%eax
sub    %eax,%edi
mov    %edi,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @fly_thread_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @fly_thread_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = udiv i32 %0, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void memcpy_ident64(void *dst, const void *src, size_t n) {
  memcpy(dst, src, 8 * n);
}


x86 assembly (clang, -O0):
<memcpy_ident64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_ident64>:
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @memcpy_ident64(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = mul i64 8, %9
%11 = trunc i64 %10 to i32
%12 = call i32 @memcpy(i8* %7, i8* %8, i32 %11)
ret void
}

LLVM IR (-O2):
define void @memcpy_ident64(i8* %0, i8* %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = shl i32 %4, 3
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %5)
ret void
}
/* Variables and functions */
double __ocml_exp2_f64(double);
double exp2(double x) { return __ocml_exp2_f64(x); }


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

x86 assembly (clang, -O2):
<exp2>:
jmp    1030 <__ocml_exp2_f64@plt>

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

LLVM IR (-O2):
define double @exp2(double %0) {
%2 = tail call double @__ocml_exp2_f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void print_footer_common(void *priv) { free(priv); }


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

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

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

LLVM IR (-O2):
define void @print_footer_common(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x70() {
  Assert_real((isodigit(112) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              565, ("isodigit should be 0 for p"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x70>:
push   %rax
mov    $0x70,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x235,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for p\00"
define void @t_isodigit_0x70() {
%1 = tail call i64 @isodigit(i32 112)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 565, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fn8(int a, int b) {
  int tem1 = b | a;
  int tem2 = b & a;
  return tem1 + tem2;
}


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @fn8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void printField(i) int i;
{
  if (i == -1) {
    printf("        ");
  } else {
    printf("%-8d", i);
  }
}


x86 assembly (clang, -O0):
<printField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1138 <printField+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1149 <printField+0x39>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printField>:
cmp    $0xffffffff,%edi
je     1125 <printField+0x15>
mov    %edi,%esi
lea    0xeeb(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c" \00"
@.str.1 = [5 x i8] c"%-8d\00"
define void @printField(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
void pic_init() {
  outportb(0x20, 0x10 | 0x00);
  outportb(0xA0, 0x10 | 0x00);
  outportb(0x21, 32);
  outportb(0xA1, 40);
  outportb(0x21, 4);
  outportb(0xA1, 2);
  outportb(0x21, 0x1);
  outportb(0xA1, 0x1);
  outportb(0x21, 0xfc);
  outportb(0xa1, 0xff);
}


x86 assembly (clang, -O0):
<pic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x10,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x10,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0xfc,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outportb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_init>:
push   %rax
mov    $0x20,%edi
mov    $0x10,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x10,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0xfc,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @pic_init() {
%1 = call i32 @outportb(i32 32, i32 16)
%2 = call i32 @outportb(i32 160, i32 16)
%3 = call i32 @outportb(i32 33, i32 32)
%4 = call i32 @outportb(i32 161, i32 40)
%5 = call i32 @outportb(i32 33, i32 4)
%6 = call i32 @outportb(i32 161, i32 2)
%7 = call i32 @outportb(i32 33, i32 1)
%8 = call i32 @outportb(i32 161, i32 1)
%9 = call i32 @outportb(i32 33, i32 252)
%10 = call i32 @outportb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @pic_init() {
%1 = tail call i32 @outportb(i32 32, i32 16)
%2 = tail call i32 @outportb(i32 160, i32 16)
%3 = tail call i32 @outportb(i32 33, i32 32)
%4 = tail call i32 @outportb(i32 161, i32 40)
%5 = tail call i32 @outportb(i32 33, i32 4)
%6 = tail call i32 @outportb(i32 161, i32 2)
%7 = tail call i32 @outportb(i32 33, i32 1)
%8 = tail call i32 @outportb(i32 161, i32 1)
%9 = tail call i32 @outportb(i32 33, i32 252)
%10 = tail call i32 @outportb(i32 161, i32 255)
ret void
}
void main2(void) {}


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

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

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

LLVM IR (-O2):
define void @main2() {
ret void
}
int execute_sigpending() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_sigpending() {
ret i32 0
}
falGetFontProperty() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @falGetFontProperty() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ x;

/* Variables and functions */
scalar_t__ is_little_endian();
int convert_to_little_endian(int x) {
  if (is_little_endian())
    return x;
  else
    return ((
        unsigned int)((((unsigned int)(x) & (unsigned int)0x000000ffU) << 24) |
                      (((unsigned int)(x) & (unsigned int)0x0000ff00U) << 8) |
                      (((unsigned int)(x) & (unsigned int)0x00ff0000U) >> 8) |
                      (((unsigned int)(x) & (unsigned int)0xff000000U) >> 24)));
}


x86 assembly (clang, -O0):
<convert_to_little_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <is_little_endian@plt>
cmp    $0x0,%rax
je     1137 <convert_to_little_endian+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <convert_to_little_endian+0x5f>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_little_endian>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <is_little_endian@plt>
test   %rax,%rax
mov    %ebx,%eax
bswap  %eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @convert_to_little_endian(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @is_little_endian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %24
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 255
%11 = shl i32 %10, 24
%12 = load i32, i32* %3
%13 = and i32 %12, 65280
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 16711680
%18 = lshr i32 %17, 8
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = and i32 %20, -16777216
%22 = lshr i32 %21, 24
%23 = or i32 %19, %22
store i32 %23, i32* %2
br label %24
24: ; preds = %8, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @convert_to_little_endian(i32 %0) {
%2 = tail call i64 (...) @is_little_endian()
%3 = icmp eq i64 %2, 0
%4 = tail call i32 @llvm.bswap.i32(i32 %0)
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int fibo(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Informe o número: ");
  scanf("%d", &num);
  printf("O resultdo é %d\n", fibo(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <fibo@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"Informe o n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"O resultdo \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 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), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @fibo(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Informe o n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"O resultdo \C3\A9 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fibo(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int foo(int v __attribute__((annotate("param_ann_0")))
        __attribute__((annotate("param_ann_1")))) {
  return v + 1;
}


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

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"param_ann_0\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp0pqs5z91/formatted_code.c\00", section "llvm.metadata"
@.str.2 = [12 x i8] c"param_ann_1\00", section "llvm.metadata"
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
@.str = [12 x i8] c"param_ann_0\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp0pqs5z91/formatted_code.c\00", section "llvm.metadata"
@.str.2 = [12 x i8] c"param_ann_1\00", section "llvm.metadata"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add nsw i32 %0, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lirerr(int);
void compress_rawdat_net(void) { lirerr(999995); }


x86 assembly (clang, -O0):
<compress_rawdat_net>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf423b,%edi
call   1030 <lirerr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<compress_rawdat_net>:
mov    $0xf423b,%edi
jmp    1030 <lirerr@plt>

LLVM IR (-O0):
define void @compress_rawdat_net() {
%1 = call i32 @lirerr(i32 999995)
ret void
}

LLVM IR (-O2):
define void @compress_rawdat_net() {
%1 = tail call i32 @lirerr(i32 999995)
ret void
}