xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
char const *find_space(char const *in_string) {
  while (*in_string && (!isspace(*in_string)))
    in_string++;
  return in_string;
}


x86 assembly (clang, -O0):
<find_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <find_space+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <find_space+0x48>
jmp    1169 <find_space+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <find_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @find_space(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h264nalst_set_type(uint8_t *p_start, uint8_t type) {
  p_start[0] &= 0xe0;
  p_start[0] |= type;
}


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

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

LLVM IR (-O0):
define void @h264nalst_set_type(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, 224
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = or i32 %12, %9
store i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @h264nalst_set_type(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 224
%5 = or i32 %4, %1
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writesector_hd(int, int, char *);
void writeblock_hd(int hd, int blockno, char *buffer) {
  writesector_hd(hd, blockno * 2, buffer);
  writesector_hd(hd, blockno * 2 + 1, buffer + 512);
}


x86 assembly (clang, -O0):
<writeblock_hd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
mov    -0x10(%rbp),%rdx
call   1030 <writesector_hd@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rdx
add    $0x200,%rdx
call   1030 <writesector_hd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeblock_hd>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
lea    (%r14,%r14,1),%esi
call   1030 <writesector_hd@plt>
lea    (%r14,%r14,1),%esi
add    $0x1,%esi
add    $0x200,%rbx
mov    %ebp,%edi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <writesector_hd@plt>

LLVM IR (-O0):
define void @writeblock_hd(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 2
%10 = load i8*, i8** %6
%11 = call i32 @writesector_hd(i32 %7, i32 %9, i8* %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 2
%15 = add nsw i32 %14, 1
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 512
%18 = call i32 @writesector_hd(i32 %12, i32 %15, i8* %17)
ret void
}

LLVM IR (-O2):
define void @writeblock_hd(i32 %0, i32 %1, i8* %2) {
%4 = shl nsw i32 %1, 1
%5 = tail call i32 @writesector_hd(i32 %0, i32 %4, i8* %2)
%6 = or i32 %4, 1
%7 = getelementptr inbounds i8, i8* %2, i64 512
%8 = tail call i32 @writesector_hd(i32 %0, i32 %6, i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep_msec(long);
void wait_frame(long frame) {
  long n;
  if (frame <= 0)
    return;
  n = 1000 * frame / ((long)(1.0 * 60.0));
  sleep_msec(n);
}


x86 assembly (clang, -O0):
<wait_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jg     112c <wait_frame+0x1c>
jmp    114b <wait_frame+0x3b>
imul   $0x3e8,-0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sleep_msec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_frame>:
test   %rdi,%rdi
jle    1142 <wait_frame+0x32>
imul   $0x3e8,%rdi,%rdi
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rdi,%rax
imul   %rcx
add    %rdx,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x5,%rdi
add    %rax,%rdi
jmp    1030 <sleep_msec@plt>
ret

LLVM IR (-O0):
define void @wait_frame(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp sle i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i64, i64* %2
%9 = mul nsw i64 1000, %8
%10 = sdiv i64 %9, 60
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = call i32 @sleep_msec(i64 %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @wait_frame(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = mul nsw i64 %0, 1000
%5 = sdiv i64 %4, 60
%6 = tail call i32 @sleep_msec(i64 %5)
br label %7
7: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int isNailgunClientName(char *s) { return (!(strcmp(s, "ng"))); }


x86 assembly (clang, -O0):
<isNailgunClientName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNailgunClientName>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ng\00"
define i32 @isNailgunClientName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"ng\00"
define i32 @isNailgunClientName(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ INET6_ADDRSTRLEN;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, void *, char *,
                             int /*<<< orphan*/);
void ip6_ntoa(void *addr, char *str) {
  inet_ntop(AF_INET6, addr, str, INET6_ADDRSTRLEN);
}


x86 assembly (clang, -O0):
<ip6_ntoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip6_ntoa>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <inet_ntop@plt>

LLVM IR (-O0):
@AF_INET6 = global i32 0
@INET6_ADDRSTRLEN = global i32 0
define void @ip6_ntoa(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @AF_INET6
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = load i32, i32* @INET6_ADDRSTRLEN
%9 = call i32 @inet_ntop(i32 %5, i8* %6, i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
@INET6_ADDRSTRLEN = global i32 0
define void @ip6_ntoa(i8* %0, i8* %1) {
%3 = load i32, i32* @AF_INET6
%4 = load i32, i32* @INET6_ADDRSTRLEN
%5 = tail call i32 @inet_ntop(i32 %3, i8* %0, i8* %1, i32 %4)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t SSIDataPutNonBlocking(uint32_t ui32Base, uint32_t ui32Data) {
  ;

  ;
  if ((*((volatile uint32_t *)(ui32Base + 0x0000000C))) & 0x00000002) {
    (*((volatile uint32_t *)(ui32Base + 0x00000008))) = ui32Data;
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<SSIDataPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1139 <SSIDataPutNonBlocking+0x39>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x8,%eax
cltq
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1140 <SSIDataPutNonBlocking+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataPutNonBlocking>:
movslq %edi,%rcx
xor    %eax,%eax
testl  $0x2,0xc(%rcx)
je     1116 <SSIDataPutNonBlocking+0x16>
mov    %esi,0x8(%rcx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @SSIDataPutNonBlocking(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 12
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = add nsw i32 %0, 8
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %1, i32* %12
br label %13
13: ; preds = %2, %9
%14 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t clear_bit(uint32_t value, int bit) {
  return value & ~(uint32_t)(1 << (31 - bit));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1f,%ecx
sub    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %esi,%ecx
mov    $0x80000000,%eax
shr    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @clear_bit(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 = sub nsw i32 31, %6
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = and i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @clear_bit(i32 %0, i32 %1) {
%3 = lshr i32 -2147483648, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
int tramp() {
  *(void **)0x12345678 = (void *)0x73554711;
  return (*(int (*)())0xbabebec0)();
}


x86 assembly (clang, -O0):
<tramp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x73554711,%ecx
mov    %rcx,(%rax)
mov    $0xbabebec0,%ecx
mov    $0x0,%al
call   *%rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tramp>:
movq   $0x73554711,0x12345678
12 11 47 55 73
mov    $0xbabebec0,%ecx
xor    %eax,%eax
jmp    *%rcx

LLVM IR (-O0):
define i32 @tramp() {
store i8* inttoptr (i64 1934968593 to i8*), i8** inttoptr (i64 305419896 to i8**)
%1 = call i32 (...) inttoptr (i64 3133062848 to i32 (...)*)()
ret i32 %1
}

LLVM IR (-O2):
define i32 @tramp() {
store i8* inttoptr (i64 1934968593 to i8*), i8** inttoptr (i64 305419896 to i8**)
%1 = tail call i32 (...) inttoptr (i64 3133062848 to i32 (...)*)()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ enquanto(int *, int *);
void estruturaPrograma(int *opcao, int *codigoFuncionarios) {
  int opcaoTmp, codigoFuncionariosTmp;
  opcaoTmp = *opcao;
  codigoFuncionariosTmp = *codigoFuncionarios;
  enquanto(&opcaoTmp, &codigoFuncionariosTmp);
}


x86 assembly (clang, -O0):
<estruturaPrograma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <enquanto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estruturaPrograma>:
push   %rax
mov    (%rdi),%eax
mov    %eax,0x4(%rsp)
mov    (%rsi),%eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <enquanto@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @estruturaPrograma(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = call i32 @enquanto(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @estruturaPrograma(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = load i32, i32* %0
store i32 %7, i32* %3
%8 = load i32, i32* %1
store i32 %8, i32* %4
%9 = call i32 @enquanto(i32* %3, i32* %4)
ret void
}
void foo464(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo464(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ia32_punpckhqdq128(int /*<<< orphan*/,
                                                int /*<<< orphan*/);
__m128i _mm_unpackhi_epi64(__m128i a, __m128i b) {
  return __builtin_ia32_punpckhqdq128(a, b);
}


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

x86 assembly (clang, -O2):
<_mm_unpackhi_epi64>:
jmp    1030 <__builtin_ia32_punpckhqdq128@plt>

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

LLVM IR (-O2):
define i32 @_mm_unpackhi_epi64(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_ia32_punpckhqdq128(i32 %0, i32 %1)
ret i32 %3
}
int do_723() { return 723; }


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

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

LLVM IR (-O0):
define i32 @do_723() {
ret i32 723
}

LLVM IR (-O2):
define i32 @do_723() {
ret i32 723
}
/* Variables and functions */
int ***foo(int);
void bar() { int ***p = foo(2); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <foo@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x2,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32*** @foo(i32 2)
ret void
}
/* Variables and functions */
bool firstIsBigger(int first, int second, bool aceIsOne) {
  if (aceIsOne) {
    return first > second;
  } else
    return (first == 1) || ((first > second) && (second != 1));
}


x86 assembly (clang, -O0):
<firstIsBigger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     112d <firstIsBigger+0x2d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <firstIsBigger+0x68>
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     115d <firstIsBigger+0x5d>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x12(%rbp)
jle    1157 <firstIsBigger+0x57>
cmpl   $0x1,-0xc(%rbp)
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstIsBigger>:
test   %edx,%edx
je     110d <firstIsBigger+0xd>
cmp    %esi,%edi
setg   %al
movzbl %al,%eax
ret
cmp    $0x1,%edi
sete   %cl
cmp    %esi,%edi
setg   %dl
cmp    $0x1,%esi
setne  %al
and    %dl,%al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @firstIsBigger(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %4
br label %30
15: ; preds = %3
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 1
br i1 %17, label %27, label %18
18: ; preds = %15
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i32, i32* %6
%24 = icmp ne i32 %23, 1
br label %25
25: ; preds = %22, %18
%26 = phi i1 [ false, %18 ], [ %24, %22 ]
br label %27
27: ; preds = %25, %15
%28 = phi i1 [ true, %15 ], [ %26, %25 ]
%29 = zext i1 %28 to i32
store i32 %29, i32* %4
br label %30
30: ; preds = %27, %10
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @firstIsBigger(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, %1
br label %13
7: ; preds = %3
%8 = icmp eq i32 %0, 1
%9 = icmp sgt i32 %0, %1
%10 = icmp ne i32 %1, 1
%11 = and i1 %9, %10
%12 = or i1 %8, %11
br label %13
13: ; preds = %7, %5
%14 = phi i1 [ %6, %5 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *localFree(void *memory) {
  if (memory)
    free(memory);
  return (void *)0;
}


x86 assembly (clang, -O0):
<localFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <localFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localFree>:
test   %rdi,%rdi
je     111f <localFree+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @localFree(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 = %3, %1
ret i8* null
}
/* Type definitions */
struct ldv_kobject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
void ldv_kobject_cleanup(struct ldv_kobject *kobj) { test_assert(kobj == 0); }


x86 assembly (clang, -O0):
<ldv_kobject_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldv_kobject_cleanup>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
mov    %eax,%edi
jmp    1030 <test_assert@plt>

LLVM IR (-O0):
%struct.ldv_kobject = type { i32 }
define void @ldv_kobject_cleanup(%struct.ldv_kobject* %0) {
%2 = alloca %struct.ldv_kobject*
store %struct.ldv_kobject* %0, %struct.ldv_kobject** %2
%3 = load %struct.ldv_kobject*, %struct.ldv_kobject** %2
%4 = icmp eq %struct.ldv_kobject* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @test_assert(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.ldv_kobject = type { i32 }
define void @ldv_kobject_cleanup(%struct.ldv_kobject* readnone %0) {
%2 = icmp eq %struct.ldv_kobject* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @test_assert(i32 %3)
ret void
}
int is_between(double start, double middle, double end) {
  return start < end ? start <= middle && middle <= end
                     : end <= middle && middle <= start;
}


x86 assembly (clang, -O0):
<is_between>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1164 <is_between+0x64>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     1154 <is_between+0x54>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
jmp    119c <is_between+0x9c>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
jb     1191 <is_between+0x91>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_between>:
xor    %eax,%eax
ucomisd %xmm2,%xmm1
setae  %al
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
setae  %cl
xor    %edx,%edx
ucomisd %xmm0,%xmm1
setae  %dl
xor    %esi,%esi
ucomisd %xmm1,%xmm2
setae  %sil
ucomisd %xmm0,%xmm2
cmova  %esi,%eax
cmova  %edx,%ecx
and    %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_between(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fcmp ole double %11, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load double, double* %5
%16 = load double, double* %6
%17 = fcmp ole double %15, %16
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
br label %32
21: ; preds = %3
%22 = load double, double* %6
%23 = load double, double* %5
%24 = fcmp ole double %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load double, double* %5
%27 = load double, double* %4
%28 = fcmp ole double %26, %27
br label %29
29: ; preds = %25, %21
%30 = phi i1 [ false, %21 ], [ %28, %25 ]
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %29, %18
%33 = phi i32 [ %20, %18 ], [ %31, %29 ]
ret i32 %33
}

LLVM IR (-O2):
define i32 @is_between(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %2
%5 = fcmp ole double %2, %1
%6 = fcmp ole double %1, %0
%7 = fcmp ole double %0, %1
%8 = fcmp ole double %1, %2
%9 = select i1 %4, i1 %8, i1 %5
%10 = select i1 %4, i1 %7, i1 %6
%11 = and i1 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int strcmp(char *, char *);
int txtcmp(void *a, void *b) { return strcmp(*((char **)a), *((char **)b)); }


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

x86 assembly (clang, -O2):
<txtcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @txtcmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @txtcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *flash_get_SR() { return mem_get_reg32(0x40023C00 + 0x18); }


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

x86 assembly (clang, -O2):
<flash_get_SR>:
mov    $0x40023c18,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @flash_get_SR() {
%1 = call i32* @mem_get_reg32(i32 1073888280)
ret i32* %1
}

LLVM IR (-O2):
define i32* @flash_get_SR() {
%1 = tail call i32* @mem_get_reg32(i32 1073888280)
ret i32* %1
}
void RTNetIPv4IsUDPValid(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv4IsUDPValid() {
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct addrinfo *);
void freeaddrinfo(struct addrinfo *p) { free(p); }


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

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

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define void @freeaddrinfo(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
%3 = load %struct.addrinfo*, %struct.addrinfo** %2
%4 = call i32 @free(%struct.addrinfo* %3)
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define void @freeaddrinfo(%struct.addrinfo* nocapture %0) {
%2 = tail call i32 @free(%struct.addrinfo* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sumPrimes(int);
int main(void) {
  printf("%lld\n", sumPrimes(2000000));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e8480,%edi
call   1040 <sumPrimes@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sumPrimes(i32 2000000)
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i32 @sumPrimes(i32 2000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, long *);
long int size(int fd) {
  long int statbuf[18];
  syscall(5, fd, statbuf);
  return statbuf[6];
}


x86 assembly (clang, -O0):
<size>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0xa0(%rbp),%rdx
mov    $0x5,%edi
call   1030 <syscall@plt>
mov    -0x70(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size>:
sub    $0x98,%rsp
mov    %edi,%esi
mov    %rsp,%rdx
mov    $0x5,%edi
call   1030 <syscall@plt>
mov    0x30(%rsp),%rax
add    $0x98,%rsp
ret

LLVM IR (-O0):
define i64 @size(i32 %0) {
%2 = alloca i32
%3 = alloca [18 x i64]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [18 x i64], [18 x i64]* %3, i64 0, i64 0
%6 = call i32 @syscall(i32 5, i32 %4, i64* %5)
%7 = getelementptr inbounds [18 x i64], [18 x i64]* %3, i64 0, i64 6
%8 = load i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @size(i32 %0) {
%2 = alloca [18 x i64]
%3 = bitcast [18 x i64]* %2 to i8*
%4 = getelementptr inbounds [18 x i64], [18 x i64]* %2, i64 0, i64 0
%5 = call i32 @syscall(i32 5, i32 %0, i64* %4)
%6 = getelementptr inbounds [18 x i64], [18 x i64]* %2, i64 0, i64 6
%7 = load i64, i64* %6
ret i64 %7
}
void I2CSoftwareResetDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~0x00008000;
}


x86 assembly (clang, -O0):
<I2CSoftwareResetDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xffffffffffff7fff,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSoftwareResetDisable>:
andq   $0xffffffffffff7fff,(%rdi)
ret

LLVM IR (-O0):
define void @I2CSoftwareResetDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -32769
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CSoftwareResetDisable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -32769
store volatile i64 %4, i64* %2
ret void
}
int limit_interval(int min, int max, int nmr) {
  if (nmr < min)
    return min;
  if (nmr > max)
    return max;
  return nmr;
}


x86 assembly (clang, -O0):
<limit_interval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <limit_interval+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <limit_interval+0x41>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <limit_interval+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <limit_interval+0x41>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_interval>:
mov    %esi,%eax
cmp    %esi,%edx
cmovle %edx,%eax
cmp    %edi,%edx
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @limit_interval(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %0
%5 = icmp sgt i32 %2, %1
%6 = select i1 %5, i32 %1, i32 %2
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int asv(int a, int b) { return (a >> b) != 0; }


x86 assembly (clang, -O0):
<asv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asv>:
mov    %esi,%ecx
sar    %cl,%edi
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @asv(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 = ashr i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @asv(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void __arch_atomic_inc(long int *pointer) {
  const long int inc_val = 1L;
  __sync_fetch_and_add(pointer, inc_val);
}


x86 assembly (clang, -O0):
<__arch_atomic_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
lock addq $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__arch_atomic_inc>:
lock addq $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @__arch_atomic_inc(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
store i64 1, i64* %3
%4 = load i64*, i64** %2
%5 = atomicrmw add i64* %4, i64 1 seq_cst
ret void
}

LLVM IR (-O2):
define void @__arch_atomic_inc(i64* nocapture %0) {
%2 = atomicrmw add i64* %0, i64 1 seq_cst
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ h1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  char h0[] = {'H', 'e', 'l', 'l', 'o', '!', '\0'};
  char h1[] = "Hello!";
  char *h2 = "Hello!";
  puts(h0);
  puts(h1);
  printf(">> %d\n", sizeof(h1));
  puts(h2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeae(%rip),%eax
mov    %eax,-0x12(%rbp)
mov    0xea8(%rip),%ax
mov    %ax,-0xe(%rbp)
mov    0xea0(%rip),%al
mov    %al,-0xc(%rbp)
lea    0xe90(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x12(%rbp),%rdi
call   1030 <puts@plt>
lea    0xe7a(%rip),%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x216f6c,0xb(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0xec4(%rip),%rbx
movl   $0x216f6c,0x3(%rsp)
movl   $0x6c6c6548,(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
mov    $0x7,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.h0 = [7 x i8] c"Hello!\00"
@__const.main.h1 = [7 x i8] c"Hello!\00"
@.str = [7 x i8] c"Hello!\00"
@.str.1 = [7 x i8] c">> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [7 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [7 x i8]* %2 to i8*
%6 = bitcast [7 x i8]* %3 to i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 7)
%12 = load i8*, i8** %4
%13 = call i32 @puts(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello!\00"
@.str.1 = [7 x i8] c">> %d\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [7 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @puts(i8* %3)
%6 = call i32 @puts(i8* %4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 7)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int MB_CUR_MAX;
int __aeabi_MB_CUR_MAX(void) { return MB_CUR_MAX; }


x86 assembly (clang, -O0):
<__aeabi_MB_CUR_MAX>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eed(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@MB_CUR_MAX = global i32 0
define i32 @__aeabi_MB_CUR_MAX() {
%1 = load i32, i32* @MB_CUR_MAX
ret i32 %1
}

LLVM IR (-O2):
@MB_CUR_MAX = global i32 0
define i32 @__aeabi_MB_CUR_MAX() {
%1 = load i32, i32* @MB_CUR_MAX
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *abrir_arquivo(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
FILE *resetar_tabela(FILE *fileTabela, char *nome_arquivo) {
  fclose(fileTabela);
  fileTabela = abrir_arquivo(fileTabela, nome_arquivo);
  return fileTabela;
}


x86 assembly (clang, -O0):
<resetar_tabela>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <abrir_arquivo@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetar_tabela>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fclose@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <abrir_arquivo@plt>

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

LLVM IR (-O2):
define i32* @resetar_tabela(i32* %0, i8* %1) {
%3 = tail call i32 @fclose(i32* %0)
%4 = tail call i32* @abrir_arquivo(i32* %0, i8* %1)
ret i32* %4
}
long mod(long c, long n) {
  long result;
  result = c - c / n * n;
  return result;
}


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

x86 assembly (clang, -O2):
<mod>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <mod+0x18>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @mod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = sdiv i64 %7, %8
%10 = load i64, i64* %4
%11 = mul nsw i64 %9, %10
%12 = sub nsw i64 %6, %11
store i64 %12, i64* %5
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
define i64 @mod(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ EAGAIN;
int /*<<< orphan*/ errno;
int fork(void) {
  errno = EAGAIN;
  return -1;
}


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EAGAIN = global i32 0
@errno = global i32 0
define i32 @fork() {
%1 = load i32, i32* @EAGAIN
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void PutIndent(int indent) {
  int i;
  for (i = 0; i <= indent; ++i)
    printf("    ");
}


x86 assembly (clang, -O0):
<PutIndent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1148 <PutIndent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <PutIndent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutIndent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     113d <PutIndent+0x2d>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <PutIndent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @PutIndent(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int dist_N(int **image, int **transformee, int x, int y) {
  if (x > 0) {
    return (transformee[x - 1][y]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<dist_N>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    113c <dist_N+0x3c>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <dist_N+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_N>:
test   %edx,%edx
jle    1112 <dist_N+0x12>
add    $0xffffffff,%edx
mov    (%rsi,%rdx,8),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
ret
xor    %eax,%eax
ret

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

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

/* Variables and functions */
int towlower(int);
void wcstolower(wchar_t str[]) {
  while (*str != L'\0') {
    *str = towlower(*str);
    ++str;
  }
}


x86 assembly (clang, -O0):
<wcstolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     114d <wcstolower+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <towlower@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <wcstolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstolower>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1132 <wcstolower+0x22>
add    $0x4,%rbx
xchg   %ax,%ax
call   1030 <towlower@plt>
mov    %eax,-0x4(%rbx)
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1120 <wcstolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @wcstolower(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i32* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @towlower(i32 %5)
store i32 %7, i32* %6
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int test_imm_61uint16_mem(unsigned short *val) {
  return ((*val) & (-0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff9f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_61uint16_mem>:
movzwl (%rdi),%eax
test   $0xff9f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_61uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -97
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}