xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void print_usage(bool err) {
  fprintf(err ? stderr : stdout,
          "Usage: bckp <srcdir> <destdir> <dt> &\n"
          "  srcdir  - directory to backup;\n"
          "  destdir - destination of the backup;\n"
          "  dt      - interval between scannings of srcdir, in seconds.\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <print_usage+0x26>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <print_usage+0x32>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
test   %edi,%edi
jne    111d <print_usage+0xd>
mov    0x2ebd(%rip),%rax
jmp    1124 <print_usage+0x14>
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [173 x i8] c"Usage: bckp <srcdir> <destdir> <dt> &\0A srcdir - directory to backup;\0A destdir - destination of the backup;\0A dt - interval between scannings of srcdir, in seconds.\0A\00"
define void @print_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [173 x i8] c"Usage: bckp <srcdir> <destdir> <dt> &\0A srcdir - directory to backup;\0A destdir - destination of the backup;\0A dt - interval between scannings of srcdir, in seconds.\0A\00"
define void @print_usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0))
ret void
}
int kgsl_mmu_close(struct kgsl_device *device) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_device = type opaque
define i32 @kgsl_mmu_close(%struct.kgsl_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func_sigint(int signum) {
  printf("You can stop me by CTRL + C!\n");
  printf("Count down to exit:  \n");
  return;
}


x86 assembly (clang, -O0):
<func_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_sigint>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"You can stop me by CTRL + C!\0A\00"
@.str.1 = [23 x i8] c"Count down to exit: \0A\00"
define void @func_sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"You can stop me by CTRL + C!\00"
@str.2 = [22 x i8] c"Count down to exit: \00"
define void @func_sigint(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret void
}
int cmp_char_asc(const void *x, const void *y) {
  if (*(char *)x < *(char *)y) {
    return -1;
  } else if (*(char *)x > *(char *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_char_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    112e <cmp_char_asc+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <cmp_char_asc+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    1150 <cmp_char_asc+0x50>
movl   $0x1,-0x4(%rbp)
jmp    115c <cmp_char_asc+0x5c>
jmp    1155 <cmp_char_asc+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_char_asc>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_char_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
void *malloc(size_t);
void *calloc(size_t number, size_t size) {
  void *ptr = malloc(number * size);
  unsigned char *cptr = (unsigned char *)ptr;
  int x;
  if (ptr == NULL)
    ptr = NULL;
  for (x = 0; x < (number * size); x++)
    cptr[x] = 0;
  return ptr;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114d <calloc+0x3d>
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
mov    -0x8(%rbp),%rcx
imul   -0x10(%rbp),%rcx
cmp    %rcx,%rax
jae    1184 <calloc+0x74>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1154 <calloc+0x44>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i64 %3, 0
br i1 %5, label %7, label %6
6: ; preds = %2
br label %7
7: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_Args();
int /*<<< orphan*/ com_strlcpy(char *, int /*<<< orphan*/, int);
void Cmd_ArgsBuffer(char *buffer, int bufferLength) {
  com_strlcpy(buffer, Cmd_Args(), bufferLength);
}


x86 assembly (clang, -O0):
<Cmd_ArgsBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Args@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <com_strlcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_ArgsBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Cmd_Args@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <com_strlcpy@plt>

LLVM IR (-O0):
define void @Cmd_ArgsBuffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (...) @Cmd_Args()
%7 = load i32, i32* %4
%8 = call i32 @com_strlcpy(i8* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @Cmd_ArgsBuffer(i8* %0, i32 %1) {
%3 = tail call i32 (...) @Cmd_Args()
%4 = tail call i32 @com_strlcpy(i8* %0, i32 %3, i32 %1)
ret void
}
void rt_low_level_init(void) {
  (*(volatile unsigned int *)(((0XFFFFF000) + 0x124)) = (0xFFFFFFFF));
  (*(volatile unsigned int *)(((0XFFFFF000) + 0x128)) = (0xFFFFFFFF));
  (*(volatile unsigned int *)(((0XFFFFEE00) + 0x100)) = ((1 << 0) | (1 << 1)));
}


x86 assembly (clang, -O0):
<rt_low_level_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff124,%eax
movl   $0xffffffff,(%rax)
mov    $0xfffff128,%eax
movl   $0xffffffff,(%rax)
mov    $0xffffef00,%eax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_low_level_init>:
mov    $0xffffef00,%eax
movl   $0xffffffff,0x224(%rax)
ff ff ff
movl   $0xffffffff,0x228(%rax)
ff ff ff
movl   $0x3,(%rax)
ret

LLVM IR (-O0):
define void @rt_low_level_init() {
store volatile i32 -1, i32* inttoptr (i64 4294963492 to i32*)
store volatile i32 -1, i32* inttoptr (i64 4294963496 to i32*)
store volatile i32 3, i32* inttoptr (i64 4294962944 to i32*)
ret void
}

LLVM IR (-O2):
define void @rt_low_level_init() {
store volatile i32 -1, i32* inttoptr (i64 4294963492 to i32*)
store volatile i32 -1, i32* inttoptr (i64 4294963496 to i32*)
store volatile i32 3, i32* inttoptr (i64 4294962944 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mpack_store_float(char *, float);
int /*<<< orphan*/ mpack_store_u8(char *, int);
void mpack_encode_float(char *p, float value) {
  mpack_store_u8(p, 0xca);
  mpack_store_float(p + 1, value);
}


x86 assembly (clang, -O0):
<mpack_encode_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xca,%esi
call   1030 <mpack_store_u8@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
movss  -0xc(%rbp),%xmm0
call   1040 <mpack_store_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpack_encode_float>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
mov    $0xca,%esi
call   1030 <mpack_store_u8@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <mpack_store_float@plt>

LLVM IR (-O0):
define void @mpack_encode_float(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = call i32 @mpack_store_u8(i8* %5, i32 202)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load float, float* %4
%10 = call i32 @mpack_store_float(i8* %8, float %9)
ret void
}

LLVM IR (-O2):
define void @mpack_encode_float(i8* %0, float %1) {
%3 = tail call i32 @mpack_store_u8(i8* %0, i32 202)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call i32 @mpack_store_float(i8* %4, float %1)
ret void
}
int ipp_startup(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ipp_startup() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ipp_startup() {
ret i32 0
}
/* Variables and functions */
long double exp(long double);
long double fun_exp(long double a) { return exp(a); }


x86 assembly (clang, -O0):
<fun_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <exp@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_exp>:
jmp    1030 <exp@plt>

LLVM IR (-O0):
define x86_fp80 @fun_exp(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @exp(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @fun_exp(x86_fp80 %0) {
%2 = tail call x86_fp80 @exp(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_epi32(int /*<<< orphan*/, int);
__m128i __attribute__((no, unused)) test(__m128i s1) {
  return _mm_srai_epi32(s1, 0xf);
}


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

x86 assembly (clang, -O2):
<test>:
mov    $0xf,%esi
jmp    1030 <_mm_srai_epi32@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i32 @_mm_srai_epi32(i32 %0, i32 15)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ParseModifier(uint8_t modifier) {
  switch (modifier) {
  case '^':
    return (1 << 0);
  case '+':
    return (1 << 1);
  case '!':
    return (1 << 2);
  case '#':
    return (1 << 3);
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ParseModifier>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x21,%eax
je     1166 <ParseModifier+0x66>
jmp    111b <ParseModifier+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x23,%eax
je     1172 <ParseModifier+0x72>
jmp    112c <ParseModifier+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     115a <ParseModifier+0x5a>
jmp    113d <ParseModifier+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
jne    117e <ParseModifier+0x7e>
jmp    114e <ParseModifier+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <ParseModifier+0x85>
movl   $0x2,-0x4(%rbp)
jmp    1185 <ParseModifier+0x85>
movl   $0x4,-0x4(%rbp)
jmp    1185 <ParseModifier+0x85>
movl   $0x8,-0x4(%rbp)
jmp    1185 <ParseModifier+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseModifier>:
cmp    $0x2a,%edi
jg     1115 <ParseModifier+0x15>
cmp    $0x21,%edi
je     1128 <ParseModifier+0x28>
cmp    $0x23,%edi
jne    1125 <ParseModifier+0x25>
mov    $0x8,%eax
ret
cmp    $0x5e,%edi
je     112e <ParseModifier+0x2e>
cmp    $0x2b,%edi
jne    1125 <ParseModifier+0x25>
mov    $0x2,%eax
ret
xor    %eax,%eax
ret
mov    $0x4,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ParseModifier(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 94, label %5
i32 43, label %6
i32 33, label %7
i32 35, label %8
]
5: ; preds = %1
store i32 1, i32* %2
br label %10
6: ; preds = %1
store i32 2, i32* %2
br label %10
7: ; preds = %1
store i32 4, i32* %2
br label %10
8: ; preds = %1
store i32 8, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @ParseModifier(i32 %0) {
switch i32 %0, label %5 [
i32 94, label %6
i32 43, label %2
i32 33, label %3
i32 35, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ 0, %5 ], [ 8, %4 ], [ 4, %3 ], [ 2, %2 ], [ 1, %1 ]
ret i32 %7
}
short quantize(const short data, const unsigned char qt) {
  return (data * qt + 512 - ((unsigned)data >> 31)) >> 10;
}


x86 assembly (clang, -O0):
<quantize>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movswl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
imul   %ecx,%eax
add    $0x200,%eax
movswl -0x2(%rbp),%ecx
shr    $0x1f,%ecx
sub    %ecx,%eax
shr    $0xa,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantize>:
imul   %edi,%esi
sar    $0x1f,%edi
lea    (%rdi,%rsi,1),%eax
add    $0x200,%eax
shr    $0xa,%eax
ret

LLVM IR (-O0):
define signext i16 @quantize(i16 signext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = mul nsw i32 %6, %8
%10 = add nsw i32 %9, 512
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = lshr i32 %12, 31
%14 = sub i32 %10, %13
%15 = lshr i32 %14, 10
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @quantize(i16 signext %0, i8 zeroext %1) {
%3 = sext i16 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = ashr i32 %3, 31
%7 = add nsw i32 %6, 512
%8 = add nsw i32 %7, %5
%9 = lshr i32 %8, 10
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ __wcstoul_internal(int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/ **, int,
                                      int /*<<< orphan*/);
uintmax_t wcstoumax(const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
                    int base) {
  return __wcstoul_internal(nptr, endptr, base, 0);
}


x86 assembly (clang, -O0):
<wcstoumax>:
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),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <__wcstoul_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstoumax>:
xor    %ecx,%ecx
jmp    1030 <__wcstoul_internal@plt>

LLVM IR (-O0):
define i32 @wcstoumax(i32* noalias %0, i32** noalias %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 = load i32, i32* %6
%10 = call i32 @__wcstoul_internal(i32* %7, i32** %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @wcstoumax(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = tail call i32 @__wcstoul_internal(i32* %0, i32** %1, i32 %2, i32 0)
ret i32 %4
}
/* Type definitions */
struct cxl_ioctl_start_work {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ free(struct cxl_ioctl_start_work *);
int cxl_work_free(struct cxl_ioctl_start_work *work) {
  if (work == NULL) {
    errno = EINVAL;
    return -1;
  }
  free(work);
  return 0;
}


x86 assembly (clang, -O0):
<cxl_work_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <cxl_work_free+0x35>
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea9(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cxl_work_free+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cxl_work_free>:
push   %rax
test   %rdi,%rdi
je     111f <cxl_work_free+0xf>
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    0x2eb1(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cxl_ioctl_start_work = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @cxl_work_free(%struct.cxl_ioctl_start_work* %0) {
%2 = alloca i32
%3 = alloca %struct.cxl_ioctl_start_work*
store %struct.cxl_ioctl_start_work* %0, %struct.cxl_ioctl_start_work** %3
%4 = load %struct.cxl_ioctl_start_work*, %struct.cxl_ioctl_start_work** %3
%5 = icmp eq %struct.cxl_ioctl_start_work* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EINVAL
store i32 %7, i32* @errno
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load %struct.cxl_ioctl_start_work*, %struct.cxl_ioctl_start_work** %3
%10 = call i32 @free(%struct.cxl_ioctl_start_work* %9)
store i32 0, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.cxl_ioctl_start_work = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @cxl_work_free(%struct.cxl_ioctl_start_work* %0) {
%2 = icmp eq %struct.cxl_ioctl_start_work* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
br label %7
5: ; preds = %1
%6 = tail call i32 @free(%struct.cxl_ioctl_start_work* %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -1, %3 ], [ 0, %5 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
uint16_t ftou16(float s) { return (int16_t)(s * ((float)(256))); }


x86 assembly (clang, -O0):
<ftou16>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftou16>:
mulss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @ftou16(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 2.560000e+02
%5 = fptosi float %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ftou16(float %0) {
%2 = fmul float %0, 2.560000e+02
%3 = fptosi float %2 to i32
ret i32 %3
}
double I_RAD2GPN(double rad) {
  return rad * 57.2957795130823208767981548170142;
}


x86 assembly (clang, -O0):
<I_RAD2GPN>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<I_RAD2GPN>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @I_RAD2GPN(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x404CA5DC1A63C1F8
ret double %4
}

LLVM IR (-O2):
define double @I_RAD2GPN(double %0) {
%2 = fmul double %0, 0x404CA5DC1A63C1F8
ret double %2
}
void swap(int *h1, int *h2) {
  int temp = *h1;
  *h1 = *h2;
  *h2 = temp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
void lst_destroy(void *lst) {}


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

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

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

LLVM IR (-O2):
define void @lst_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned char);
int STR_FEC_IN(char *p, int n, unsigned char fec_in) {
  if (fec_in == 0)
    return 0;
  return snprintf(p, n, "fect_in:%d ", fec_in);
}


x86 assembly (clang, -O0):
<STR_FEC_IN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movzbl -0x15(%rbp),%eax
cmp    $0x0,%eax
jne    113d <STR_FEC_IN+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1157 <STR_FEC_IN+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xeb5(%rip),%rdx
movzbl -0x15(%rbp),%ecx
call   1030 <snprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STR_FEC_IN>:
test   %edx,%edx
je     1123 <STR_FEC_IN+0x13>
movzbl %dl,%ecx
lea    0xee2(%rip),%rdx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"fect_in:%d \00"
define i32 @STR_FEC_IN(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8 %2, i8* %7
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %17
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = load i8, i8* %7
%16 = call i32 @snprintf(i8* %13, i32 %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
store i32 %16, i32* %4
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"fect_in:%d \00"
define i32 @STR_FEC_IN(i8* %0, i32 %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
int titleIsGoal(int old, int new) { return old == 3 && new == 0; }


x86 assembly (clang, -O0):
<titleIsGoal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x3,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <titleIsGoal+0x23>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<titleIsGoal>:
xor    $0x3,%edi
xor    %eax,%eax
or     %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @titleIsGoal(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 = icmp eq i32 %5, 3
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @titleIsGoal(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 3
%4 = icmp eq i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void RTVfsSymlinkRead(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsSymlinkRead() {
ret void
}
int main(int argc, char const *argv[0]) { return ((int)(*(*(argv + 0)))); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rax
movsbl (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert_str_eq(char *, char *);
void test_assert_eq_string_fail() {
  assert_str_eq("a string!", "another string!");
}


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

x86 assembly (clang, -O2):
<test_assert_eq_string_fail>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <assert_str_eq@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"a string!\00"
@.str.1 = [16 x i8] c"another string!\00"
define void @test_assert_eq_string_fail() {
%1 = call i32 @assert_str_eq(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"a string!\00"
@.str.1 = [16 x i8] c"another string!\00"
define void @test_assert_eq_string_fail() {
%1 = tail call i32 @assert_str_eq(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a = 5, b = 6;
  f1(&a, &b);
  printf("a=%d and b=%d", a, b);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0x6,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <f1@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"a=%d and b=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 6, i32* %2
%5 = call i32 @f1(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeADC(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000000);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000000);
}


x86 assembly (clang, -O0):
<GPIOPinTypeADC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeADC>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edx,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeADC(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 0)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_file(char *, int);
int /*<<< orphan*/ printf(char *);
void print_footer(void) {
  display_file("/footer.html", 1);
  printf("\n</BODY>\n</HTML>\n");
}


x86 assembly (clang, -O0):
<print_footer>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1040 <display_file@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"/footer.html\00"
@.str.1 = [18 x i8] c"\0A</BODY>\0A</HTML>\0A\00"
define void @print_footer() {
%1 = call i32 @display_file(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/footer.html\00"
@str = [17 x i8] c"\0A</BODY>\0A</HTML>\00"
define void @print_footer() {
%1 = tail call i32 @display_file(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int _falwcGenericTextExtents() { return 0; }


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

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

LLVM IR (-O0):
define i32 @_falwcGenericTextExtents() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_falwcGenericTextExtents() {
ret i32 0
}
/* Variables and functions */
bool is_leap_year(unsigned y) {
  if (y % 4)
    return false;
  if (y % 100)
    return true;
  if (y % 400)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1122 <is_leap_year+0x22>
movl   $0x0,-0x4(%rbp)
jmp    116b <is_leap_year+0x6b>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
je     1143 <is_leap_year+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116b <is_leap_year+0x6b>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
je     1164 <is_leap_year+0x64>
movl   $0x0,-0x4(%rbp)
jmp    116b <is_leap_year+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = urem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = urem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ abort();
bool_t rendezvous_abort() {
  abort();
  return (FALSE);
}


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

x86 assembly (clang, -O2):
<rendezvous_abort>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @rendezvous_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @rendezvous_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void free_u16(uint16_t *val) {}


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

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

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

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

/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/ *);
char *strchr(char *, char);
char *chomp(char *s, int size, FILE *f) {
  char *res = fgets(s, size, f);
  if (res) {
    char *p = strchr(res, '\n');
    if (p) {
      *p = 0;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <fgets@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117b <chomp+0x5b>
mov    -0x20(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1176 <chomp+0x56>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
jmp    117b <chomp+0x5b>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
call   1040 <fgets@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1143 <chomp+0x23>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1143 <chomp+0x23>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @chomp(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i8* @strchr(i8* %4, i8 signext 10)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %6
store i8 0, i8* %7
br label %10
10: ; preds = %6, %9, %3
ret i8* %4
}
int param_set_long(const char *val, struct kernel_param *kp) { return 0; }


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

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

LLVM IR (-O0):
%struct.kernel_param = type opaque
define i32 @param_set_long(i8* %0, %struct.kernel_param* %1) {
%3 = alloca i8*
%4 = alloca %struct.kernel_param*
store i8* %0, i8** %3
store %struct.kernel_param* %1, %struct.kernel_param** %4
ret i32 0
}

LLVM IR (-O2):
%struct.kernel_param = type opaque
define i32 @param_set_long(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
ret i32 0
}
void g_closure_sink() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_sink() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ divu64_10(scalar_t__);
int ndigits_in_u64(uint64_t ui64Val) {
  int iNDigits = ui64Val ? 0 : 1;
  while (ui64Val) {
    ui64Val = divu64_10(ui64Val);
    ++iNDigits;
  }
  return iNDigits;
}


x86 assembly (clang, -O0):
<ndigits_in_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1157 <ndigits_in_u64+0x47>
mov    -0x8(%rbp),%rdi
call   1030 <divu64_10@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <ndigits_in_u64+0x21>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndigits_in_u64>:
push   %rbx
test   %rdi,%rdi
je     1132 <ndigits_in_u64+0x22>
mov    %rdi,%rax
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <divu64_10@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1120 <ndigits_in_u64+0x10>
jmp    1137 <ndigits_in_u64+0x27>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ndigits_in_u64(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = tail call i64 @divu64_10(i64 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i64 %6, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
void int2TimeString(char *timeString, int value) {
  int minutes = 0, seconds = 0, ticks = 0;
  minutes = value / 60;
  seconds = value % 60;
  ticks = 0;
  sprintf(timeString, "%.2d:%.2d:%.2d", minutes, seconds, ticks);
}


x86 assembly (clang, -O0):
<int2TimeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe94(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2TimeString>:
movslq %esi,%rcx
imul   $0xffffffff88888889,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x5,%edx
add    %eax,%edx
imul   $0x3c,%edx,%eax
sub    %eax,%ecx
lea    0xeca(%rip),%rsi
xor    %r8d,%r8d
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%.2d:%.2d:%.2d\00"
define void @int2TimeString(i8* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 60
%4 = srem i32 %1, 60
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 0)
ret void
}
void delay(volatile unsigned long dly) {
  for (; dly > 0; dly--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x0,%rax
jbe    112c <delay+0x2c>
jmp    111b <delay+0x1b>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <delay+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %rdi,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
je     111e <delay+0x1e>
nopl   (%rax)
addq   $0xffffffffffffffff,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jne    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* %2
%5 = icmp ugt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load volatile i64, i64* %2
%9 = add i64 %8, -1
store volatile i64 %9, i64* %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = load volatile i64, i64* %2
%7 = add i64 %6, -1
store volatile i64 %7, i64* %2
%8 = load volatile i64, i64* %2
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
int get_size_arr(int *arr) {
  int size;
  size = *(arr - sizeof(int));
  return size;
}


x86 assembly (clang, -O0):
<get_size_arr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_size_arr>:
mov    -0x10(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_size_arr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 -4
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_size_arr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -4
%3 = load i32, i32* %2
ret i32 %3
}