xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_valid_ascii(char const);
__attribute__((visibility("default"))) char *
fcitx_utils_get_ascii_end(const char *string) {
  if (!string)
    return NULL;
  for (; is_valid_ascii(*string); string++) {
  }
  return (char *)string;
}


x86 assembly (clang, -O0):
<fcitx_utils_get_ascii_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <fcitx_utils_get_ascii_end+0x24>
movq   $0x0,-0x8(%rbp)
jmp    116d <fcitx_utils_get_ascii_end+0x5d>
jmp    1139 <fcitx_utils_get_ascii_end+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_valid_ascii@plt>
cmp    $0x0,%rax
je     1165 <fcitx_utils_get_ascii_end+0x55>
jmp    1154 <fcitx_utils_get_ascii_end+0x44>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <fcitx_utils_get_ascii_end+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_get_ascii_end>:
push   %rbx
test   %rdi,%rdi
je     1134 <fcitx_utils_get_ascii_end+0x24>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <is_valid_ascii@plt>
test   %rax,%rax
jne    1120 <fcitx_utils_get_ascii_end+0x10>
jmp    1136 <fcitx_utils_get_ascii_end+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_1_1_1_2_2() {
ret void
}
void write_kernels_cm_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @write_kernels_cm_adios_() {
ret void
}
int f_le_mm1(float *a1, float *a2) { return (((*a1) <= (*a2))); }


