xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
void pclosep(FILE **f) {
  if (*f)
    pclose(*f);
}


x86 assembly (clang, -O0):
<pclosep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <pclosep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pclosep>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <pclosep+0xd>
jmp    1030 <pclose@plt>
ret

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

LLVM IR (-O2):
define void @pclosep(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_121() {
  Assert_real((isqrt(121) == 11),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              610, ("Integer square root of 121 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_121>:
push   %rbp
mov    %rsp,%rbp
mov    $0x79,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x262,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_121>:
push   %rax
mov    $0x79,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x262,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 121 should be 11\00"
define void @t_sqrt_121() {
%1 = call i32 @isqrt(i32 121)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 121 should be 11\00"
define void @t_sqrt_121() {
%1 = tail call i32 @isqrt(i32 121)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int foo(long double x) {
  struct {
    char a[8];
    unsigned int b : 7;
  } c;
  __builtin_memcpy(&c, &x, sizeof(c));
  return c.b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%al
and    $0x7f,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movzwl 0x10(%rsp),%eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
%struct.anon = type { [8 x i8], i8, [3 x i8] }
define i32 @foo(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca %struct.anon
store x86_fp80 %0, x86_fp80* %2
%4 = bitcast %struct.anon* %3 to i8*
%5 = bitcast x86_fp80* %2 to i8*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 1
%7 = load i8, i8* %6
%8 = and i8 %7, 127
%9 = zext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = lshr i80 %2, 64
%4 = trunc i80 %3 to i32
%5 = and i32 %4, 127
ret i32 %5
}
float AngleFind(float input) { return 180.0 / input; }


x86 assembly (clang, -O0):
<AngleFind>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AngleFind>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @AngleFind(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double 1.800000e+02, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @AngleFind(float %0) {
%2 = fdiv float 1.800000e+02, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ cdio_add_device_list(char ***, void *, unsigned int *);
char **cdio_get_devices_nrg(void) {
  char **drives = ((void *)0);
  unsigned int num_files = 0;
  cdio_add_device_list(&drives, "image.nrg", &num_files);
  cdio_add_device_list(&drives, ((void *)0), &num_files);
  return drives;
}


x86 assembly (clang, -O0):
<cdio_get_devices_nrg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <cdio_add_device_list@plt>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1030 <cdio_add_device_list@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdio_get_devices_nrg>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xed1(%rip),%rsi
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <cdio_add_device_list@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <cdio_add_device_list@plt>
mov    0x10(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"image.nrg\00"
define i8** @cdio_get_devices_nrg() {
%1 = alloca i8**
%2 = alloca i32
store i8** null, i8*** %1
store i32 0, i32* %2
%3 = call i32 @cdio_add_device_list(i8*** %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = call i32 @cdio_add_device_list(i8*** %1, i8* null, i32* %2)
%5 = load i8**, i8*** %1
ret i8** %5
}

LLVM IR (-O2):
@.str = [10 x i8] c"image.nrg\00"
define i8** @cdio_get_devices_nrg() {
%1 = alloca i8**
%2 = alloca i32
%3 = bitcast i8*** %1 to i8*
store i8** null, i8*** %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @cdio_add_device_list(i8*** %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @cdio_add_device_list(i8*** %1, i8* null, i32* %2)
%7 = load i8**, i8*** %1
ret i8** %7
}
/* Variables and functions */
char const *strerror(int);
const char *grid_err_strerror(int errnum) {
  switch (errnum) {
  case (156384712 + 53):
    return "Nanomsg library was terminated";
  case (156384712 + 54):
    return "Operation cannot be performed in this state";
  default:
    return strerror(errnum);
  }
}


x86 assembly (clang, -O0):
<grid_err_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x9523dfd,%eax
je     1144 <grid_err_strerror+0x34>
jmp    1131 <grid_err_strerror+0x21>
mov    -0x10(%rbp),%eax
sub    $0x9523dfe,%eax
je     1154 <grid_err_strerror+0x44>
jmp    1164 <grid_err_strerror+0x54>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <grid_err_strerror+0x60>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <grid_err_strerror+0x60>
mov    -0xc(%rbp),%edi
call   1030 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_err_strerror>:
cmp    $0x9523dfd,%edi
je     1128 <grid_err_strerror+0x18>
cmp    $0x9523dfe,%edi
jne    1130 <grid_err_strerror+0x20>
lea    0xef8(%rip),%rax
ret
lea    0xed1(%rip),%rax
ret
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Nanomsg library was terminated\00"
@.str.1 = [44 x i8] c"Operation cannot be performed in this state\00"
define i8* @grid_err_strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 156384765, label %5
i32 156384766, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i8* @strerror(i32 %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [31 x i8] c"Nanomsg library was terminated\00"
@.str.1 = [44 x i8] c"Operation cannot be performed in this state\00"
define i8* @grid_err_strerror(i32 %0) {
switch i32 %0, label %3 [
i32 156384765, label %5
i32 156384766, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = tail call i8* @strerror(i32 %0)
br label %5
5: ; preds = %1, %3, %2
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ RTM_GETADDR;
int /*<<< orphan*/ SendRequest(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int32_t NetlinkSendGetAddr(int32_t fd, uint32_t seq_num) {
  return SendRequest(fd, seq_num, RTM_GETADDR);
}


x86 assembly (clang, -O0):
<NetlinkSendGetAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1030 <SendRequest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NetlinkSendGetAddr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <SendRequest@plt>

LLVM IR (-O0):
@RTM_GETADDR = global i32 0
define i32 @NetlinkSendGetAddr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* @RTM_GETADDR
%8 = call i32 @SendRequest(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@RTM_GETADDR = global i32 0
define i32 @NetlinkSendGetAddr(i32 %0, i32 %1) {
%3 = load i32, i32* @RTM_GETADDR
%4 = tail call i32 @SendRequest(i32 %0, i32 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
void *__ioremap(unsigned long, unsigned long, int);
void *ioremap(unsigned long physaddr, unsigned long size) {
  return __ioremap(physaddr, size, 1);
}


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

x86 assembly (clang, -O2):
<ioremap>:
mov    $0x1,%edx
jmp    1030 <__ioremap@plt>

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

LLVM IR (-O2):
define i8* @ioremap(i64 %0, i64 %1) {
%3 = tail call i8* @__ioremap(i64 %0, i64 %1, i32 1)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int data__strref_qsort(const void *a, const void *b) {
  uint32_t aval, bval;
  aval = *(uint32_t *)a;
  bval = *(uint32_t *)b;
  if (aval > bval)
    return 1;
  if (aval == bval)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<data__strref_qsort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <data__strref_qsort+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <data__strref_qsort+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <data__strref_qsort+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <data__strref_qsort+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<data__strref_qsort>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setne  %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @data__strref_qsort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int hash_function(char *value) {
  unsigned int hash = 0;
  while (*value != 0) {
  }
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1124 <hash_function+0x24>
jmp    110f <hash_function+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
cmpb   $0x0,(%rdi)
je     1112 <hash_function+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <hash_function+0x10>
ret

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

LLVM IR (-O2):
define i32 @hash_function(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1, %4
br label %4
5: ; preds = %1
ret i32 undef
}
line(x0, y0, x1, y1) int x0, y0, x1, y1;
{ printf("line(%d,%d,%d,%d)\n", x0, y0, x1, y1); }


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"line(%d,%d,%d,%d)\0A\00"
define i32 @line(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 undef
}
/* Type definitions */
struct qcam {
  int dummy;
};

/* Variables and functions */
int qc_lock_wait(struct qcam *, int);
int qc_lock(struct qcam *q) { return qc_lock_wait(q, 1); }


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

x86 assembly (clang, -O2):
<qc_lock>:
mov    $0x1,%esi
jmp    1030 <qc_lock_wait@plt>

LLVM IR (-O0):
%struct.qcam = type { i32 }
define i32 @qc_lock(%struct.qcam* %0) {
%2 = alloca %struct.qcam*
store %struct.qcam* %0, %struct.qcam** %2
%3 = load %struct.qcam*, %struct.qcam** %2
%4 = call i32 @qc_lock_wait(%struct.qcam* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.qcam = type { i32 }
define i32 @qc_lock(%struct.qcam* %0) {
%2 = tail call i32 @qc_lock_wait(%struct.qcam* %0, i32 1)
ret i32 %2
}
putch(ch) char ch;
{ putchar(ch); }


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
movsbl %dil,%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define i32 @putch(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @putch(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
/* Variables and functions */
float sqrt(int);
float ANTweenTimingFunctionCircOut(float time, float begin, float change,
                                   float duration) {
  time = time / duration - 1;
  return change * sqrt(1 - time * time) + begin;
}


x86 assembly (clang, -O0):
<ANTweenTimingFunctionCircOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe8c(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenTimingFunctionCircOut>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
addss  0xed8(%rip),%xmm0
mulss  %xmm0,%xmm0
movss  0xed0(%rip),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <sqrt@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ANTweenTimingFunctionCircOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %8
%11 = fdiv float %9, %10
%12 = fsub float %11, 1.000000e+00
store float %12, float* %5
%13 = load float, float* %7
%14 = load float, float* %5
%15 = load float, float* %5
%16 = fneg float %14
%17 = call float @llvm.fmuladd.f32(float %16, float %15, float 1.000000e+00)
%18 = fptosi float %17 to i32
%19 = call float @sqrt(i32 %18)
%20 = load float, float* %6
%21 = call float @llvm.fmuladd.f32(float %13, float %19, float %20)
ret float %21
}

LLVM IR (-O2):
define float @ANTweenTimingFunctionCircOut(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fadd float %5, -1.000000e+00
%7 = fneg float %6
%8 = tail call float @llvm.fmuladd.f32(float %7, float %6, float 1.000000e+00)
%9 = fptosi float %8 to i32
%10 = tail call float @sqrt(i32 %9)
%11 = tail call float @llvm.fmuladd.f32(float %2, float %10, float %1)
ret float %11
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, char const *, char const *);
int shim_removexattr(const char *path, const char *name) {
  return (int)shim_enosys(0, path, name);
}


x86 assembly (clang, -O0):
<shim_removexattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_removexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_removexattr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @shim_enosys(i32 0, i8* %5, i8* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @shim_removexattr(i8* %0, i8* %1) {
%3 = tail call i64 @shim_enosys(i32 0, i8* %0, i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(uint32_t n) {
  while (n-- > 0) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1140 <indent+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <indent+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <indent+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AuxMagSensorHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void AuxMagSensorUpdated() { UAVObjUpdated(AuxMagSensorHandle()); }


x86 assembly (clang, -O0):
<AuxMagSensorUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AuxMagSensorHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AuxMagSensorUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <AuxMagSensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @AuxMagSensorUpdated() {
%1 = call i32 (...) @AuxMagSensorHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AuxMagSensorUpdated() {
%1 = tail call i32 (...) @AuxMagSensorHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void INT_Excep_TMR3_CMI3A(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TMR3_CMI3A() {
ret void
}
unsigned long int own_ntohl(unsigned long int in) {
  unsigned char a[4], t;
  memcpy(a, &in, 4);
  t = a[3];
  a[3] = a[0];
  a[0] = t;
  t = a[2];
  a[2] = a[1];
  a[1] = t;
  memcpy(&in, a, 4);
  return in;
}


x86 assembly (clang, -O0):
<own_ntohl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0xc(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<own_ntohl>:
mov    %edi,%ecx
shr    $0x18,%ecx
movabs $0xffffffff00000000,%rax
ff ff ff
and    %rdi,%rax
mov    %edi,%edx
shl    $0x18,%edx
or     %rax,%rdx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %rdx,%rax
shr    $0x8,%rdi
and    $0xff00,%edi
or     %rdi,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @own_ntohl(i64 %0) {
%2 = alloca i64
%3 = alloca [4 x i8]
%4 = alloca i8
store i64 %0, i64* %2
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = bitcast i64* %2 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %10, i8* %11
%12 = load i8, i8* %4
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %12, i8* %13
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%15 = load i8, i8* %14
store i8 %15, i8* %4
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%17 = load i8, i8* %16
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %17, i8* %18
%19 = load i8, i8* %4
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %19, i8* %20
%21 = bitcast i64* %2 to i8*
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @own_ntohl(i64 %0) {
%2 = lshr i64 %0, 24
%3 = and i64 %0, -4294967296
%4 = shl i64 %0, 24
%5 = and i64 %4, 4278190080
%6 = or i64 %5, %3
%7 = shl i64 %0, 8
%8 = and i64 %7, 16711680
%9 = or i64 %6, %8
%10 = lshr i64 %0, 8
%11 = and i64 %10, 65280
%12 = or i64 %9, %11
%13 = and i64 %2, 255
%14 = or i64 %12, %13
ret i64 %14
}
char *XFetchBuffer() {}


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

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

LLVM IR (-O0):
define i8* @XFetchBuffer() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @XFetchBuffer() {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t gotcha_gettid() { return syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<gotcha_gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotcha_gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @gotcha_gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @gotcha_gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
char *strrchr(const char *s, int c) {
  const char *last = 0;
  do {
    if (*s == (char)c)
      last = s;
  } while (*s++);
  return (char *)last;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <strrchr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
movsbl %sil,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbl (%rdi),%edx
cmp    %edx,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %edx,%edx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %12, %5 ]
%7 = phi i8* [ null, %2 ], [ %11, %5 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %4, %9
%11 = select i1 %10, i8* %6, i8* %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ gsitp(char *, int);
void g_clockid_t() { gsitp("clockid_t", sizeof(clockid_t)); }


x86 assembly (clang, -O0):
<g_clockid_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <gsitp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_clockid_t>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <gsitp@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"clockid_t\00"
define void @g_clockid_t() {
%1 = call i32 @gsitp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"clockid_t\00"
define void @g_clockid_t() {
%1 = tail call i32 @gsitp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Type definitions */
struct endpoint {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wsd_send_bye(struct endpoint *);
void wsd_exit(struct endpoint *ep) { wsd_send_bye(ep); }


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

x86 assembly (clang, -O2):
<wsd_exit>:
jmp    1030 <wsd_send_bye@plt>

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

LLVM IR (-O2):
%struct.endpoint = type { i32 }
define void @wsd_exit(%struct.endpoint* %0) {
%2 = tail call i32 @wsd_send_bye(%struct.endpoint* %0)
ret void
}
/* Variables and functions */
const char *quit(int argc, char *argv[]) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @quit(i32 %0, i8** nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AESIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0xFFFFA020))) |=
      (((ui32IntFlags & 0x00010000) >> 16) |
       ((ui32IntFlags & 0x00060000) >> 15) |
       ((ui32IntFlags & 0x00080000) >> 18));
  (*((volatile uint32_t *)(ui32Base + 0x00000090))) |=
      ui32IntFlags & 0x0000ffff;
}


x86 assembly (clang, -O0):
<AESIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0x10000,%edx
sar    $0x10,%edx
mov    -0x8(%rbp),%eax
and    $0x60000,%eax
sar    $0xf,%eax
or     %eax,%edx
mov    -0x8(%rbp),%eax
and    $0x80000,%eax
sar    $0x12,%eax
or     %eax,%edx
mov    -0x4(%rbp),%eax
add    $0xffffa020,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0xffff,%edx
mov    -0x4(%rbp),%eax
add    $0x90,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESIntEnable>:
mov    %esi,%eax
mov    %esi,%ecx
movzwl %si,%edx
shr    $0x10,%esi
and    $0x1,%esi
shr    $0xf,%eax
and    $0xc,%eax
or     %esi,%eax
shr    $0x12,%ecx
and    $0x2,%ecx
or     %eax,%ecx
lea    -0x5fe0(%rdi),%eax
or     %ecx,(%rax)
movslq %edi,%rax
or     %edx,0x90(%rax)
ret

LLVM IR (-O0):
define void @AESIntEnable(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 = and i32 %5, 65536
%7 = ashr i32 %6, 16
%8 = load i32, i32* %4
%9 = and i32 %8, 393216
%10 = ashr i32 %9, 15
%11 = or i32 %7, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 524288
%14 = ashr i32 %13, 18
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = add i32 %16, -24544
%18 = zext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = or i32 %20, %15
store volatile i32 %21, i32* %19
%22 = load i32, i32* %4
%23 = and i32 %22, 65535
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 144
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load volatile i32, i32* %27
%29 = or i32 %28, %23
store volatile i32 %29, i32* %27
ret void
}

LLVM IR (-O2):
define void @AESIntEnable(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 1
%5 = lshr i32 %1, 15
%6 = and i32 %5, 12
%7 = or i32 %4, %6
%8 = lshr i32 %1, 18
%9 = and i32 %8, 2
%10 = or i32 %7, %9
%11 = add i32 %0, -24544
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = or i32 %10, %14
store volatile i32 %15, i32* %13
%16 = and i32 %1, 65535
%17 = add nsw i32 %0, 144
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
%20 = load volatile i32, i32* %19
%21 = or i32 %20, %16
store volatile i32 %21, i32* %19
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ createDatabase(char *);
int /*<<< orphan*/ puts(char *);
void doesDatabaseExist(char *databaseName) {
  if (access(databaseName, F_OK) != -1) {
  } else {
    createDatabase(databaseName);
    puts("Database created. Default login: admin, 123456");
  }
}


x86 assembly (clang, -O0):
<doesDatabaseExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0xffffffff,%eax
je     115c <doesDatabaseExist+0x2c>
jmp    1171 <doesDatabaseExist+0x41>
mov    -0x8(%rbp),%rdi
call   1040 <createDatabase@plt>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doesDatabaseExist>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0xffffffff,%eax
je     1149 <doesDatabaseExist+0x19>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <createDatabase@plt>
lea    0xea8(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@F_OK = global i32 0
@.str = [47 x i8] c"Database created. Default login: admin, 123456\00"
define void @doesDatabaseExist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* %3, i32 %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
br label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @createDatabase(i8* %9)
%11 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@F_OK = global i32 0
@.str = [47 x i8] c"Database created. Default login: admin, 123456\00"
define void @doesDatabaseExist(i8* %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @createDatabase(i8* %0)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %5
ret void
}
int main() {
  int *p;
  int a;
  p = &a;
  *p = 3;
  p++;
  p--;
  return *p == a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32* %3, i32** %2
%4 = load i32*, i32** %2
store i32 3, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i32 -1
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = load i32, i32* %3
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
const char *_Locale_true(struct _Locale_numeric *lnum
                         __attribute__((__unused__))) {
  return "true";
}


x86 assembly (clang, -O0):
<_Locale_true>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_numeric = type opaque
@.str = [5 x i8] c"true\00"
define i8* @_Locale_true(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_numeric = type opaque
@.str = [5 x i8] c"true\00"
define i8* @_Locale_true(%struct._Locale_numeric* nocapture readnone %0) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ printf(char *);
void bar(void) {
  foo();
  printf("bar()\n");
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <foo@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"bar()\0A\00"
define void @bar() {
%1 = call i32 (...) @foo()
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"bar()\00"
define void @bar() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ system(char *);
void Focus(int focuscmd, int focusspd) {
  char cmdstr[256];
  sprintf(cmdstr, "setfocus %d %d 1>/dev/null 2>/dev/null", focuscmd, focusspd);
  system(cmdstr);
}


x86 assembly (clang, -O0):
<Focus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Focus>:
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xecd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"setfocus %d %d 1>/dev/null 2>/dev/null\00"
define void @Focus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"setfocus %d %d 1>/dev/null 2>/dev/null\00"
define void @Focus(i32 %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(char const *s) {
  char *d = malloc(strlen(s) + 1);
  if (d == NULL)
    return NULL;
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ ulz77_error_description_cpy(char *, int, int);
int ulz77_error_description_print(int err_no) {
  char buffer[4096];
  ulz77_error_description_cpy(buffer, 4096, err_no);
  fprintf(stderr, "Error : %s\n", buffer);
  return 0;
}


x86 assembly (clang, -O0):
<ulz77_error_description_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1010(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x1000,%esi
call   1040 <ulz77_error_description_cpy@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    -0x1010(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulz77_error_description_print>:
push   %rbx
sub    $0x1000,%rsp
mov    %edi,%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1040 <ulz77_error_description_cpy@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"Error : %s\0A\00"
define i32 @ulz77_error_description_print(i32 %0) {
%2 = alloca i32
%3 = alloca [4096 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @ulz77_error_description_cpy(i8* %4, i32 4096, i32 %5)
%7 = load i32, i32* @stderr
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"Error : %s\0A\00"
define i32 @ulz77_error_description_print(i32 %0) {
%2 = alloca [4096 x i8]
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%4 = call i32 @ulz77_error_description_cpy(i8* %3, i32 4096, i32 %0)
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct _Locale_numeric {
  int dummy;
};
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_numeric *_Locale_numeric_create(const char *name,
                                               struct _Locale_name_hint *hint,
                                               int *__err_code) {
  return (struct _Locale_numeric *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_numeric_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_numeric = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_numeric* @_Locale_numeric_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_numeric*
ret %struct._Locale_numeric* %10
}

LLVM IR (-O2):
%struct._Locale_numeric = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_numeric* @_Locale_numeric_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_numeric*
ret %struct._Locale_numeric* %5
}