xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void call_green() {
  printf("signal green\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<call_green>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"signal green\0A\00"
@stdout = global i32 0
define void @call_green() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [13 x i8] c"signal green\00"
define void @call_green() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void StoreU32(uint8_t *pDestination, uint32_t value) {
  pDestination[0] = (value >> 0) & 0xff;
  pDestination[1] = (value >> 8) & 0xff;
  pDestination[2] = (value >> 16) & 0xff;
  pDestination[3] = (value >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<StoreU32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<StoreU32>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @StoreU32(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 = ashr i32 %5, 0
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = ashr i32 %20, 24
%22 = and i32 %21, 255
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 %22, i32* %24
ret void
}

LLVM IR (-O2):
define void @StoreU32(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = lshr i32 %1, 24
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
void do_shell(void) {}


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

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

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

LLVM IR (-O2):
define void @do_shell() {
ret void
}
void CameraParamsConfig(unsigned long ulBase, unsigned long ulHSPol,
                        unsigned long ulVSPol, unsigned long ulFlags) {
  unsigned long ulReg;
  ulReg = (*((volatile unsigned long *)(ulBase + 0x00000040)));
  ulFlags = (ulFlags | ulHSPol | ulVSPol);
  ulReg = ((ulReg & ~(0x00002000 | 0x00000200 | 0x00000100 | 0x00001000 |
                      0x00000800 | 0x00000400)) |
           ulFlags);
  (*((volatile unsigned long *)(ulBase + 0x00000040))) = ulReg;
}


x86 assembly (clang, -O0):
<CameraParamsConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
or     -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
and    $0xffffffffffffc0ff,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x40(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraParamsConfig>:
mov    $0xffffffffffffc0ff,%rax
and    0x40(%rdi),%rax
or     %rdx,%rsi
or     %rcx,%rsi
or     %rax,%rsi
mov    %rsi,0x40(%rdi)
ret

LLVM IR (-O0):
define void @CameraParamsConfig(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = add i64 %10, 64
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
store i64 %13, i64* %9
%14 = load i64, i64* %8
%15 = load i64, i64* %6
%16 = or i64 %14, %15
%17 = load i64, i64* %7
%18 = or i64 %16, %17
store i64 %18, i64* %8
%19 = load i64, i64* %9
%20 = and i64 %19, -16129
%21 = load i64, i64* %8
%22 = or i64 %20, %21
store i64 %22, i64* %9
%23 = load i64, i64* %9
%24 = load i64, i64* %5
%25 = add i64 %24, 64
%26 = inttoptr i64 %25 to i64*
store volatile i64 %23, i64* %26
ret void
}

LLVM IR (-O2):
define void @CameraParamsConfig(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %0, 64
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -16129
%9 = or i64 %2, %1
%10 = or i64 %9, %3
%11 = or i64 %10, %8
store volatile i64 %11, i64* %6
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ minipack_unpack_int(void *, size_t *);
void sky_set_int(void *target, void *value, size_t *sz) {
  *((int32_t *)target) = (int32_t)minipack_unpack_int(value, sz);
}


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

x86 assembly (clang, -O2):
<sky_set_int>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <minipack_unpack_int@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sky_set_int(i8* %0, i8* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64* %2, i64** %6
%7 = load i8*, i8** %5
%8 = load i64*, i64** %6
%9 = call i64 @minipack_unpack_int(i8* %7, i64* %8)
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
store i64 %9, i64* %11
ret void
}

LLVM IR (-O2):
define void @sky_set_int(i8* nocapture writeonly %0, i8* %1, i64* %2) {
%4 = tail call i64 @minipack_unpack_int(i8* %1, i64* %2)
%5 = bitcast i8* %0 to i64*
store i64 %4, i64* %5
ret void
}
void wifi_rsp_hardware_output_compare(
    const struct wifi_msg_hardware_output_compare_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_hardware_output_compare_rsp_t = type opaque
define void @wifi_rsp_hardware_output_compare(%struct.wifi_msg_hardware_output_compare_rsp_t* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_uni_pel_pixels6_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels6_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int, int);
void DoPlusPlace(void) { InlineWords(3, 77, 11, 79); }


x86 assembly (clang, -O0):
<DoPlusPlace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x4d,%esi
mov    $0xb,%edx
mov    $0x4f,%ecx
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoPlusPlace>:
mov    $0x3,%edi
mov    $0x4d,%esi
mov    $0xb,%edx
mov    $0x4f,%ecx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoPlusPlace() {
%1 = call i32 @InlineWords(i32 3, i32 77, i32 11, i32 79)
ret void
}

LLVM IR (-O2):
define void @DoPlusPlace() {
%1 = tail call i32 @InlineWords(i32 3, i32 77, i32 11, i32 79)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fcitx_utils_trim_helper(char *, char **, char **);
__attribute__((visibility("default"))) char *fcitx_utils_inplace_trim(char *s) {
  char *start, *end;
  fcitx_utils_trim_helper(s, &start, &end);
  *end = '\0';
  return start;
}


x86 assembly (clang, -O0):
<fcitx_utils_inplace_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <fcitx_utils_trim_helper@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_inplace_trim>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <fcitx_utils_trim_helper@plt>
mov    0x8(%rsp),%rax
movb   $0x0,(%rax)
mov    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i8* @fcitx_utils_inplace_trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fcitx_utils_trim_helper(i8* %5, i8** %3, i8** %4)
%7 = load i8*, i8** %4
store i8 0, i8* %7
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @fcitx_utils_inplace_trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast i8** %2 to i8*
%5 = bitcast i8** %3 to i8*
%6 = call i32 @fcitx_utils_trim_helper(i8* %0, i8** %2, i8** %3)
%7 = load i8*, i8** %3
store i8 0, i8* %7
%8 = load i8*, i8** %2
ret i8* %8
}
void __attribute__((__warning__(
    "curl_easy_setopt expects a curl_debug_callback argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_debug_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_debug_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void foo294() {}


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

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

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

LLVM IR (-O2):
define void @foo294() {
ret void
}
fge(x) long long int x;
{
  if (x >= 0)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     111f <fge+0x1f>
movl   $0xd,-0x4(%rbp)
jmp    1126 <fge+0x26>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fge>:
test   %rdi,%rdi
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fge(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sge i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 13, i32* %2
br label %8
7: ; preds = %1
store i32 140, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @fge(i64 %0) {
%2 = icmp sgt i64 %0, -1
%3 = select i1 %2, i32 13, i32 140
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ inform_int(int);
void fd_handler(int irq) { inform_int(6); }


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

x86 assembly (clang, -O2):
<fd_handler>:
mov    $0x6,%edi
jmp    1030 <inform_int@plt>

LLVM IR (-O0):
define void @fd_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @inform_int(i32 6)
ret void
}

LLVM IR (-O2):
define void @fd_handler(i32 %0) {
%2 = tail call i32 @inform_int(i32 6)
ret void
}
int is_in_range(int min, int max, int v) {
  return (((min) <= (max)) && ((min) <= (v)) && ((max) >= (v)));
}


x86 assembly (clang, -O0):
<is_in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     113b <is_in_range+0x3b>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     113b <is_in_range+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setge  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_range>:
cmp    %esi,%edi
setle  %al
cmp    %edx,%edi
setle  %cl
cmp    %edx,%esi
setge  %dl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_in_range(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = icmp sge i32 %15, %16
br label %18
18: ; preds = %14, %10, %3
%19 = phi i1 [ false, %10 ], [ false, %3 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_in_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %0, %1
%5 = icmp sle i32 %0, %2
%6 = icmp sge i32 %1, %2
%7 = and i1 %4, %5
%8 = and i1 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int allNoSurfaces(int mids[6]) {
  int mm, count = 0;
  for (mm = 0; mm < 18; mm++)
    if (mids[mm])
      count++;
  return (count);
}


x86 assembly (clang, -O0):
<allNoSurfaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x12,-0xc(%rbp)
jge    114e <allNoSurfaces+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113b <allNoSurfaces+0x3b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <allNoSurfaces+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <allNoSurfaces+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allNoSurfaces>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
movdqu 0x20(%rdi),%xmm2
movdqu 0x30(%rdi),%xmm3
pxor   %xmm4,%xmm4
pcmpeqd %xmm4,%xmm3
pcmpeqd %xmm5,%xmm5
pxor   %xmm5,%xmm3
pcmpeqd %xmm4,%xmm2
pxor   %xmm5,%xmm2
packssdw %xmm3,%xmm2
pcmpeqd %xmm4,%xmm1
pxor   %xmm5,%xmm1
pcmpeqd %xmm4,%xmm0
pxor   %xmm5,%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm2,%xmm0
pmovmskb %xmm0,%eax
mov    %eax,%ecx
shr    %ecx
and    $0x5555,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
and    $0x3333,%ecx
shr    $0x2,%eax
and    $0x3333,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
and    $0xf0f,%ecx
mov    %ecx,%eax
shl    $0x8,%eax
add    %ecx,%eax
movzbl %ah,%eax
cmpl   $0x1,0x40(%rdi)
sbb    $0xffffffff,%eax
cmpl   $0x1,0x44(%rdi)
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @allNoSurfaces(i32* nocapture %0) {
%2 = bitcast i32* %0 to <16 x i32>*
%3 = load <16 x i32>, <16 x i32>* %2
%4 = icmp ne <16 x i32> %3, zeroinitializer
%5 = getelementptr inbounds i32, i32* %0, i64 16
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = getelementptr inbounds i32, i32* %0, i64 17
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = bitcast <16 x i1> %4 to i16
%14 = call i16 @llvm.ctpop.i16(i16 %13)
%15 = zext i16 %14 to i32
%16 = add nuw nsw i32 %15, %8
%17 = add nuw nsw i32 %16, %12
ret i32 %17
}
void fill_spaces(char *string, int length, int num_spaces) {
  if (num_spaces > length) {
    num_spaces = length - 1;
  }
  for (int i = 0; i < num_spaces; i++) {
    string[i] = ' ';
  }
  string[num_spaces] = '\0';
}


x86 assembly (clang, -O0):
<fill_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1123 <fill_spaces+0x23>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1150 <fill_spaces+0x50>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <fill_spaces+0x2a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_spaces>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    -0x1(%rsi),%ebp
cmp    %esi,%edx
cmovle %edx,%ebp
test   %ebp,%ebp
jle    1131 <fill_spaces+0x21>
mov    %ebp,%edx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fill_spaces(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
%5 = add nsw i32 %1, -1
%6 = select i1 %4, i32 %5, i32 %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = zext i32 %6 to i64
br label %10
10: ; preds = %8, %3
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
ret void
}
unsigned int _shru2(unsigned int src1, unsigned int src2) {
  unsigned short hs1 = src1 >> 16;
  unsigned short ls1 = src1 & 0xFFFF;
  hs1 >>= src2;
  ls1 >>= src2;
  return (hs1 << 16) | ls1;
}


x86 assembly (clang, -O0):
<_shru2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %ax,-0xa(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
movzwl -0xa(%rbp),%eax
sar    %cl,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%ecx
movzwl -0xc(%rbp),%eax
sar    %cl,%eax
mov    %ax,-0xc(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x10,%eax
movzwl -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_shru2>:
mov    %esi,%ecx
mov    %edi,%eax
shr    $0x10,%eax
shr    %cl,%eax
movzwl %di,%edx
shr    %cl,%edx
shl    $0x10,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @_shru2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = lshr i32 %7, 16
%9 = trunc i32 %8 to i16
store i16 %9, i16* %5
%10 = load i32, i32* %3
%11 = and i32 %10, 65535
%12 = trunc i32 %11 to i16
store i16 %12, i16* %6
%13 = load i32, i32* %4
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, %13
%17 = trunc i32 %16 to i16
store i16 %17, i16* %5
%18 = load i32, i32* %4
%19 = load i16, i16* %6
%20 = zext i16 %19 to i32
%21 = ashr i32 %20, %18
%22 = trunc i32 %21 to i16
store i16 %22, i16* %6
%23 = load i16, i16* %5
%24 = zext i16 %23 to i32
%25 = shl i32 %24, 16
%26 = load i16, i16* %6
%27 = zext i16 %26 to i32
%28 = or i32 %25, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @_shru2(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = lshr i32 %3, %1
%5 = and i32 %0, 65535
%6 = lshr i32 %5, %1
%7 = shl nuw i32 %4, 16
%8 = or i32 %7, %6
ret i32 %8
}
struct gui_download_window *
kolibri_create_download_window(struct download_context *ctx,
                               struct gui_window *parent) {}


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

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

LLVM IR (-O0):
%struct.gui_download_window = type opaque
%struct.download_context = type opaque
%struct.gui_window = type opaque
define %struct.gui_download_window* @kolibri_create_download_window(%struct.download_context* %0, %struct.gui_window* %1) {
%3 = alloca %struct.gui_download_window*
%4 = alloca %struct.download_context*
%5 = alloca %struct.gui_window*
store %struct.download_context* %0, %struct.download_context** %4
store %struct.gui_window* %1, %struct.gui_window** %5
%6 = load %struct.gui_download_window*, %struct.gui_download_window** %3
ret %struct.gui_download_window* %6
}

LLVM IR (-O2):
%struct.gui_download_window = type opaque
%struct.download_context = type opaque
%struct.gui_window = type opaque
define noalias %struct.gui_download_window* @kolibri_create_download_window(%struct.download_context* nocapture readnone %0, %struct.gui_window* nocapture readnone %1) {
ret %struct.gui_download_window* undef
}
void printf128(__float128 f) {
  char s[128];
  quadmath_snprintf(s, 120, "%.50Qg", f);
  printf("%s", s);
}


x86 assembly (clang, -O0):
<printf128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movaps %xmm0,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
movaps -0x10(%rbp),%xmm0
mov    $0x78,%esi
lea    0xeba(%rip),%rdx
mov    $0x1,%al
call   1040 <quadmath_snprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf128>:
push   %rbx
sub    $0x80,%rsp
lea    0xed1(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x78,%esi
mov    $0x1,%al
call   1040 <quadmath_snprintf@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%.50Qg\00"
@.str.1 = [3 x i8] c"%s\00"
define void @printf128(fp128 %0) {
%2 = alloca fp128
%3 = alloca [128 x i8]
store fp128 %0, fp128* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load fp128, fp128* %2
%6 = call i32 (i8*, i32, i8*, fp128, ...) bitcast (i32 (...)* @quadmath_snprintf to i32 (i8*, i32, i8*, fp128, ...)*)(i8* %4, i32 120, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), fp128 %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.50Qg\00"
@.str.1 = [3 x i8] c"%s\00"
define void @printf128(fp128 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i32, i8*, fp128, ...) bitcast (i32 (...)* @quadmath_snprintf to i32 (i8*, i32, i8*, fp128, ...)*)(i8* %3, i32 120, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), fp128 %0)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O(int);
void w() { O(11); }


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

x86 assembly (clang, -O2):
<w>:
mov    $0xb,%edi
jmp    1030 <O@plt>

LLVM IR (-O0):
define void @w() {
%1 = call i32 @O(i32 11)
ret void
}

LLVM IR (-O2):
define void @w() {
%1 = tail call i32 @O(i32 11)
ret void
}
int compare_char_t_states(const void *ptr1, const void *ptr2) {
  return *(char *)ptr1 - *(char *)ptr2;
}


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

x86 assembly (clang, -O2):
<compare_char_t_states>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_char_t_states(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void test1(void) {
  int z;
  {
    z = 0;
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ help();
int /*<<< orphan*/ xfunc();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'x':
    xfunc();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(EXIT_SUCCESS);
    break;
  default:
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1b,%eax
je     11a3 <key+0x63>
jmp    1169 <key+0x29>
mov    -0x10(%rbp),%eax
sub    $0x68,%eax
je     1197 <key+0x57>
jmp    117a <key+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x78,%eax
jne    11b1 <key+0x71>
jmp    118b <key+0x4b>
mov    $0x0,%al
call   1050 <xfunc@plt>
jmp    11b6 <key+0x76>
mov    $0x0,%al
call   1040 <help@plt>
jmp    11b6 <key+0x76>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    11b6 <key+0x76>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
cmp    $0x68,%dil
je     1161 <key+0x21>
cmp    $0x78,%dil
je     116a <key+0x2a>
cmp    $0x1b,%dil
jne    1171 <key+0x31>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1040 <help@plt>
jmp    1171 <key+0x31>
xor    %eax,%eax
call   1050 <xfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glutPostRedisplay@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %16 [
i32 120, label %9
i32 104, label %11
i32 27, label %13
]
9: ; preds = %3
%10 = call i32 (...) @xfunc()
br label %17
11: ; preds = %3
%12 = call i32 (...) @help()
br label %17
13: ; preds = %3
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %3
br label %17
17: ; preds = %16, %11, %9
%18 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %11 [
i8 120, label %4
i8 104, label %6
i8 27, label %8
]
4: ; preds = %3
%5 = tail call i32 (...) @xfunc()
br label %11
6: ; preds = %3
%7 = tail call i32 (...) @help()
br label %11
8: ; preds = %3
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3, %6, %4
%12 = tail call i32 (...) @glutPostRedisplay()
ret void
}
void gl_shader_use(unsigned index) {}


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

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

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

LLVM IR (-O2):
define void @gl_shader_use(i32 %0) {
ret void
}
void test72_Test_13_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test72_Test_13_targetInit__I() {
ret void
}
int obs_indx(int c) {
  switch (c) {
  case 'H':
    return (1);
  case 'E':
    return (2);
  case 'C':
    return (3);
  case 'X':
    return (0);
  }
}


x86 assembly (clang, -O0):
<obs_indx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     115b <obs_indx+0x5b>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    115b <obs_indx+0x5b>
movl   $0x2,-0x4(%rbp)
jmp    115b <obs_indx+0x5b>
movl   $0x3,-0x4(%rbp)
jmp    115b <obs_indx+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<obs_indx>:
cmp    $0x43,%edi
je     111a <obs_indx+0x1a>
cmp    $0x58,%edi
je     1120 <obs_indx+0x20>
mov    $0x1,%eax
cmp    $0x45,%edi
jne    1122 <obs_indx+0x22>
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @obs_indx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 72, label %5
i32 69, label %6
i32 67, label %7
i32 88, label %8
]
5: ; preds = %1
store i32 1, i32* %2
br label %9
6: ; preds = %1
store i32 2, i32* %2
br label %9
7: ; preds = %1
store i32 3, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %5, %6, %7, %8, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @obs_indx(i32 %0) {
switch i32 %0, label %5 [
i32 88, label %4
i32 69, label %2
i32 67, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %2, %3, %4, %1
%6 = phi i32 [ 0, %4 ], [ 3, %3 ], [ 2, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf(
      "usage: collect [--add|--remove] [--debug] <checkpoint> <id> <idlist>\n"
      "\n"
      "  Adds ID <id> to the list governed by <checkpoint>.\n"
      "  <id> must be part of the list <idlist>.\n"
      "  If all IDs given by <idlist> are listed (ie collect has been\n"
      "  invoked for each ID in <idlist>) collect returns 0, the\n"
      "  number of missing IDs otherwise.\n"
      "  On error a negative number is returned.\n"
      "\n");
}


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

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

LLVM IR (-O0):
@.str = [365 x i8] c"usage: collect [--add|--remove] [--debug] <checkpoint> <id> <idlist>\0A\0A Adds ID <id> to the list governed by <checkpoint>.\0A <id> must be part of the list <idlist>.\0A If all IDs given by <idlist> are listed (ie collect has been\0A invoked for each ID in <idlist>) collect returns 0, the\0A number of missing IDs otherwise.\0A On error a negative number is returned.\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([365 x i8], [365 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [364 x i8] c"usage: collect [--add|--remove] [--debug] <checkpoint> <id> <idlist>\0A\0A Adds ID <id> to the list governed by <checkpoint>.\0A <id> must be part of the list <idlist>.\0A If all IDs given by <idlist> are listed (ie collect has been\0A invoked for each ID in <idlist>) collect returns 0, the\0A number of missing IDs otherwise.\0A On error a negative number is returned.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([364 x i8], [364 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int _argc, char *_argv[]) {
  printf("Hi!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [4 x i8] c"Hi!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ affiche();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Début du programme\n");
  affiche();
  printf("Fin du programme\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"D\C3\A9but du programme\0A\00"
@.str.1 = [18 x i8] c"Fin du programme\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @affiche()
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"D\C3\A9but du programme\00"
@str.2 = [17 x i8] c"Fin du programme\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @affiche()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ configure_display(char *, int);
int /*<<< orphan*/ init_display(int);
int /*<<< orphan*/ test_display();
int main() {
  configure_display("/dev/i2c-1", 0x3c);
  init_display(0x06);
  test_display();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x3c,%esi
call   1050 <configure_display@plt>
mov    $0x6,%edi
call   1030 <init_display@plt>
mov    $0x0,%al
call   1040 <test_display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x3c,%esi
call   1050 <configure_display@plt>
mov    $0x6,%edi
call   1030 <init_display@plt>
xor    %eax,%eax
call   1040 <test_display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/i2c-1\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @configure_display(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 60)
%3 = call i32 @init_display(i32 6)
%4 = call i32 (...) @test_display()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/i2c-1\00"
define i32 @main() {
%1 = tail call i32 @configure_display(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 60)
%2 = tail call i32 @init_display(i32 6)
%3 = tail call i32 (...) @test_display()
ret i32 0
}
void env_mux_reset(const struct XCSF *xcsf) { (void)xcsf; }


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

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

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

LLVM IR (-O2):
%struct.XCSF = type opaque
define void @env_mux_reset(%struct.XCSF* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sock_shutdown();
void im_thread_destroy() { sock_shutdown(); }


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

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

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

LLVM IR (-O2):
define void @im_thread_destroy() {
%1 = tail call i32 (...) @sock_shutdown()
ret void
}
void glGetIntegeri_v(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetIntegeri_v() {
ret void
}
void IRQ_Routine(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<IRQ_Routine>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <IRQ_Routine+0x9>
jmp    1109 <IRQ_Routine+0x9>

x86 assembly (clang, -O2):
<IRQ_Routine>:
jmp    1100 <IRQ_Routine>

LLVM IR (-O0):
define void @IRQ_Routine() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @IRQ_Routine() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned short pow(int, unsigned char);
void flags_set_word(unsigned short *p_flag, unsigned char pos) {
  assert(pos >= 0 && pos <= 15);
  unsigned short to_mul = pow(2, pos);
  *p_flag = (*p_flag | to_mul);
}


x86 assembly (clang, -O0):
<flags_set_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jl     1151 <flags_set_word+0x31>
movzbl -0x9(%rbp),%eax
cmp    $0xf,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2,%edi
movzbl -0x9(%rbp),%esi
call   1040 <pow@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
movzwl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flags_set_word>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x10,%bl
setb   %dil
call   1030 <assert@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
or     %ax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @flags_set_word(i16* %0, i8 zeroext %1) {
%3 = alloca i16*
%4 = alloca i8
%5 = alloca i16
store i16* %0, i16** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = icmp sle i32 %11, 15
br label %13
13: ; preds = %9, %2
%14 = phi i1 [ false, %2 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i8, i8* %4
%18 = call zeroext i16 @pow(i32 2, i8 zeroext %17)
store i16 %18, i16* %5
%19 = load i16*, i16** %3
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = load i16, i16* %5
%23 = zext i16 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i16
%26 = load i16*, i16** %3
store i16 %25, i16* %26
ret void
}

LLVM IR (-O2):
define void @flags_set_word(i16* nocapture %0, i8 zeroext %1) {
%3 = icmp ult i8 %1, 16
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call zeroext i16 @pow(i32 2, i8 zeroext %1)
%7 = load i16, i16* %0
%8 = or i16 %7, %6
store i16 %8, i16* %0
ret void
}
double test_remquo(double x, double y, int *z) {
  return __builtin_remquo(x, y, z);
}


x86 assembly (clang, -O0):
<test_remquo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rdi
call   1030 <remquo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_remquo>:
jmp    1030 <remquo@plt>

LLVM IR (-O0):
define double @test_remquo(double %0, double %1, i32* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32*
store double %0, double* %4
store double %1, double* %5
store i32* %2, i32** %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load i32*, i32** %6
%10 = call double @remquo(double %7, double %8, i32* %9)
ret double %10
}

LLVM IR (-O2):
define double @test_remquo(double %0, double %1, i32* %2) {
%4 = tail call double @remquo(double %0, double %1, i32* %2)
ret double %4
}
/* Type definitions */
struct iw_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ iw_translatef(struct iw_context *, int /*<<< orphan*/,
                                 char *, int, char *, char *, char *);
char *iw_get_copyright_string(struct iw_context *ctx, char *dst, int dstlen) {
  iw_translatef(ctx, 0, dst, dstlen, "Copyright \xc2\xa9 %s %s",
                "2011"
                "\xe2\x80\x93"
                "2014",
                "Jason Summers");
  return dst;
}


x86 assembly (clang, -O0):
<iw_get_copyright_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %esi,%esi
lea    0xec9(%rip),%r8
lea    0xed5(%rip),%r9
lea    0xeda(%rip),%rax
mov    %rax,(%rsp)
call   1030 <iw_translatef@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_get_copyright_string>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ecx
mov    %rsi,%rbx
lea    0xefe(%rip),%rax
mov    %rax,(%rsp)
lea    0xed4(%rip),%r8
lea    0xee0(%rip),%r9
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <iw_translatef@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.iw_context = type { i32 }
@.str = [19 x i8] c"Copyright \C2\A9 %s %s\00"
@.str.1 = [12 x i8] c"2011\E2\80\932014\00"
@.str.2 = [14 x i8] c"Jason Summers\00"
define i8* @iw_get_copyright_string(%struct.iw_context* %0, i8* %1, i32 %2) {
%4 = alloca %struct.iw_context*
%5 = alloca i8*
%6 = alloca i32
store %struct.iw_context* %0, %struct.iw_context** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.iw_context*, %struct.iw_context** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @iw_translatef(%struct.iw_context* %7, i32 0, i8* %8, i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
%struct.iw_context = type { i32 }
@.str = [19 x i8] c"Copyright \C2\A9 %s %s\00"
@.str.1 = [12 x i8] c"2011\E2\80\932014\00"
@.str.2 = [14 x i8] c"Jason Summers\00"
define i8* @iw_get_copyright_string(%struct.iw_context* %0, i8* returned %1, i32 %2) {
%4 = tail call i32 @iw_translatef(%struct.iw_context* %0, i32 0, i8* %1, i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i8* %1
}
void stripline(char *ptr) {
  for (; ptr && *ptr; ++ptr) {
    if ('\r' == *ptr || '\n' == *ptr) {
      *ptr = 0;
      return;
    }
  }
}


x86 assembly (clang, -O0):
<stripline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <stripline+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1138 <stripline+0x38>
jmp    1182 <stripline+0x82>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0xd,%eax
cmp    %ecx,%eax
je     1160 <stripline+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    116c <stripline+0x6c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1182 <stripline+0x82>
jmp    1171 <stripline+0x71>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <stripline+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripline>:
test   %rdi,%rdi
je     1128 <stripline+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%eax
test   %al,%al
je     1128 <stripline+0x28>
cmp    $0xd,%al
je     1125 <stripline+0x25>
cmp    $0xa,%al
je     1125 <stripline+0x25>
add    $0x1,%rdi
jmp    1110 <stripline+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @stripline(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 13, label %6
i8 10, label %6
]
6: ; preds = %3, %3
store i8 0, i8* %4
br label %9
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %1, %6
ret void
}