xunge/DecIR huggingface dataset:
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
scalar_t__ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, struct winsize *);
int t_getwidth() {
  struct winsize ts;
  if (ioctl(0, TIOCGWINSZ, &ts)) {
    return -1;
  }
  return ts.ws_col;
}


x86 assembly (clang, -O0):
<t_getwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1142 <t_getwidth+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <t_getwidth+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getwidth>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <ioctl@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @t_getwidth() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i64 @ioctl(i32 0, i32 %3, %struct.winsize* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %10
7: ; preds = %0
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @t_getwidth() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i64 @ioctl(i32 0, i32 %3, %struct.winsize* %1)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Type definitions */
struct terminal_session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int terminal_stark_test_ha_grouping(struct terminal_session *session, int argc,
                                    char **argv) {
  if (argc >= 1) {
    printf("Currently unavailable\n");
    return 0;
  } else {
    printf("You have to specify minK\n");
    return -1;
  }
}


x86 assembly (clang, -O0):
<terminal_stark_test_ha_grouping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1145 <terminal_stark_test_ha_grouping+0x35>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1158 <terminal_stark_test_ha_grouping+0x48>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_stark_test_ha_grouping>:
push   %rbx
xor    %ebx,%ebx
test   %esi,%esi
setle  %bl
lea    0xefa(%rip),%rax
lea    0xeda(%rip),%rdi
cmovg  %rax,%rdi
neg    %ebx
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.terminal_session = type { i32 }
@.str = [23 x i8] c"Currently unavailable\0A\00"
@.str.1 = [26 x i8] c"You have to specify minK\0A\00"
define i32 @terminal_stark_test_ha_grouping(%struct.terminal_session* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.terminal_session*
%6 = alloca i32
%7 = alloca i8**
store %struct.terminal_session* %0, %struct.terminal_session** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %14
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %4
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
%struct.terminal_session = type { i32 }
@str = [25 x i8] c"You have to specify minK\00"
@str.2 = [22 x i8] c"Currently unavailable\00"
define i32 @terminal_stark_test_ha_grouping(%struct.terminal_session* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = sext i1 %6 to i32
%8 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
unsigned long HashTableStringHashFunction(const void *key) {
  const unsigned char *str = (const unsigned char *)key;
  unsigned long hashValue = 0;
  int i = 0;
  for (i = 0; str[i] != '\0'; i++)
    hashValue = hashValue * 37 + str[i];
  return hashValue;
}


x86 assembly (clang, -O0):
<HashTableStringHashFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <HashTableStringHashFunction+0x61>
imul   $0x25,-0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1126 <HashTableStringHashFunction+0x26>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashTableStringHashFunction>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <HashTableStringHashFunction+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%rdx
lea    (%rax,%rdx,4),%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <HashTableStringHashFunction+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @HashTableStringHashFunction(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = mul i64 %7, 37
%9 = zext i8 %6 to i64
%10 = add i64 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %16
}
/* Type definitions */
struct eh_printf_context_s {
  int dummy;
};

/* Variables and functions */
size_t eh_sys_output_str(struct eh_printf_context_s *, char *, int);
size_t eh_sys_output_char(struct eh_printf_context_s *ctx, char c) {
  return eh_sys_output_str(ctx, &c, 1);
}


x86 assembly (clang, -O0):
<eh_sys_output_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <eh_sys_output_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eh_sys_output_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <eh_sys_output_str@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.eh_printf_context_s = type { i32 }
define i64 @eh_sys_output_char(%struct.eh_printf_context_s* %0, i8 signext %1) {
%3 = alloca %struct.eh_printf_context_s*
%4 = alloca i8
store %struct.eh_printf_context_s* %0, %struct.eh_printf_context_s** %3
store i8 %1, i8* %4
%5 = load %struct.eh_printf_context_s*, %struct.eh_printf_context_s** %3
%6 = call i64 @eh_sys_output_str(%struct.eh_printf_context_s* %5, i8* %4, i32 1)
ret i64 %6
}

LLVM IR (-O2):
%struct.eh_printf_context_s = type { i32 }
define i64 @eh_sys_output_char(%struct.eh_printf_context_s* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i64 @eh_sys_output_str(%struct.eh_printf_context_s* %0, i8* %3, i32 1)
ret i64 %4
}
/* Variables and functions */
scalar_t__ _login_do(char const *);
int _login(char const *user) {
  int i;
  for (i = 0; i < 3; i++)
    if (_login_do(user) != 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<_login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115f <_login+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <_login_do@plt>
cmp    $0x0,%rax
je     114c <_login+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1166 <_login+0x56>
jmp    1151 <_login+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <_login+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_login>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <_login_do@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1143 <_login+0x33>
mov    %rbx,%rdi
call   1030 <_login_do@plt>
test   %rax,%rax
jne    1143 <_login+0x33>
mov    %rbx,%rdi
call   1030 <_login_do@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_login(i8* %0) {
%2 = alloca i32
%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 i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = call i64 @_login_do(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %18
13: ; preds = %8
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
store i32 0, i32* %2
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @_login(i8* %0) {
%2 = tail call i64 @_login_do(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @_login_do(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @_login_do(i8* %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
long rol(long trg, int shift) {
  __asm__("rolq %%cl, %[trg]" : [trg] "+r"(trg) : "c"(shift));
  return trg;
}


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

x86 assembly (clang, -O2):
<rol>:
mov    %esi,%ecx
mov    %rdi,%rax
rol    %cl,%rax
ret

LLVM IR (-O0):
define i64 @rol(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i64 asm "rolq %cl, $0", "=r,{cx},0,~{dirflag},~{fpsr},~{flags}"(i32 %6, i64 %5)
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @rol(i64 %0, i32 %1) {
%3 = tail call i64 asm "rolq %cl, $0", "=r,{cx},0,~{dirflag},~{fpsr},~{flags}"(i32 %1, i64 %0)
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int getpid();
int htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int *, int);
int time(int /*<<< orphan*/ *);
void update_xid(void *buffer) {
  static uint32_t xid = 0;
  uint32_t value;
  if (xid == 0)
    xid = getpid() * time(NULL);
  value = htonl(xid++);
  memcpy(buffer, &value, 4);
}


x86 assembly (clang, -O0):
<update_xid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2ef1(%rip)
jne    117a <update_xid+0x3a>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,0x2eca(%rip)
mov    0x2ec4(%rip),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,0x2eb9(%rip)
call   1040 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_xid>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ef8(%rip),%edi
test   %edi,%edi
jne    1165 <update_xid+0x25>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
imul   %ebp,%edi
lea    0x1(%rdi),%eax
mov    %eax,0x2ed6(%rip)
call   1040 <htonl@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@update_xid.xid = internal global i32 0
define void @update_xid(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @update_xid.xid
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 (...) @getpid()
%8 = call i32 @time(i32* null)
%9 = mul nsw i32 %7, %8
store i32 %9, i32* @update_xid.xid
br label %10
10: ; preds = %6, %1
%11 = load i32, i32* @update_xid.xid
%12 = add nsw i32 %11, 1
store i32 %12, i32* @update_xid.xid
%13 = call i32 @htonl(i32 %11)
store i32 %13, i32* %3
%14 = load i8*, i8** %2
%15 = call i32 @memcpy(i8* %14, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@update_xid.xid = internal unnamed_addr global i32 0
define void @update_xid(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @update_xid.xid
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 @time(i32* null)
%9 = mul nsw i32 %8, %7
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ %9, %6 ], [ %4, %1 ]
%12 = add nsw i32 %11, 1
store i32 %12, i32* @update_xid.xid
%13 = tail call i32 @htonl(i32 %11)
store i32 %13, i32* %2
%14 = call i32 @memcpy(i8* %0, i32* %2, i32 4)
ret void
}
/* Type definitions */
struct sync_file_info {
  int num_fences;
};

/* Variables and functions */
struct sync_file_info *sync_file_info(int);
int /*<<< orphan*/ sync_file_info_free(struct sync_file_info *);
int sync_fence_size(int fd) {
  int count;
  struct sync_file_info *info = sync_file_info(fd);
  if (!info)
    return 0;
  count = info->num_fences;
  sync_file_info_free(info);
  return count;
}


x86 assembly (clang, -O0):
<sync_fence_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <sync_file_info@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114e <sync_fence_size+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1166 <sync_fence_size+0x46>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <sync_file_info_free@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_fence_size>:
push   %rbx
call   1040 <sync_file_info@plt>
test   %rax,%rax
je     1137 <sync_fence_size+0x17>
mov    (%rax),%ebx
mov    %rax,%rdi
call   1030 <sync_file_info_free@plt>
jmp    1139 <sync_fence_size+0x19>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sync_file_info = type { i32 }
define i32 @sync_fence_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sync_file_info*
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call %struct.sync_file_info* @sync_file_info(i32 %6)
store %struct.sync_file_info* %7, %struct.sync_file_info** %5
%8 = load %struct.sync_file_info*, %struct.sync_file_info** %5
%9 = icmp ne %struct.sync_file_info* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 0, i32* %2
br label %18
11: ; preds = %1
%12 = load %struct.sync_file_info*, %struct.sync_file_info** %5
%13 = getelementptr inbounds %struct.sync_file_info, %struct.sync_file_info* %12, i32 0, i32 0
%14 = load i32, i32* %13
store i32 %14, i32* %4
%15 = load %struct.sync_file_info*, %struct.sync_file_info** %5
%16 = call i32 @sync_file_info_free(%struct.sync_file_info* %15)
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.sync_file_info = type { i32 }
define i32 @sync_fence_size(i32 %0) {
%2 = tail call %struct.sync_file_info* @sync_file_info(i32 %0)
%3 = icmp eq %struct.sync_file_info* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.sync_file_info, %struct.sync_file_info* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @sync_file_info_free(%struct.sync_file_info* %2)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %9
}
void b43_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @b43_debugfs_init() {
ret void
}
void XSharpTextExtentsXft(void *dpy, void *fontSet, const char *str,
                          void *overall_ink_return,
                          void *overall_logical_return) {}


x86 assembly (clang, -O0):
<XSharpTextExtentsXft>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @XSharpTextExtentsXft(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @XSharpTextExtentsXft(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4) {
ret void
}
float squared(float a) { return a * a; }


x86 assembly (clang, -O0):
<squared>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<squared>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @squared(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @squared(float %0) {
%2 = fmul float %0, %0
ret float %2
}
int __svgalib_laguna_inatt(int index) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__svgalib_laguna_inatt(i32 %0) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void strconcatchar(char cadena[], int ch) {
  if (cadena != NULL) {
    int tam = strlen(cadena);
    *(cadena + tam) = ch;
    *(cadena + tam + 1) = 0;
  }
}


x86 assembly (clang, -O0):
<strconcatchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <strconcatchar+0x43>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,0x1(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strconcatchar>:
test   %rdi,%rdi
je     1133 <strconcatchar+0x23>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @strconcatchar(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = trunc i32 %1 to i8
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %9
br label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int, int);
int foo1(int, int);
int foo2(int, double);
int main() {
  if (foo(22, 23) != 45)
    abort();
  if (foo1(1, 2) != 100)
    abort();
  if (foo2(100, 1.2) != 2 * 48)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x16,%edi
mov    $0x17,%esi
call   1050 <foo@plt>
cmp    $0x2d,%eax
je     116e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1060 <foo1@plt>
cmp    $0x64,%eax
je     118d <main+0x4d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x64,%edi
movsd  0xe66(%rip),%xmm0
call   1040 <foo2@plt>
cmp    $0x60,%eax
je     11af <main+0x6f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x16,%edi
mov    $0x17,%esi
call   1050 <foo@plt>
cmp    $0x2d,%eax
jne    1184 <main+0x44>
mov    $0x1,%edi
mov    $0x2,%esi
call   1060 <foo1@plt>
cmp    $0x64,%eax
jne    1184 <main+0x44>
movsd  0xe8f(%rip),%xmm0
mov    $0x64,%edi
call   1040 <foo2@plt>
cmp    $0x60,%eax
jne    1184 <main+0x44>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 22, i32 23)
%3 = icmp ne i32 %2, 45
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @foo1(i32 1, i32 2)
%8 = icmp ne i32 %7, 100
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @foo2(i32 100, double 1.200000e+00)
%13 = icmp ne i32 %12, 96
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 22, i32 23)
%2 = icmp eq i32 %1, 45
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @foo1(i32 1, i32 2)
%7 = icmp eq i32 %6, 100
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @foo2(i32 100, double 1.200000e+00)
%12 = icmp eq i32 %11, 96
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
ret i32 0
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECSWBV(const char *the_title) { return any_decrqss(the_title, " t"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c" t\00"
define i32 @rpt_DECSWBV(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
signed long long f1(signed long long v_a, signed long long v_b) {
  signed long long v_anda = v_a & -15;
  signed long long v_andb = v_b & 14;
  signed long long v_or = v_anda | v_andb;
  return v_or;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffffff1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0xe,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
and    $0xfffffffffffffff1,%rdi
and    $0xe,%esi
lea    (%rsi,%rdi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @f1(i64 %0, i64 %1) {
%3 = and i64 %0, -15
%4 = and i64 %1, 14
%5 = or i64 %4, %3
ret i64 %5
}
int i8(int *base) { return base[00777777]; }


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

x86 assembly (clang, -O2):
<i8>:
mov    0xffffc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @i8(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 262143
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @i8(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 262143
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __die_hard();
void __attribute__((noreturn)) die(void) { __die_hard(); }


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__die_hard@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
xor    %eax,%eax
call   1030 <__die_hard@plt>

LLVM IR (-O0):
define void @die() {
%1 = call i32 (...) @__die_hard()
unreachable
}

LLVM IR (-O2):
define void @die() {
%1 = tail call i32 (...) @__die_hard()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void g_free(void *mem) {
  if (mem == NULL)
    return;
  else
    free(mem);
}


x86 assembly (clang, -O0):
<g_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <g_free+0x1c>
jmp    1135 <g_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_free>:
test   %rdi,%rdi
je     111a <g_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @g_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %5, %6
ret void
}

LLVM IR (-O2):
define void @g_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int getNbLevels();
int /*<<< orphan*/ initGame(int);
void launchLevel(int level) {
  if (level < 1 || level > getNbLevels())
    return;
  initGame(level);
}


x86 assembly (clang, -O0):
<launchLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     114f <launchLevel+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getNbLevels@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jle    1154 <launchLevel+0x34>
jmp    115c <launchLevel+0x3c>
mov    -0x4(%rbp),%edi
call   1030 <initGame@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<launchLevel>:
push   %rbx
test   %edi,%edi
jle    1132 <launchLevel+0x12>
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <getNbLevels@plt>
cmp    %ebx,%eax
jge    1134 <launchLevel+0x14>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <initGame@plt>

LLVM IR (-O0):
define void @launchLevel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 (...) @getNbLevels()
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %5, %1
br label %13
10: ; preds = %5
%11 = load i32, i32* %2
%12 = call i32 @initGame(i32 %11)
br label %13
13: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @launchLevel(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 (...) @getNbLevels()
%5 = icmp slt i32 %4, %0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @initGame(i32 %0)
br label %8
8: ; preds = %1, %3, %6
ret void
}
void *memrev16(void *p) {
  unsigned char *x = p, t;
  t = x[0];
  x[0] = x[1];
  x[1] = t;
  return p;
}


x86 assembly (clang, -O0):
<memrev16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memrev16>:
mov    %rdi,%rax
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define i8* @memrev16(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @memrev16(i8* returned %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
ret i8* %0
}
float nvg__clampf(float a, float mn, float mx) {
  return a < mn ? mn : (a > mx ? mx : a);
}


x86 assembly (clang, -O0):
<nvg__clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <nvg__clampf+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <nvg__clampf+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <nvg__clampf+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <nvg__clampf+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvg__clampf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @nvg__clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @nvg__clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_write(unsigned int, int /*<<< orphan*/ *, unsigned int);
unsigned w5100_writeSn(unsigned sock, unsigned addr, uint8_t *buf,
                       unsigned len) {
  return w5100_write(0x0400 + sock * 0x0100 + addr, buf, len);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
add    $0x400,%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <w5100_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
shl    $0x8,%edi
add    %esi,%edi
add    $0x400,%edi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <w5100_write@plt>

LLVM IR (-O0):
define i32 @w5100_writeSn(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul i32 %9, 256
%11 = add i32 1024, %10
%12 = load i32, i32* %6
%13 = add i32 %11, %12
%14 = load i32*, i32** %7
%15 = load i32, i32* %8
%16 = call i32 @w5100_write(i32 %13, i32* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @w5100_writeSn(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = shl i32 %0, 8
%6 = add i32 %5, 1024
%7 = add i32 %6, %1
%8 = tail call i32 @w5100_write(i32 %7, i32* %2, i32 %3)
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void ip_set_ihl(uint8_t *p_ip, uint8_t ihl) {
  p_ip[0] &= ~0xf;
  p_ip[0] |= (ihl & 0xf);
}


x86 assembly (clang, -O0):
<ip_set_ihl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xf,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_set_ihl>:
mov    (%rdi),%eax
and    $0xfffffff0,%eax
and    $0xf,%esi
or     %eax,%esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @ip_set_ihl(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, -16
%5 = and i32 %1, 15
%6 = or i32 %4, %5
store i32 %6, i32* %0
ret void
}
void blah(int foo) { foo = 1; }


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

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

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

LLVM IR (-O2):
define void @blah(i32 %0) {
ret void
}
int CPU_haveCPUID() {
  int has_CPUID = 0;
  return has_CPUID;
}


x86 assembly (clang, -O0):
<CPU_haveCPUID>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @CPU_haveCPUID() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sample_variance(double *, int);
double sqrt(int /*<<< orphan*/);
double sample_std_deviation(double values[], int count) {
  return sqrt(sample_variance(values, count));
}


x86 assembly (clang, -O0):
<sample_std_deviation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sample_variance@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_std_deviation>:
push   %rax
call   1030 <sample_variance@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @sample_std_deviation(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call i32 @sample_variance(double* %5, i32 %6)
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @sample_std_deviation(double* %0, i32 %1) {
%3 = tail call i32 @sample_variance(double* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
double seconds(void) {
  time_t t;
  t = time(NULL);
  return (double)t;
}


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @seconds() {
%1 = alloca i64
%2 = call i64 @time(i32* null)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = sitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @seconds() {
%1 = tail call i64 @time(i32* null)
%2 = sitofp i64 %1 to double
ret double %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *fpath) {
  struct stat st;
  int ret;
  ret = stat(fpath, &st) == 0 ? 1 : 0;
  printf("%s: %i", fpath, ret);
  return ret;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1040 <stat@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [7 x i8] c"%s: %i\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
store i32 %9, i32* %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [7 x i8] c"%s: %i\00"
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %6)
ret i32 %6
}
int addDigits(int num) { return (num && !(num %= 9)) ? 9 : num; }


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1135 <addDigits+0x35>
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmp    $0x0,%edx
jne    1135 <addDigits+0x35>
mov    $0x9,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <addDigits+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
test   %edi,%edi
je     1125 <addDigits+0x25>
mov    %edi,%eax
movslq %edi,%rcx
imul   $0x38e38e39,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
je     1128 <addDigits+0x28>
ret
xor    %eax,%eax
ret
mov    $0x9,%eax
ret

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

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = srem i32 %0, 9
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3, %1
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 9, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int seek_to_zero(int fd) {
  if (lseek(fd, (off_t)0, SEEK_SET)) {
    perror("lseek() failed");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<seek_to_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
cmp    $0x0,%rax
je     1160 <seek_to_zero+0x40>
lea    0xeb1(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <seek_to_zero+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_to_zero>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <lseek@plt>
test   %rax,%rax
jne    113c <seek_to_zero+0x1c>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%ebx
jmp    1138 <seek_to_zero+0x18>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [15 x i8] c"lseek() failed\00"
define i32 @seek_to_zero(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @SEEK_SET
%6 = call i64 @lseek(i32 %4, i32 0, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [15 x i8] c"lseek() failed\00"
define i32 @seek_to_zero(i32 %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i64 @lseek(i32 %0, i32 0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct ac_buffer {
  int dummy;
};

/* Variables and functions */
struct ac_buffer *buffer_alloc(int);
struct ac_buffer *buffer_extra_alloc(int size) {
  return buffer_alloc(size + 32);
}


x86 assembly (clang, -O0):
<buffer_extra_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x20,%edi
call   1030 <buffer_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_extra_alloc>:
add    $0x20,%edi
jmp    1030 <buffer_alloc@plt>

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define %struct.ac_buffer* @buffer_extra_alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 32
%5 = call %struct.ac_buffer* @buffer_alloc(i32 %4)
ret %struct.ac_buffer* %5
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define %struct.ac_buffer* @buffer_extra_alloc(i32 %0) {
%2 = add nsw i32 %0, 32
%3 = tail call %struct.ac_buffer* @buffer_alloc(i32 %2)
ret %struct.ac_buffer* %3
}
/* Variables and functions */
char *getenv(char *);
scalar_t__ strcmp(char *, char *);
int offloading_disabled() {
  char *xlStr = getenv("OMP_TARGET_OFFLOAD");
  if (!xlStr)
    return 0;
  if (0 == strcmp(xlStr, "DISABLED"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<offloading_disabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <offloading_disabled+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1180 <offloading_disabled+0x60>
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1179 <offloading_disabled+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1180 <offloading_disabled+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offloading_disabled>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     114e <offloading_disabled+0x2e>
lea    0xeda(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"OMP_TARGET_OFFLOAD\00"
@.str.1 = [9 x i8] c"DISABLED\00"
define i32 @offloading_disabled() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %0
store i32 0, i32* %1
br label %13
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 0, %9
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %1
br label %13
12: ; preds = %7
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11, %6
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"OMP_TARGET_OFFLOAD\00"
@.str.1 = [9 x i8] c"DISABLED\00"
define i32 @offloading_disabled() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}