xunge/DecIR huggingface dataset:
int byte_col_uhc_1(int byte) {
  if (byte >= 0x41 && byte < 0x5b)
    return byte - 0x41;
  else if (byte >= 0x61 && byte < 0x7b)
    return byte - 0x47;
  else if (byte >= 0x81 && byte < 0xff)
    return byte - 0x4d;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_col_uhc_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <byte_col_uhc_1+0x29>
cmpl   $0x5b,-0x8(%rbp)
jge    1129 <byte_col_uhc_1+0x29>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <byte_col_uhc_1+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114b <byte_col_uhc_1+0x4b>
cmpl   $0x7b,-0x8(%rbp)
jge    114b <byte_col_uhc_1+0x4b>
mov    -0x8(%rbp),%eax
sub    $0x47,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <byte_col_uhc_1+0x7a>
cmpl   $0x81,-0x8(%rbp)
jl     1173 <byte_col_uhc_1+0x73>
cmpl   $0xff,-0x8(%rbp)
jge    1173 <byte_col_uhc_1+0x73>
mov    -0x8(%rbp),%eax
sub    $0x4d,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <byte_col_uhc_1+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_col_uhc_1>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%eax
jb     112a <byte_col_uhc_1+0x2a>
lea    -0x61(%rdi),%eax
cmp    $0x19,%eax
ja     1116 <byte_col_uhc_1+0x16>
add    $0xffffffb9,%edi
mov    %edi,%eax
ret
lea    -0x81(%rdi),%eax
add    $0xffffffb3,%edi
cmp    $0x7e,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @byte_col_uhc_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 91
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 65
store i32 %11, i32* %2
br label %31
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 123
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 71
store i32 %20, i32* %2
br label %31
21: ; preds = %15, %12
%22 = load i32, i32* %3
%23 = icmp sge i32 %22, 129
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp slt i32 %25, 255
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %3
%29 = sub nsw i32 %28, 77
store i32 %29, i32* %2
br label %31
30: ; preds = %24, %21
store i32 -1, i32* %2
br label %31
31: ; preds = %30, %27, %18, %9
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @byte_col_uhc_1(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 26
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -71
br label %14
9: ; preds = %4
%10 = add i32 %0, -129
%11 = icmp ult i32 %10, 126
%12 = add nsw i32 %0, -77
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
int iFunStrlen(char *ipA) {
  int iRet = 0;
  int iLen = 0;
  while (*ipA != '\0') {
    iLen++;
    ipA++;
  }
  iRet = iLen;
  return iRet;
}


x86 assembly (clang, -O0):
<iFunStrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <iFunStrlen+0x40>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <iFunStrlen+0x16>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iFunStrlen>:
cmpb   $0x0,(%rdi)
je     111c <iFunStrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <iFunStrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iFunStrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int locate_debugfs(char *clk_path) {
  strcpy(clk_path, "/sys/kernel/debug");
  return 0;
}


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

x86 assembly (clang, -O2):
<locate_debugfs>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/sys/kernel/debug\00"
define i32 @locate_debugfs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"/sys/kernel/debug\00"
define i32 @locate_debugfs(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ClearWinSock();
int /*<<< orphan*/ ErrorHandler(char *);
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socketCreation(int *connectionSocket) {
  int result = 0;
  *connectionSocket = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
  if (connectionSocket < 0) {
    ErrorHandler("connectionSocket creation failed.\n");
    close(*connectionSocket);
    ClearWinSock();
    result = 1;
  }
  return (result);
}


x86 assembly (clang, -O0):
<socketCreation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    0x2e5c(%rip),%rax
mov    (%rax),%edx
call   1060 <socket@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x8(%rbp)
jae    11ab <socketCreation+0x6b>
lea    0xe73(%rip),%rdi
call   1050 <ErrorHandler@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    $0x0,%al
call   1040 <ClearWinSock@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketCreation>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
@.str = [35 x i8] c"connectionSocket creation failed.\0A\00"
define i32 @socketCreation(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32, i32* @PF_INET
%5 = load i32, i32* @SOCK_DGRAM
%6 = load i32, i32* @IPPROTO_UDP
%7 = call i32 @socket(i32 %4, i32 %5, i32 %6)
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = load i32*, i32** %2
%10 = icmp ult i32* %9, null
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = call i32 @ErrorHandler(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = call i32 @close(i32 %14)
%16 = call i32 (...) @ClearWinSock()
store i32 1, i32* %3
br label %17
17: ; preds = %11, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@IPPROTO_UDP = global i32 0
define i32 @socketCreation(i32* nocapture writeonly %0) {
%2 = load i32, i32* @PF_INET
%3 = load i32, i32* @SOCK_DGRAM
%4 = load i32, i32* @IPPROTO_UDP
%5 = tail call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %0
ret i32 0
}
unsigned int hweight8(unsigned char w) {
  unsigned char res = (w & 0x55) + ((w >> 1) & 0x55);
  res = (res & 0x33) + ((res >> 2) & 0x33);
  return (res & 0x0F) + ((res >> 4) & 0x0F);
}


x86 assembly (clang, -O0):
<hweight8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x55,%eax
movzbl -0x1(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55,%ecx
add    %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0x33,%eax
movzbl -0x2(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf,%eax
movzbl -0x2(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight8>:
mov    %edi,%eax
and    $0x55,%al
shr    %dil
and    $0x55,%dil
add    %al,%dil
mov    %edi,%eax
and    $0x33,%al
shr    $0x2,%dil
and    $0x33,%dil
add    %al,%dil
movzbl %dil,%eax
mov    %eax,%ecx
and    $0x7,%ecx
shr    $0x4,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight8(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = and i32 %5, 85
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = ashr i32 %8, 1
%10 = and i32 %9, 85
%11 = add nsw i32 %6, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = and i32 %14, 51
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = ashr i32 %17, 2
%19 = and i32 %18, 51
%20 = add nsw i32 %15, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = and i32 %23, 15
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = ashr i32 %26, 4
%28 = and i32 %27, 15
%29 = add nsw i32 %24, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @hweight8(i8 zeroext %0) {
%2 = and i8 %0, 85
%3 = lshr i8 %0, 1
%4 = and i8 %3, 85
%5 = add nuw i8 %4, %2
%6 = and i8 %5, 51
%7 = lshr i8 %5, 2
%8 = and i8 %7, 51
%9 = add nuw nsw i8 %8, %6
%10 = zext i8 %9 to i32
%11 = and i32 %10, 7
%12 = lshr i32 %10, 4
%13 = add nuw nsw i32 %11, %12
ret i32 %13
}
/* Variables and functions */
long hash_bin(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
long hash_char(char *value) { return hash_bin(value, strlen(value)); }


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

x86 assembly (clang, -O2):
<hash_char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <hash_bin@plt>

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

LLVM IR (-O2):
define i64 @hash_char(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @hash_bin(i8* %0, i32 %2)
ret i64 %3
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int __wrap_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
  return 0;
}


x86 assembly (clang, -O0):
<__wrap_connect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @__wrap_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @__wrap_connect(i32 %0, %struct.sockaddr* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ones(uint32_t x) {
  x -= (x >> 1) & 0x55555555;
  x = ((x >> 2) & 0x33333333) + (x & 0x33333333);
  x = ((x >> 4) + x) & 0x0F0F0F0F;
  x += (x >> 8);
  x += (x >> 16);
  return (x & 0x0000003F);
}


x86 assembly (clang, -O0):
<ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
add    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ones>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
shr    $0x2,%eax
and    $0x33333333,%eax
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @ones(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = and i32 %4, 1431655765
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = and i32 %11, 858993459
%13 = add nsw i32 %10, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = ashr i32 %14, 4
%16 = load i32, i32* %2
%17 = add nsw i32 %15, %16
%18 = and i32 %17, 252645135
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 8
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 16
%25 = load i32, i32* %2
%26 = add nsw i32 %25, %24
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 63
ret i32 %28
}

LLVM IR (-O2):
define i32 @ones(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = lshr i32 %4, 2
%6 = and i32 %5, 858993459
%7 = and i32 %4, 858993459
%8 = add nuw nsw i32 %6, %7
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
void PerformanceAPI_SetCurrentThreadName(const char *inThreadName) {}


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

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

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

LLVM IR (-O2):
define void @PerformanceAPI_SetCurrentThreadName(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int EVP_MAX_BLOCK_LENGTH;
int cmac_size(const EVP_PKEY *pkey) { return EVP_MAX_BLOCK_LENGTH; }


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

x86 assembly (clang, -O2):
<cmac_size>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EVP_MAX_BLOCK_LENGTH = global i32 0
define i32 @cmac_size(i32* nocapture readnone %0) {
%2 = load i32, i32* @EVP_MAX_BLOCK_LENGTH
ret i32 %2
}
int *test_func_02(int *p, int *x) {
  int r = 0;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
<test_func_02>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_02>:
mov    (%rdi),%ecx
lea    0x4(%rdi),%rax
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
define i32* @test_func_02(i32* %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
store i32 %4, i32* %1
ret i32* %3
}
int length(char *str) {
  int i = 0;
  while (*str++ != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <length+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
cmpb   $0x0,(%rdi)
je     111c <length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void crlibm_exit(unsigned long long int oldcw) {}


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

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

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

LLVM IR (-O2):
define void @crlibm_exit(i64 %0) {
ret void
}
void put_unaligned_int(void *p, int value) {
  struct {
    int d;
  } __attribute__((packed, may_alias)) *pp = p;
  pp->d = value;
}


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

x86 assembly (clang, -O2):
<put_unaligned_int>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @put_unaligned_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.anon*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.anon*
store %struct.anon* %7, %struct.anon** %5
%8 = load i32, i32* %4
%9 = load %struct.anon*, %struct.anon** %5
%10 = getelementptr inbounds %struct.anon, %struct.anon* %9, i32 0, i32 0
store i32 %8, i32* %10
ret void
}

LLVM IR (-O2):
define void @put_unaligned_int(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  double x;
  long double y;
  printf("size of double: %d byte\n", sizeof x);
  printf("size of long double: %u byte\n", sizeof y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"size of double: %d byte\0A\00"
@.str.1 = [30 x i8] c"size of long double: %u byte\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca x86_fp80
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 16)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"size of double: %d byte\0A\00"
@.str.1 = [30 x i8] c"size of long double: %u byte\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 16)
ret i32 0
}
int byte_col_johab_hangul(int byte) {
  if (byte >= 0x41 && byte < 0x7f)
    return byte - 0x41;
  else if (byte >= 0x81 && byte < 0xff)
    return byte - 0x43;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_col_johab_hangul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <byte_col_johab_hangul+0x29>
cmpl   $0x7f,-0x8(%rbp)
jge    1129 <byte_col_johab_hangul+0x29>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_johab_hangul+0x58>
cmpl   $0x81,-0x8(%rbp)
jl     1151 <byte_col_johab_hangul+0x51>
cmpl   $0xff,-0x8(%rbp)
jge    1151 <byte_col_johab_hangul+0x51>
mov    -0x8(%rbp),%eax
sub    $0x43,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_johab_hangul+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_col_johab_hangul>:
lea    -0x81(%rdi),%eax
lea    -0x43(%rdi),%ecx
cmp    $0x7e,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0x41(%rdi),%ecx
cmp    $0x3e,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_col_johab_hangul(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 65
store i32 %11, i32* %2
br label %22
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 129
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 255
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 67
store i32 %20, i32* %2
br label %22
21: ; preds = %15, %12
store i32 -1, i32* %2
br label %22
22: ; preds = %21, %18, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @byte_col_johab_hangul(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 62
%4 = add i32 %0, -129
%5 = icmp ult i32 %4, 126
%6 = add nsw i32 %0, -67
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %2, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ proc_dump();
int main(int argc, char *argv[]) {
  proc_dump();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <proc_dump@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @proc_dump()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ wbkgdset(int /*<<< orphan*/ *, int /*<<< orphan*/);
void __darwin_wbkgdset(WINDOW *w, uint32_t c) { wbkgdset(w, c); }


x86 assembly (clang, -O0):
<__darwin_wbkgdset>:
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 <wbkgdset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__darwin_wbkgdset>:
jmp    1030 <wbkgdset@plt>

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

LLVM IR (-O2):
define void @__darwin_wbkgdset(i32* %0, i32 %1) {
%3 = tail call i32 @wbkgdset(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void abort(void) { exit(63); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x3f,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @abort() {
%1 = call i32 @exit(i32 63)
unreachable
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 @exit(i32 63)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bym(int /*<<< orphan*/);
int /*<<< orphan*/ shl();
void shl_bym(uint32_t x) {
  bym(x);
  shl();
}


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

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

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

LLVM IR (-O2):
define void @shl_bym(i32 %0) {
%2 = tail call i32 @bym(i32 %0)
%3 = tail call i32 (...) @shl()
ret void
}
void handle_packet_event(void *data, struct packet_event *evt) {
  (void)data;
  (void)evt;
}


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

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

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

LLVM IR (-O2):
%struct.packet_event = type opaque
define void @handle_packet_event(i8* nocapture %0, %struct.packet_event* nocapture %1) {
ret void
}
void av_hwdevice_hwconfig_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_hwdevice_hwconfig_alloc() {
ret void
}
int my_countchar(const char *str, char ch) {
  int i = 0, count = 0;
  while (str[i] != '\0') {
    if (str[i] == ch) {
      count++;
    }
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<my_countchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <my_countchar+0x60>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <my_countchar+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <my_countchar+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_countchar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <my_countchar+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_countchar+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_countchar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %28, %2
%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 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %31
15: ; preds = %7
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %28
25: ; preds = %15
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %28
28: ; preds = %25, %15
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %7
31: ; preds = %7
%32 = load i32, i32* %6
ret i32 %32
}

LLVM IR (-O2):
define i32 @my_countchar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void version() {
  printf("%s version %s\n", "jwalk", "0.0.1");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xedc(%rip),%rdx
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xedf(%rip),%rdx
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [6 x i8] c"jwalk\00"
@.str.2 = [6 x i8] c"0.0.1\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s version %s\0A\00"
@.str.1 = [6 x i8] c"jwalk\00"
@.str.2 = [6 x i8] c"0.0.1\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void foo511(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo511(i32 %0) {
ret void
}
/* Variables and functions */
int board_get_revision();
int board_with_ap6212(void) {
  return (board_get_revision() == 0x0) || (board_get_revision() == 0x1) ||
         (board_get_revision() == 0x6);
}


x86 assembly (clang, -O0):
<board_with_ap6212>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x1(%rbp)
je     1156 <board_with_ap6212+0x46>
mov    $0x0,%al
call   1030 <board_get_revision@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x1,%ecx
mov    %al,-0x1(%rbp)
je     1156 <board_with_ap6212+0x46>
mov    $0x0,%al
call   1030 <board_get_revision@plt>
cmp    $0x6,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_with_ap6212>:
push   %rbx
xor    %eax,%eax
call   1030 <board_get_revision@plt>
mov    $0x1,%ebx
test   %eax,%eax
je     113c <board_with_ap6212+0x2c>
xor    %eax,%eax
call   1030 <board_get_revision@plt>
cmp    $0x1,%eax
je     113c <board_with_ap6212+0x2c>
xor    %eax,%eax
call   1030 <board_get_revision@plt>
xor    %ebx,%ebx
cmp    $0x6,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @board_with_ap6212() {
%1 = call i32 (...) @board_get_revision()
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i32 (...) @board_get_revision()
%5 = icmp eq i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i32 (...) @board_get_revision()
%8 = icmp eq i32 %7, 6
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ true, %3 ], [ true, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @board_with_ap6212() {
%1 = tail call i32 (...) @board_get_revision()
%2 = icmp eq i32 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 (...) @board_get_revision()
%5 = icmp eq i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (...) @board_get_revision()
%8 = icmp eq i32 %7, 6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wgesp() {
  printf("\n Sorry, you may get the gaussian esp file by running Gaussian 09 "
         "with iop(6/50=1)\n");
}


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

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

LLVM IR (-O0):
@.str = [84 x i8] c"\0A Sorry, you may get the gaussian esp file by running Gaussian 09 with iop(6/50=1)\0A\00"
define void @wgesp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [83 x i8] c"\0A Sorry, you may get the gaussian esp file by running Gaussian 09 with iop(6/50=1)\00"
define void @wgesp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
ret void
}
adrx0adr1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (((short *)10000000)[x0]) = (*((short *)11111111)); }


x86 assembly (clang, -O0):
<adrx0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%dx
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1_set>:
movzwl 0xa98ac7,%eax
movslq %edx,%rcx
mov    %ax,0x989680(%rcx,%rcx,1)
ret

LLVM IR (-O0):
define i32 @adrx0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 11111111 to i16*)
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %18
store i16 %16, i16* %19
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adrx0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 11111111 to i16*)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %8
store i16 %7, i16* %9
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *myfopen(char *f) {
  FILE *fp;
  fp = fopen(f, "a");
  return fp;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define noalias i32* @myfopen(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, size_t);
void cha_swrite(void *ptr, size_t size, size_t nmemb, char *output) {
  memcpy(output, ptr, size * nmemb);
}


x86 assembly (clang, -O0):
<cha_swrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cha_swrite>:
mov    %rdi,%rax
imul   %rsi,%rdx
mov    %rcx,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @cha_swrite(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = mul i64 %2, %1
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %5)
ret void
}
char *langDbgDevMatsushita() { return "Matsushita"; }


x86 assembly (clang, -O0):
<langDbgDevMatsushita>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgDevMatsushita>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Matsushita\00"
define i8* @langDbgDevMatsushita() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"Matsushita\00"
define i8* @langDbgDevMatsushita() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int Radix64tobits(char *, char const *, char *, char);
int from64tobits(char *out, const char *in) {
  return (Radix64tobits(
      out, in,
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", '='));
}


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

x86 assembly (clang, -O2):
<from64tobits>:
lea    0xee9(%rip),%rdx
mov    $0x3d,%ecx
jmp    1030 <Radix64tobits@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define i32 @from64tobits(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @Radix64tobits(i8* %5, i8* %6, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8 signext 61)
ret i32 %7
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define i32 @from64tobits(i8* %0, i8* %1) {
%3 = tail call i32 @Radix64tobits(i8* %0, i8* %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8 signext 61)
ret i32 %3
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
int data_in(int /*<<< orphan*/, int);
int len(struct link *);
struct link *newList(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sorted(struct link *);
void main() {
  struct link *list = newList("4 3 1 5 2");
  printf("Median = %d.\n", data_in(sorted(list), len(list) / 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1050 <newList@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <sorted@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <len@plt>
mov    -0xc(%rbp),%edi
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <data_in@plt>
mov    %eax,%esi
lea    0xe72(%rip),%rdi
call   1060 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xea6(%rip),%rdi
call   1050 <newList@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <sorted@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <len@plt>
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
mov    %ebp,%edi
call   1030 <data_in@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <printf@plt>

LLVM IR (-O0):
%struct.link = type { i32 }
@.str = [10 x i8] c"4 3 1 5 2\00"
@.str.1 = [14 x i8] c"Median = %d.\0A\00"
define void @main() {
%1 = alloca %struct.link*
%2 = call %struct.link* @newList(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store %struct.link* %2, %struct.link** %1
%3 = load %struct.link*, %struct.link** %1
%4 = call i32 @sorted(%struct.link* %3)
%5 = load %struct.link*, %struct.link** %1
%6 = call i32 @len(%struct.link* %5)
%7 = sdiv i32 %6, 2
%8 = call i32 @data_in(i32 %4, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
%struct.link = type { i32 }
@.str = [10 x i8] c"4 3 1 5 2\00"
@.str.1 = [14 x i8] c"Median = %d.\0A\00"
define void @main() {
%1 = tail call %struct.link* @newList(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sorted(%struct.link* %1)
%3 = tail call i32 @len(%struct.link* %1)
%4 = sdiv i32 %3, 2
%5 = tail call i32 @data_in(i32 %2, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dhcp_packet(int, char *, int /*<<< orphan*/ *, char *,
                               char *, char *, char *);
void dhcp_inform(char *ipaddr, char *gwaddr, char *hardware, char *opt82,
                 char *opt60) {
  dhcp_packet(8, ipaddr, NULL, opt60, opt82, gwaddr, hardware);
}


x86 assembly (clang, -O0):
<dhcp_inform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
mov    $0x8,%edi
xor    %edx,%edx
mov    %rax,(%rsp)
call   1030 <dhcp_packet@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcp_inform>:
push   %rax
mov    %rcx,%rax
mov    %rsi,%r9
mov    %rdi,%rsi
mov    %rdx,(%rsp)
mov    $0x8,%edi
xor    %edx,%edx
mov    %r8,%rcx
mov    %rax,%r8
call   1030 <dhcp_packet@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dhcp_inform(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
%11 = load i8*, i8** %6
%12 = load i8*, i8** %10
%13 = load i8*, i8** %9
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @dhcp_packet(i32 8, i8* %11, i32* null, i8* %12, i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @dhcp_inform(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @dhcp_packet(i32 8, i8* %0, i32* null, i8* %4, i8* %3, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fnegd(int s, int d) {
  assem_debug("fnegd s%d,d%d", d, s);
  output_w32(0xeeb10b40 | ((d & 7) << 12) | (s & 7));
}


x86 assembly (clang, -O0):
<emit_fnegd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xeeb10b40,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fnegd>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdi
mov    %r14d,%edx
call   1030 <assem_debug@plt>
and    $0x7,%ebx
shl    $0xc,%ebx
and    $0x7,%r14d
lea    (%r14,%rbx,1),%edi
add    $0xeeb10b40,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fnegd s%d,d%d\00"
define void @emit_fnegd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 7
%10 = shl i32 %9, 12
%11 = or i32 -290387136, %10
%12 = load i32, i32* %3
%13 = and i32 %12, 7
%14 = or i32 %11, %13
%15 = call i32 @output_w32(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fnegd s%d,d%d\00"
define void @emit_fnegd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 12
%5 = and i32 %4, 28672
%6 = and i32 %0, 7
%7 = or i32 %6, %5
%8 = or i32 %7, -290387136
%9 = tail call i32 @output_w32(i32 %8)
ret void
}