x86 assembly (clang, -O0):
<f_le_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_le_mm1>:
movss  (%rsi),%xmm0
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f_le_mm1(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fcmp ole float %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_le_mm1(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp ole float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int function(int a, int b) {
  int c = a % b;
  b = -a * (b + c);
  return c - b / 2;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
add    %edx,%esi
imul   %edi,%esi
mov    %esi,%ecx
neg    %ecx
shr    $0x1f,%ecx
sub    %esi,%ecx
sar    %ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @function(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* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = mul nsw i32 %10, %13
store i32 %14, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = sdiv i32 %16, 2
%18 = sub nsw i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @function(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = add nsw i32 %3, %1
%5 = mul i32 %4, %0
%6 = sub i32 0, %5
%7 = sdiv i32 %6, -2
%8 = add i32 %7, %3
ret i32 %8
}
/* Type definitions */
struct IMSTREAM {
  int dummy;
};

/* Variables and functions */
long ims_read(struct IMSTREAM *, int /*<<< orphan*/ *, long);
long ims_drop(struct IMSTREAM *stream, long size) {
  return ims_read(stream, NULL, size);
}


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

x86 assembly (clang, -O2):
<ims_drop>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <ims_read@plt>

LLVM IR (-O0):
%struct.IMSTREAM = type { i32 }
define i64 @ims_drop(%struct.IMSTREAM* %0, i64 %1) {
%3 = alloca %struct.IMSTREAM*
%4 = alloca i64
store %struct.IMSTREAM* %0, %struct.IMSTREAM** %3
store i64 %1, i64* %4
%5 = load %struct.IMSTREAM*, %struct.IMSTREAM** %3
%6 = load i64, i64* %4
%7 = call i64 @ims_read(%struct.IMSTREAM* %5, i32* null, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
%struct.IMSTREAM = type { i32 }
define i64 @ims_drop(%struct.IMSTREAM* %0, i64 %1) {
%3 = tail call i64 @ims_read(%struct.IMSTREAM* %0, i32* null, i64 %1)
ret i64 %3
}
int test_imm_3Eint16_mem(short *val) {
  return ((*val) & (0x3E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Eint16_mem>:
testb  $0x3e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 62
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ partition(long long *, int /*<<< orphan*/, int);
void sort(long long *merge, int n) { partition(merge, 0, n - 1); }


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

x86 assembly (clang, -O2):
<sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <partition@plt>

LLVM IR (-O0):
define void @sort(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%5 = load i64*, i64** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @partition(i64* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @sort(i64* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @partition(i64* %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ GetCurrentThreadId();
unsigned long evthread_win32_get_id(void) {
  return (unsigned long)GetCurrentThreadId();
}


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

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

LLVM IR (-O0):
define i64 @evthread_win32_get_id() {
%1 = call i64 (...) @GetCurrentThreadId()
ret i64 %1
}

LLVM IR (-O2):
define i64 @evthread_win32_get_id() {
%1 = tail call i64 (...) @GetCurrentThreadId()
ret i64 %1
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ printf(char *);
void handle(int signum) {
  if (signum == SIGINT)
    printf("this is sigint\n");
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <handle+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <handle+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [16 x i8] c"this is sigint\0A\00"
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [15 x i8] c"this is sigint\00"
define void @handle(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void ms_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @ms_flush() {
ret void
}
int Operand_lsi4x4_encode(unsigned int *valp) {
  unsigned r_0, lsi4x4_0;
  lsi4x4_0 = *valp;
  r_0 = ((lsi4x4_0 >> 2) & 0xf);
  *valp = r_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_lsi4x4_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x2,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_lsi4x4_encode>:
mov    (%rdi),%eax
shr    $0x2,%eax
and    $0xf,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_lsi4x4_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = lshr i32 %7, 2
%9 = and i32 %8, 15
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_lsi4x4_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 2
%4 = and i32 %3, 15
store i32 %4, i32* %0
ret i32 0
}
int eofread(cookie, buf, len) void *cookie;
char *buf;
int len;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @eofread(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int my_getline(char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char p[100];
  int len;
  len = my_getline(p, 100);
  printf("\n%s", p);
  printf("\n%d", len);
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1040 <my_getline@plt>
mov    %eax,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x74(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <my_getline@plt>
mov    %eax,%ebp
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [4 x i8] c"\0A%d\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_getline(i8* %2, i32 100)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PAGE_RemoveAllObjects();
int /*<<< orphan*/ PAGE_SetModal(int /*<<< orphan*/);
int /*<<< orphan*/ _show_settimer_page(int);
void PAGE_SetTimerInit(int index) {
  PAGE_SetModal(0);
  PAGE_RemoveAllObjects();
  _show_settimer_page(index);
}


x86 assembly (clang, -O0):
<PAGE_SetTimerInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1040 <PAGE_SetModal@plt>
mov    $0x0,%al
call   1030 <PAGE_RemoveAllObjects@plt>
mov    -0x4(%rbp),%edi
call   1050 <_show_settimer_page@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAGE_SetTimerInit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <PAGE_SetModal@plt>
xor    %eax,%eax
call   1030 <PAGE_RemoveAllObjects@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <_show_settimer_page@plt>

LLVM IR (-O0):
define void @PAGE_SetTimerInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @PAGE_SetModal(i32 0)
%4 = call i32 (...) @PAGE_RemoveAllObjects()
%5 = load i32, i32* %2
%6 = call i32 @_show_settimer_page(i32 %5)
ret void
}

LLVM IR (-O2):
define void @PAGE_SetTimerInit(i32 %0) {
%2 = tail call i32 @PAGE_SetModal(i32 0)
%3 = tail call i32 (...) @PAGE_RemoveAllObjects()
%4 = tail call i32 @_show_settimer_page(i32 %0)
ret void
}
int isalpha(int c) { return c >= 'A' && c <= 'z'; }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isalpha+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x3a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 58
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ best(int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int g, s, c;
  scanf("%d %d %d", &g, &s, &c);
  best(3 * g + 2 * s + c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
imul   $0x3,-0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    %eax,%edi
add    -0x10(%rbp),%edi
call   1030 <best@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
lea    (%rax,%rax,2),%eax
mov    0x10(%rsp),%ecx
lea    (%rax,%rcx,2),%edi
add    0xc(%rsp),%edi
call   1030 <best@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 3
%10 = load i32, i32* %2
%11 = shl nsw i32 %10, 1
%12 = add nsw i32 %11, %9
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = call i32 @best(i32 %14)
ret i32 0
}
char const *_GetVersion() { return "<unknown version>"; }


x86 assembly (clang, -O0):
<_GetVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"<unknown version>\00"
define i8* @_GetVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"<unknown version>\00"
define i8* @_GetVersion() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int ffs(int);
int u_ffs(int val) { return ffs(val); }


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

x86 assembly (clang, -O2):
<u_ffs>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @u_ffs(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Variables and functions */
unsigned long get_hsb_clk_rate();
unsigned long get_sdram_clk_rate(void) { return get_hsb_clk_rate(); }


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

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

LLVM IR (-O0):
define i64 @get_sdram_clk_rate() {
%1 = call i64 (...) @get_hsb_clk_rate()
ret i64 %1
}

LLVM IR (-O2):
define i64 @get_sdram_clk_rate() {
%1 = tail call i64 (...) @get_hsb_clk_rate()
ret i64 %1
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ irc_notify_hook_timer_whois();
void irc_config_change_network_notify_check_whois(
    const void *pointer, void *data, struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  irc_notify_hook_timer_whois();
}


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

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

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @irc_config_change_network_notify_check_whois(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 (...) @irc_notify_hook_timer_whois()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @irc_config_change_network_notify_check_whois(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 (...) @irc_notify_hook_timer_whois()
ret void
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int8_t add_int8_t(int8_t a, int8_t b) { return a + b; }


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

x86 assembly (clang, -O2):
<add_int8_t>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add_int8_t(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 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add_int8_t(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ run_void_lace_tool_pipem_callback(int, int, char const *);
void run_void(int in_fd, int out_fd, void *voidarg) {
  run_void_lace_tool_pipem_callback(in_fd, out_fd, (const char *)voidarg);
}


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

x86 assembly (clang, -O2):
<run_void>:
jmp    1030 <run_void_lace_tool_pipem_callback@plt>

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

LLVM IR (-O2):
define void @run_void(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @run_void_lace_tool_pipem_callback(i32 %0, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void foo() {
  FILE *x = fopen("xyz", "r");
  FILE *y = fopen("abc", "r");
  fclose(x);
  fclose(y);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    0xec0(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%rdi
lea    0xed1(%rip),%r14
mov    %r14,%rsi
call   1040 <fopen@plt>
mov    %rax,%r15
lea    0xec1(%rip),%rdi
mov    %r14,%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"xyz\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"abc\00"
define void @foo() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"xyz\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"abc\00"
define void @foo() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fclose(i32* %1)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
void gtk_icon_theme_error_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_error_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hello(int, char **, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char szNewString[500];
  hello(argc, argv, szNewString, 500);
  printf("%s\n", szNewString);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x210(%rbp),%rdx
mov    $0x1f4,%ecx
call   1040 <hello@plt>
lea    -0x210(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
mov    $0x1f4,%ecx
call   1040 <hello@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [500 x i8]
%4 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%5 = call i32 @hello(i32 %0, i8** %1, i8* %4, i32 500)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int bpf_rand_mask(int);
uint64_t bpf_rand_u48(int shift) {
  return bpf_rand_mask((0xffffffffffffULL)) << shift;
}


x86 assembly (clang, -O0):
<bpf_rand_u48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <bpf_rand_mask@plt>
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_rand_u48>:
push   %rbx
mov    %edi,%ebx
mov    $0xffffffff,%edi
call   1030 <bpf_rand_mask@plt>
mov    %ebx,%ecx
shl    %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bpf_rand_u48(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @bpf_rand_mask(i32 -1)
%4 = load i32, i32* %2
%5 = shl i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @bpf_rand_u48(i32 %0) {
%2 = tail call i32 @bpf_rand_mask(i32 -1)
%3 = shl i32 %2, %0
ret i32 %3
}
void foo(float *a) {}


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

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

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

LLVM IR (-O2):
define void @foo(float* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  char *col = "F1";
  printf("%li\n", strtol(col, NULL, 16));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtol@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"F1\00"
@.str.1 = [5 x i8] c"%li\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @strtol(i8* %7, i32* null, i32 16)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%li\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 241)
ret i32 0
}
/* Variables and functions */
int git_int_error(int);
int git_os_error(void) { return git_int_error((-1 - 4)); }


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

x86 assembly (clang, -O2):
<git_os_error>:
mov    $0xfffffffb,%edi
jmp    1030 <git_int_error@plt>

LLVM IR (-O0):
define i32 @git_os_error() {
%1 = call i32 @git_int_error(i32 -5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @git_os_error() {
%1 = tail call i32 @git_int_error(i32 -5)
ret i32 %1
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setPercussionVolume(struct b_tonegen *, int);
void setPercVolumeFromMIDI(void *d, unsigned char u) {
  struct b_tonegen *t = (struct b_tonegen *)d;
  setPercussionVolume(t, u < 64 ? 0 : 1);
}


x86 assembly (clang, -O0):
<setPercVolumeFromMIDI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movzbl -0x9(%rbp),%ecx
mov    $0x1,%esi
xor    %eax,%eax
cmp    $0x40,%ecx
cmovl  %eax,%esi
call   1030 <setPercussionVolume@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPercVolumeFromMIDI>:
xor    %eax,%eax
cmp    $0x40,%sil
setae  %al
mov    %eax,%esi
jmp    1030 <setPercussionVolume@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setPercVolumeFromMIDI(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca %struct.b_tonegen*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.b_tonegen*
store %struct.b_tonegen* %7, %struct.b_tonegen** %5
%8 = load %struct.b_tonegen*, %struct.b_tonegen** %5
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 64
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
%14 = call i32 @setPercussionVolume(%struct.b_tonegen* %8, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setPercVolumeFromMIDI(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = icmp ugt i8 %1, 63
%5 = zext i1 %4 to i32
%6 = tail call i32 @setPercussionVolume(%struct.b_tonegen* %3, i32 %5)
ret void
}
void zipwarn(msg1, msg2) char *msg1, *msg2;
{
  msg1 = msg1;
  msg2 = msg2;
}


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

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

LLVM IR (-O0):
define void @zipwarn(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
store i8* %5, i8** %3
%6 = load i8*, i8** %4
store i8* %6, i8** %4
ret void
}

LLVM IR (-O2):
define void @zipwarn(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_html_head(char *descr, char *title) {
  printf("	<!doctype html>\n	<html lang='en'>\n	"
         "<head>\n	<meta charset='utf-8'>\n	<meta name='viewport' "
         "content='width=device-width, initial-scale=1.0'>\n	<meta "
         "name='description' content='%s'>\n	<meta "
         "http-equiv='Cache-Control' content='no-cache, no-store, "
         "must-revalidate' />\n	<meta http-equiv='Pragma' content='no-cache' "
         "/>\n	<meta http-equiv='Expires' content='0' />\n	<link "
         "rel='stylesheet' href='/css/forms.css'>\n	<link rel='shortcut "
         "icon' href='/favicon.png' />\n	<title>InfoWall -- "
         "%s</title>\n	</head>\n",
         descr, title);
}


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

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

LLVM IR (-O0):
@.str = [492 x i8] c"\09<!doctype html>\0A\09<html lang='en'>\0A\09<head>\0A\09<meta charset='utf-8'>\0A\09<meta name='viewport' content='width=device-width, initial-scale=1.0'>\0A\09<meta name='description' content='%s'>\0A\09<meta http-equiv='Cache-Control' content='no-cache, no-store, must-revalidate' />\0A\09<meta http-equiv='Pragma' content='no-cache' />\0A\09<meta http-equiv='Expires' content='0' />\0A\09<link rel='stylesheet' href='/css/forms.css'>\0A\09<link rel='shortcut icon' href='/favicon.png' />\0A\09<title>InfoWall -- %s</title>\0A\09</head>\0A\00"
define void @print_html_head(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 i32 @printf(i8* getelementptr inbounds ([492 x i8], [492 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [492 x i8] c"\09<!doctype html>\0A\09<html lang='en'>\0A\09<head>\0A\09<meta charset='utf-8'>\0A\09<meta name='viewport' content='width=device-width, initial-scale=1.0'>\0A\09<meta name='description' content='%s'>\0A\09<meta http-equiv='Cache-Control' content='no-cache, no-store, must-revalidate' />\0A\09<meta http-equiv='Pragma' content='no-cache' />\0A\09<meta http-equiv='Expires' content='0' />\0A\09<link rel='stylesheet' href='/css/forms.css'>\0A\09<link rel='shortcut icon' href='/favicon.png' />\0A\09<title>InfoWall -- %s</title>\0A\09</head>\0A\00"
define void @print_html_head(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([492 x i8], [492 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void Crash() { asm("int $0x3"); }


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

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

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

LLVM IR (-O2):
define void @Crash() {
tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int round_shift(int, int);
int32_t half_btf(int32_t w0, int32_t in0, int32_t w1, int32_t in1, int bit) {
  int32_t result_32 = w0 * in0 + w1 * in1;
  return round_shift(result_32, bit);
}


x86 assembly (clang, -O0):
<half_btf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <round_shift@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_btf>:
imul   %esi,%edi
imul   %ecx,%edx
add    %edx,%edi
mov    %r8d,%esi
jmp    1030 <round_shift@plt>

LLVM IR (-O0):
define i32 @half_btf(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = mul nsw i32 %15, %16
%18 = add nsw i32 %14, %17
store i32 %18, i32* %11
%19 = load i32, i32* %11
%20 = load i32, i32* %10
%21 = call i32 @round_shift(i32 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @half_btf(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %1, %0
%7 = mul nsw i32 %3, %2
%8 = add nsw i32 %7, %6
%9 = tail call i32 @round_shift(i32 %8, i32 %4)
ret i32 %9
}
int sudoku_slot_row_from_id(int id) { return id / 9; }


x86 assembly (clang, -O0):
<sudoku_slot_row_from_id>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudoku_slot_row_from_id>:
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sudoku_slot_row_from_id(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 9
ret i32 %4
}

LLVM IR (-O2):
define i32 @sudoku_slot_row_from_id(i32 %0) {
%2 = sdiv i32 %0, 9
ret i32 %2
}
int drm_debugfs_connector_add(struct drm_connector *connector) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_connector = type opaque
define i32 @drm_debugfs_connector_add(%struct.drm_connector* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_memory(int *, int *, int *);
void manage_child(int *buffer, int *in, int *out) {
  printf("Child process (PID %d)\n", getpid());
  read_memory(buffer, in, out);
  printf("Child: memory has been consumed.\n");
}


x86 assembly (clang, -O0):
<manage_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <read_memory@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manage_child>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1060 <read_memory@plt>
lea    0xe9e(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Child process (PID %d)\0A\00"
@.str.1 = [34 x i8] c"Child: memory has been consumed.\0A\00"
define void @manage_child(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = call i32 (...) @getpid()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = call i32 @read_memory(i32* %9, i32* %10, i32* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Child process (PID %d)\0A\00"
@str = [33 x i8] c"Child: memory has been consumed.\00"
define void @manage_child(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @read_memory(i32* %0, i32* %1, i32* %2)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
int movefd(old, new) int old, new;
{
  if (old < 0 || old == new)
    return old;
  new = dup2(old, new);
  return close(old) == 0 ? new : -1;
}


x86 assembly (clang, -O0):
<movefd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1144 <movefd+0x24>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    114f <movefd+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <movefd+0x70>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <dup2@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <close@plt>
cmp    $0x0,%eax
jne    117d <movefd+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    118a <movefd+0x6a>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    118a <movefd+0x6a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movefd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
js     1147 <movefd+0x27>
cmp    %esi,%ebx
je     1147 <movefd+0x27>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <dup2@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <close@plt>
neg    %eax
sbb    %ebx,%ebx
or     %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @movefd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8, %2
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %26
14: ; preds = %8
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @dup2 to i32 (i32, i32, ...)*)(i32 %15, i32 %16)
store i32 %17, i32* %5
%18 = load i32, i32* %4
%19 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %18)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = load i32, i32* %5
br label %24
23: ; preds = %14
br label %24
24: ; preds = %23, %21
%25 = phi i32 [ %22, %21 ], [ -1, %23 ]
store i32 %25, i32* %3
br label %26
26: ; preds = %24, %12
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @movefd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = icmp eq i32 %0, %1
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @dup2 to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 %7, i32 -1
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ %0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ init_app();
int /*<<< orphan*/ task_update_leds();
void main(void) {
  init_app();
  task_update_leds();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_app@plt>
mov    $0x0,%al
call   1040 <task_update_leds@plt>
jmp    1132 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_app@plt>
xor    %eax,%eax
call   1040 <task_update_leds@plt>
nop
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @init_app()
%2 = call i32 (...) @task_update_leds()
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_app()
%2 = tail call i32 (...) @task_update_leds()
br label %3
3: ; preds = %0, %3
br label %3
}
void pm8921_bms_charging_end(int is_battery_full) {}


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

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

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

LLVM IR (-O2):
define void @pm8921_bms_charging_end(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ P(int, double, char *, char *);
long main() {
  P(1, 2.3, "dog", "cat");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
movsd  0xedf(%rip),%xmm0
lea    0xee0(%rip),%rsi
lea    0xedd(%rip),%rdx
call   1030 <P@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rsi
lea    0xeed(%rip),%rdx
movsd  0xed9(%rip),%xmm0
mov    $0x1,%edi
call   1030 <P@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"dog\00"
@.str.1 = [4 x i8] c"cat\00"
define i64 @main() {
%1 = call i32 @P(i32 1, double 2.300000e+00, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"dog\00"
@.str.1 = [4 x i8] c"cat\00"
define i64 @main() {
%1 = tail call i32 @P(i32 1, double 2.300000e+00, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i64 0
}