xunge/DecIR huggingface dataset:
unsigned int hweight8(unsigned int w) {
  unsigned int 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    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33,%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hweight8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 85
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
%8 = and i32 %7, 85
%9 = add i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 51
%12 = load i32, i32* %3
%13 = lshr i32 %12, 2
%14 = and i32 %13, 51
%15 = add i32 %11, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = and i32 %16, 15
%18 = load i32, i32* %3
%19 = lshr i32 %18, 4
%20 = and i32 %19, 15
%21 = add i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @hweight8(i32 %0) {
%2 = and i32 %0, 85
%3 = lshr i32 %0, 1
%4 = and i32 %3, 85
%5 = add nuw nsw i32 %4, %2
%6 = and i32 %5, 51
%7 = lshr i32 %5, 2
%8 = and i32 %7, 51
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 7
%11 = lshr i32 %9, 4
%12 = add nuw nsw i32 %10, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ENET2_DriverIRQHandler();
__attribute__((weak)) void ENET2_IRQHandler(void) { ENET2_DriverIRQHandler(); }


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

x86 assembly (clang, -O2):
<ENET2_IRQHandler>:
xor    %eax,%eax
jmp    1030 <ENET2_DriverIRQHandler@plt>

LLVM IR (-O0):
define weak void @ENET2_IRQHandler() {
%1 = call i32 (...) @ENET2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ENET2_IRQHandler() {
%1 = tail call i32 (...) @ENET2_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("pid_t: %zu\n", sizeof(pid_t));
  printf("uid_t: %zu\n", sizeof(uid_t));
  printf("gid_t: %zu\n", sizeof(gid_t));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"pid_t: %zu\0A\00"
@.str.1 = [12 x i8] c"uid_t: %zu\0A\00"
@.str.2 = [12 x i8] c"gid_t: %zu\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"pid_t: %zu\0A\00"
@.str.1 = [12 x i8] c"uid_t: %zu\0A\00"
@.str.2 = [12 x i8] c"gid_t: %zu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
void replace_char(char *source, char bef, char aft) {
  char *rep;
  if (!(rep = strchr(source, bef)))
    return;
  *rep = aft;
}


x86 assembly (clang, -O0):
<replace_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1147 <replace_char+0x37>
jmp    1150 <replace_char+0x40>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_char>:
push   %rbx
mov    %edx,%ebx
call   1030 <strchr@plt>
test   %rax,%rax
je     111f <replace_char+0xf>
mov    %bl,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @replace_char(i8* %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %5
%10 = call i8* @strchr(i8* %8, i8 signext %9)
store i8* %10, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
br label %16
13: ; preds = %3
%14 = load i8, i8* %6
%15 = load i8*, i8** %7
store i8 %14, i8* %15
br label %16
16: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @replace_char(i8* %0, i8 signext %1, i8 signext %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i8 %2, i8* %4
br label %7
7: ; preds = %3, %6
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int eth_mask_is_exact(const uint8_t ea[6]) {
  return (ea[0] & ea[1] & ea[2] & ea[3] & ea[4] & ea[5]) == 0xff;
}


x86 assembly (clang, -O0):
<eth_mask_is_exact>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
and    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0xc(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0x10(%rcx),%eax
mov    -0x8(%rbp),%rcx
and    0x14(%rcx),%eax
cmp    $0xff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_mask_is_exact>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
pand   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pand   %xmm1,%xmm0
movd   %xmm0,%ecx
and    0x10(%rdi),%ecx
and    0x14(%rdi),%ecx
xor    %eax,%eax
cmp    $0xff,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @eth_mask_is_exact(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = and i32 %5, %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = load i32, i32* %11
%13 = and i32 %9, %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = load i32, i32* %15
%17 = and i32 %13, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 4
%20 = load i32, i32* %19
%21 = and i32 %17, %20
%22 = load i32*, i32** %2
%23 = getelementptr inbounds i32, i32* %22, i64 5
%24 = load i32, i32* %23
%25 = and i32 %21, %24
%26 = icmp eq i32 %25, 255
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @eth_mask_is_exact(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 5
%7 = load i32, i32* %6
%8 = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> %3)
%9 = and i32 %8, %5
%10 = and i32 %9, %7
%11 = icmp eq i32 %10, 255
%12 = zext i1 %11 to i32
ret i32 %12
}
void ff_hevc_put_hevc_epel_hv6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv6_10_sse4() {
ret void
}
int climbStairs2(int n) {
  if (n == 0) {
    return 1;
  }
  if (n == 1) {
    return 1;
  }
  return climbStairs2(n - 1) + climbStairs2(n - 2);
}


x86 assembly (clang, -O0):
<climbStairs2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <climbStairs2+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116a <climbStairs2+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <climbStairs2+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <climbStairs2+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <climbStairs2@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <climbStairs2@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<climbStairs2>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <climbStairs2+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <climbStairs2@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <climbStairs2+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @climbStairs2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @climbStairs2(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void SBNSearchFreeIds(int *panShapeId) { free(panShapeId); }


x86 assembly (clang, -O0):
<SBNSearchFreeIds>:
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):
<SBNSearchFreeIds>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @SBNSearchFreeIds(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void assert_true(const char *condition, int actual, const char *file,
                 int line) {
  if (!actual) {
    fprintf(stderr, "%s:%d assertion failed: %s\n", file, line, condition);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_true>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    116a <assert_true+0x4a>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_true>:
test   %esi,%esi
je     1125 <assert_true+0x5>
ret
push   %rax
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"%s:%d assertion failed: %s\0A\00"
define void @assert_true(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %4
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %5
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"%s:%d assertion failed: %s\0A\00"
define void @assert_true(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
unsigned char UartReceiveByte(unsigned char *data) {
  if (((*((volatile unsigned char *)0xE000C014)) & (0x01)) != 0) {
    data[0] = (*((volatile unsigned char *)0xE000C000));
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<UartReceiveByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0xe000c014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <UartReceiveByte+0x34>
mov    $0xe000c000,%eax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movb   $0x1,-0x1(%rbp)
jmp    1138 <UartReceiveByte+0x38>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UartReceiveByte>:
mov    $0xe000c000,%eax
testb  $0x1,0x14(%rax)
jne    110e <UartReceiveByte+0xe>
xor    %eax,%eax
ret
mov    (%rax),%al
mov    %al,(%rdi)
mov    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @UartReceiveByte(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load volatile i8, i8* inttoptr (i64 3758145556 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load volatile i8, i8* inttoptr (i64 3758145536 to i8*)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
store i8 1, i8* %2
br label %13
12: ; preds = %1
store i8 0, i8* %2
br label %13
13: ; preds = %12, %8
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @UartReceiveByte(i8* nocapture writeonly %0) {
%2 = load volatile i8, i8* inttoptr (i64 3758145556 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 3758145536 to i8*)
store i8 %6, i8* %0
br label %7
7: ; preds = %1, %5
%8 = phi i8 [ 1, %5 ], [ 0, %1 ]
ret i8 %8
}
void I2CSoftReset(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |= (0x00000002u);
}


x86 assembly (clang, -O0):
<I2CSoftReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSoftReset>:
add    $0x10,%edi
orl    $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @I2CSoftReset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @I2CSoftReset(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
ret void
}
void ABGRToAR30Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ABGRToAR30Row_SSSE3() {
ret void
}
int nsock_unix(const char *path, unsigned int flags) {}


x86 assembly (clang, -O0):
<nsock_unix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @nsock_unix(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ lcm_init();
void lcm_resume(void) { lcm_init(); }


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

x86 assembly (clang, -O2):
<lcm_resume>:
xor    %eax,%eax
jmp    1030 <lcm_init@plt>

LLVM IR (-O0):
define void @lcm_resume() {
%1 = call i32 (...) @lcm_init()
ret void
}

LLVM IR (-O2):
define void @lcm_resume() {
%1 = tail call i32 (...) @lcm_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Linuxquestions.org\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Linuxquestions.org\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Linuxquestions.org\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct gecko_cmd_packet {
  int dummy;
};

/* Variables and functions */
struct gecko_cmd_packet *gecko_get_event(int);
struct gecko_cmd_packet *gecko_wait_event(void) {
  return gecko_get_event(1);
}


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

x86 assembly (clang, -O2):
<gecko_wait_event>:
mov    $0x1,%edi
jmp    1030 <gecko_get_event@plt>

LLVM IR (-O0):
%struct.gecko_cmd_packet = type { i32 }
define %struct.gecko_cmd_packet* @gecko_wait_event() {
%1 = call %struct.gecko_cmd_packet* @gecko_get_event(i32 1)
ret %struct.gecko_cmd_packet* %1
}

LLVM IR (-O2):
%struct.gecko_cmd_packet = type { i32 }
define %struct.gecko_cmd_packet* @gecko_wait_event() {
%1 = tail call %struct.gecko_cmd_packet* @gecko_get_event(i32 1)
ret %struct.gecko_cmd_packet* %1
}
int do_094() { return 94; }


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

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

LLVM IR (-O0):
define i32 @do_094() {
ret i32 94
}

LLVM IR (-O2):
define i32 @do_094() {
ret i32 94
}
void x86_case(int i, unsigned tar, unsigned arg1, unsigned arg2) {}


x86 assembly (clang, -O0):
<x86_case>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @x86_case(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @x86_case(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sleep(unsigned int);
unsigned sleep(unsigned seconds) { Sleep(seconds * 1000); }


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%edi
call   1030 <Sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <Sleep@plt>

LLVM IR (-O0):
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = mul i32 %4, 1000
%6 = call i32 @Sleep(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @Sleep(i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ muscd_stop();
int /*<<< orphan*/ musmidi_stop();
int /*<<< orphan*/ muspcm_stop(int);
int musfade_stop_playback(int dev, int subdev) {
  switch (dev) {
  case 1:
    muscd_stop();
    break;
  case 2:
    musmidi_stop();
    break;
  case 3:
    muspcm_stop(subdev);
    break;
  default:
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<musfade_stop_playback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1174 <musfade_stop_playback+0x44>
jmp    1152 <musfade_stop_playback+0x22>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1180 <musfade_stop_playback+0x50>
jmp    1163 <musfade_stop_playback+0x33>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     118c <musfade_stop_playback+0x5c>
jmp    1199 <musfade_stop_playback+0x69>
mov    $0x0,%al
call   1040 <muscd_stop@plt>
jmp    119e <musfade_stop_playback+0x6e>
mov    $0x0,%al
call   1030 <musmidi_stop@plt>
jmp    119e <musfade_stop_playback+0x6e>
mov    -0x8(%rbp),%edi
call   1050 <muspcm_stop@plt>
jmp    119e <musfade_stop_playback+0x6e>
jmp    119e <musfade_stop_playback+0x6e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<musfade_stop_playback>:
push   %rax
cmp    $0x3,%edi
je     1149 <musfade_stop_playback+0x19>
cmp    $0x2,%edi
je     1152 <musfade_stop_playback+0x22>
cmp    $0x1,%edi
jne    1159 <musfade_stop_playback+0x29>
xor    %eax,%eax
call   1040 <muscd_stop@plt>
jmp    1159 <musfade_stop_playback+0x29>
mov    %esi,%edi
call   1050 <muspcm_stop@plt>
jmp    1159 <musfade_stop_playback+0x29>
xor    %eax,%eax
call   1030 <musmidi_stop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @musfade_stop_playback(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
switch i32 %5, label %13 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
6: ; preds = %2
%7 = call i32 (...) @muscd_stop()
br label %14
8: ; preds = %2
%9 = call i32 (...) @musmidi_stop()
br label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @muspcm_stop(i32 %11)
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %10, %8, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @musfade_stop_playback(i32 %0, i32 %1) {
switch i32 %0, label %9 [
i32 1, label %3
i32 2, label %5
i32 3, label %7
]
3: ; preds = %2
%4 = tail call i32 (...) @muscd_stop()
br label %9
5: ; preds = %2
%6 = tail call i32 (...) @musmidi_stop()
br label %9
7: ; preds = %2
%8 = tail call i32 @muspcm_stop(i32 %1)
br label %9
9: ; preds = %2, %7, %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void func_stringp(char **sP) { printf("%s\n", *sP); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @func_stringp(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int JesteRastuci(int n, int x[]) {
  int i;
  for (i = 0; i < n - 1; i++)
    if (x[i] >= x[i + 1])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<JesteRastuci>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1163 <JesteRastuci+0x63>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jl     1150 <JesteRastuci+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <JesteRastuci+0x6a>
jmp    1155 <JesteRastuci+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <JesteRastuci+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JesteRastuci>:
add    $0xffffffff,%edi
xor    %eax,%eax
test   %edi,%edi
cmovle %eax,%edi
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rdi
je     1128 <JesteRastuci+0x28>
mov    (%rsi,%rax,4),%ecx
lea    0x1(%rax),%rdx
cmp    0x4(%rsi,%rax,4),%ecx
mov    %rdx,%rax
jl     1110 <JesteRastuci+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @JesteRastuci(i32 %0, i32* nocapture %1) {
%3 = add i32 %0, -1
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %1, i64 %7
%11 = load i32, i32* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
%15 = icmp slt i32 %11, %14
br i1 %15, label %6, label %16
16: ; preds = %6, %9
%17 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_backtrace(int);
void *posix__Group__from_gid(void *self, long p0) {
  void *var;
  printf("NOT YET IMPLEMENTED nitni for posix#Group#from_gid at "
         "lib/standard/posix.nit:57,2--51\n");
  show_backtrace(1);
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<posix__Group__from_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <show_backtrace@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix__Group__from_gid>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <show_backtrace@plt>

LLVM IR (-O0):
@.str = [87 x i8] c"NOT YET IMPLEMENTED nitni for posix#Group#from_gid at lib/standard/posix.nit:57,2--51\0A\00"
define i8* @posix__Group__from_gid(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @show_backtrace(i32 1)
br label %8
8: ; preds = %2
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
@str = [86 x i8] c"NOT YET IMPLEMENTED nitni for posix#Group#from_gid at lib/standard/posix.nit:57,2--51\00"
define noalias i8* @posix__Group__from_gid(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @show_backtrace(i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 10;
  int b = 11;
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
  printf("a=%d, b=%d\n", a, b);
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11, i32 10)
ret i32 0
}
unsigned long larsons_hash(const char *s, int len) {
  unsigned long h = 0;
  while (len-- > 0 && *s)
    h = h * 101 + *(unsigned char *)s++;
  return h;
}


x86 assembly (clang, -O0):
<larsons_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
jle    113c <larsons_hash+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114c <larsons_hash+0x4c>
jmp    116f <larsons_hash+0x6f>
imul   $0x65,-0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <larsons_hash+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<larsons_hash>:
test   %esi,%esi
jle    112c <larsons_hash+0x2c>
add    $0x1,%esi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rdi),%ecx
test   %rcx,%rcx
je     112b <larsons_hash+0x2b>
imul   $0x65,%rax,%rax
add    $0x1,%rdi
add    %rcx,%rax
add    $0xffffffff,%esi
cmp    $0x1,%esi
jg     1110 <larsons_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @larsons_hash(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %17
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ %1, %2 ]
%6 = phi i64 [ %15, %10 ], [ 0, %2 ]
%7 = phi i8* [ %13, %10 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %4
%11 = add nsw i32 %5, -1
%12 = mul i64 %6, 101
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = zext i8 %8 to i64
%15 = add i64 %12, %14
%16 = icmp sgt i32 %5, 1
br i1 %16, label %4, label %17
17: ; preds = %4, %10, %2
%18 = phi i64 [ 0, %2 ], [ %15, %10 ], [ %6, %4 ]
ret i64 %18
}
void halmosClean(struct halmos *h) { (void)h; }


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

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

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

LLVM IR (-O2):
%struct.halmos = type opaque
define void @halmosClean(%struct.halmos* nocapture %0) {
ret void
}
void fk524(ra, dec) double *ra;
double *dec;
{
  double rapm;
  double decpm;
  rapm = (double)0.0;
  decpm = (double)0.0;
  fk524m(ra, dec, &rapm, &decpm);
  return;
}


x86 assembly (clang, -O0):
<fk524>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1030 <fk524m@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fk524>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1030 <fk524m@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @fk524(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
%7 = load double*, double** %3
%8 = load double*, double** %4
%9 = call i32 (double*, double*, double*, double*, ...) bitcast (i32 (...)* @fk524m to i32 (double*, double*, double*, double*, ...)*)(double* %7, double* %8, double* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @fk524(double* %0, double* %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
%7 = call i32 (double*, double*, double*, double*, ...) bitcast (i32 (...)* @fk524m to i32 (double*, double*, double*, double*, ...)*)(double* %0, double* %1, double* %3, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  int i;
  for (i = 1;; i++) {
    printf("%ld\n", fibonacci(i));
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibonacci@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <fibonacci@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 @fibonacci(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %2, 2
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_SYS_GetBusClockFreq();
uint32_t CLOCK_SYS_GetPitFreq(uint32_t instance) {
  (void)instance;
  return CLOCK_SYS_GetBusClockFreq();
}


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

x86 assembly (clang, -O2):
<CLOCK_SYS_GetPitFreq>:
xor    %eax,%eax
jmp    1030 <CLOCK_SYS_GetBusClockFreq@plt>

LLVM IR (-O0):
define i32 @CLOCK_SYS_GetPitFreq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @CLOCK_SYS_GetBusClockFreq()
ret i32 %4
}

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetPitFreq(i32 %0) {
%2 = tail call i32 (...) @CLOCK_SYS_GetBusClockFreq()
ret i32 %2
}
int f7(int x, int y) {
  if (y <= -17 || y >= 0)
    __builtin_unreachable();
  return x % -y;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffef,-0x8(%rbp)
jle    111e <f7+0x1e>
cmpl   $0x0,-0x8(%rbp)
jl     111e <f7+0x1e>
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %edi,%eax
neg    %esi
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f7(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 = icmp sle i32 %5, -17
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %2
unreachable
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
%15 = srem i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f7(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, -17
tail call void @llvm.assume(i1 %3)
%4 = sub nsw i32 0, %1
%5 = srem i32 %0, %4
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double get_sec(clock_t start, clock_t end) {
  double t;
  t = (double)(end - start) / CLOCKS_PER_SEC;
  return t;
}


x86 assembly (clang, -O0):
<get_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2ec8(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sec>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_sec(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = sitofp i64 %8 to double
%10 = load double, double* @CLOCKS_PER_SEC
%11 = fdiv double %9, %10
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_sec(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
ret double %6
}
void ff_hevc_put_hevc_uni_w_qpel_v24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v24_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
void double_free(void) {
  char *ptr;
  ptr = (char *)malloc(32);
  free(ptr);
  free(ptr);
  return;
}


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

x86 assembly (clang, -O2):
<double_free>:
push   %rbx
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @double_free() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 32)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @free(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @double_free() {
%1 = tail call i64 @malloc(i32 32)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, float);
void get_init_cte(int ref, float val) {
  char line[140];
  sprintf(line, "var initcte #%d %f", ref, val);
  emit(line);
}


x86 assembly (clang, -O0):
<get_init_cte>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x4(%rbp),%edx
movss  -0x8(%rbp),%xmm0
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <emit@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_init_cte>:
push   %rbx
sub    $0x90,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <emit@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"var initcte #%d %f\00"
define void @get_init_cte(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca [140 x i8]
store i32 %0, i32* %3
store float %1, float* %4
%6 = getelementptr inbounds [140 x i8], [140 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load float, float* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, float %8)
%10 = getelementptr inbounds [140 x i8], [140 x i8]* %5, i64 0, i64 0
%11 = call i32 @emit(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"var initcte #%d %f\00"
define void @get_init_cte(i32 %0, float %1) {
%3 = alloca [140 x i8]
%4 = getelementptr inbounds [140 x i8], [140 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, float %1)
%6 = call i32 @emit(i8* %4)
ret void
}
int concat(int a, int b) {
  int p = 1;
  while (p < b) {
    p *= 10;
  }
  return a * p + b;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1129 <concat+0x29>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <concat+0x11>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1119 <concat+0x19>
mov    $0x1,%eax
nop
add    %eax,%eax
lea    (%rax,%rax,4),%eax
cmp    %esi,%eax
jl     1110 <concat+0x10>
imul   %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @concat(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 1, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 10
store i32 %12, i32* %5
br label %6
13: ; preds = %6
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @concat(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %8
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ 1, %2 ]
%6 = mul nsw i32 %5, 10
%7 = icmp slt i32 %6, %1
br i1 %7, label %4, label %8
8: ; preds = %4, %2
%9 = phi i32 [ 1, %2 ], [ %6, %4 ]
%10 = mul nsw i32 %9, %0
%11 = add nsw i32 %10, %1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ REV(int);
int main() {
  REV(5170984);
  REV(406567);
  REV(368750);
  REV(2369510);
  REV(2183293);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4ee728,%edi
call   1030 <REV@plt>
mov    $0x63427,%edi
call   1030 <REV@plt>
mov    $0x5a06e,%edi
call   1030 <REV@plt>
mov    $0x2427e6,%edi
call   1030 <REV@plt>
mov    $0x21507d,%edi
call   1030 <REV@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4ee728,%edi
call   1030 <REV@plt>
mov    $0x63427,%edi
call   1030 <REV@plt>
mov    $0x5a06e,%edi
call   1030 <REV@plt>
mov    $0x2427e6,%edi
call   1030 <REV@plt>
mov    $0x21507d,%edi
call   1030 <REV@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @REV(i32 5170984)
%3 = call i32 @REV(i32 406567)
%4 = call i32 @REV(i32 368750)
%5 = call i32 @REV(i32 2369510)
%6 = call i32 @REV(i32 2183293)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @REV(i32 5170984)
%2 = tail call i32 @REV(i32 406567)
%3 = tail call i32 @REV(i32 368750)
%4 = tail call i32 @REV(i32 2369510)
%5 = tail call i32 @REV(i32 2183293)
ret i32 0
}
/* Variables and functions */
void *malloc(unsigned int);
void *OsaMemAlloc(unsigned int len) { return malloc(len); }


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

x86 assembly (clang, -O2):
<OsaMemAlloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @OsaMemAlloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}