xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *vrna_alloc(scalar_t__);
char *strdup(const char *s) {
  char *dup;
  dup = vrna_alloc(strlen(s) + 1);
  strcpy(dup, s);
  return (dup);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <vrna_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @vrna_alloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @vrna_alloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Nvm_Update();
int /*<<< orphan*/ Nvm_Write(int, int *, int);
int /*<<< orphan*/ Protocol_BufferSynchronize();
void Settings_WriteCoordData(uint8_t coord_select, float *coord_data) {
  Protocol_BufferSynchronize();
  uint32_t addr = coord_select * (sizeof(float) * 5 + 1) + 512U;
  Nvm_Write(addr, (uint8_t *)coord_data, sizeof(float) * 5);
  Nvm_Update();
}


x86 assembly (clang, -O0):
<Settings_WriteCoordData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <Protocol_BufferSynchronize@plt>
movslq -0x4(%rbp),%rax
imul   $0x15,%rax,%rax
add    $0x200,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x14,%edx
call   1030 <Nvm_Write@plt>
mov    $0x0,%al
call   1050 <Nvm_Update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Settings_WriteCoordData>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <Protocol_BufferSynchronize@plt>
lea    (%rbx,%rbx,4),%eax
lea    (%rbx,%rax,4),%edi
add    $0x200,%edi
mov    %r14,%rsi
mov    $0x14,%edx
call   1030 <Nvm_Write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <Nvm_Update@plt>

LLVM IR (-O0):
define void @Settings_WriteCoordData(i32 %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
%5 = alloca i32
store i32 %0, i32* %3
store float* %1, float** %4
%6 = call i32 (...) @Protocol_BufferSynchronize()
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 21
%10 = add i64 %9, 512
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load float*, float** %4
%14 = bitcast float* %13 to i32*
%15 = call i32 @Nvm_Write(i32 %12, i32* %14, i32 20)
%16 = call i32 (...) @Nvm_Update()
ret void
}

LLVM IR (-O2):
define void @Settings_WriteCoordData(i32 %0, float* %1) {
%3 = tail call i32 (...) @Protocol_BufferSynchronize()
%4 = mul i32 %0, 21
%5 = add i32 %4, 512
%6 = bitcast float* %1 to i32*
%7 = tail call i32 @Nvm_Write(i32 %5, i32* %6, i32 20)
%8 = tail call i32 (...) @Nvm_Update()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ script_write_byte(char);
void script_LSD(char b1, char b2, char b3) {
  script_write_byte(138);
  script_write_byte(b1 + 2 * b2 + 4 * b3);
}


x86 assembly (clang, -O0):
<script_LSD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    $0xffffff8a,%edi
call   1030 <script_write_byte@plt>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
movsbl -0x3(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
movsbl %al,%edi
call   1030 <script_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_LSD>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xffffff8a,%edi
call   1030 <script_write_byte@plt>
add    %bpl,%bpl
add    %r14b,%bpl
shl    $0x2,%bl
add    %bpl,%bl
movsbl %bl,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <script_write_byte@plt>

LLVM IR (-O0):
define void @script_LSD(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = call i32 @script_write_byte(i8 signext -118)
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = mul nsw i32 2, %11
%13 = add nsw i32 %9, %12
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = mul nsw i32 4, %15
%17 = add nsw i32 %13, %16
%18 = trunc i32 %17 to i8
%19 = call i32 @script_write_byte(i8 signext %18)
ret void
}

LLVM IR (-O2):
define void @script_LSD(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @script_write_byte(i8 signext -118)
%5 = shl i8 %1, 1
%6 = add i8 %5, %0
%7 = shl i8 %2, 2
%8 = add i8 %6, %7
%9 = tail call i32 @script_write_byte(i8 signext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tms_command(int, int, int /*<<< orphan*/);
void goto_tlr() { tms_command(6, 0x1f, 0); }


x86 assembly (clang, -O0):
<goto_tlr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x1f,%esi
xor    %edx,%edx
call   1030 <tms_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<goto_tlr>:
mov    $0x6,%edi
mov    $0x1f,%esi
xor    %edx,%edx
jmp    1030 <tms_command@plt>

LLVM IR (-O0):
define void @goto_tlr() {
%1 = call i32 @tms_command(i32 6, i32 31, i32 0)
ret void
}

LLVM IR (-O2):
define void @goto_tlr() {
%1 = tail call i32 @tms_command(i32 6, i32 31, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int a_var;
  int b_var;
  a_var = b_var;
  printf("a_var = %d\n", a_var);
  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)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeca(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"a_var = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mutal_rec_a();
void mutal_rec_d() { mutal_rec_a(); }


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

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

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

LLVM IR (-O2):
define void @mutal_rec_d() {
%1 = tail call i32 (...) @mutal_rec_a()
ret void
}
/* Variables and functions */
char *dec_to_signed(char const *, long *);
char *dec_to_int(const char *str, int *out) {
  long v;
  char *cur = dec_to_signed(str, &v);
  if (cur != str) {
    *out = (int)v;
  }
  return cur;
}


x86 assembly (clang, -O0):
<dec_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <dec_to_signed@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     114b <dec_to_int+0x3b>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_to_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <dec_to_signed@plt>
cmp    %rbx,%rax
je     112d <dec_to_int+0x1d>
mov    (%rsp),%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @dec_to_int(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i8* @dec_to_signed(i8* %0, i64* %3)
%6 = icmp eq i8* %5, %0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %2
ret i8* %5
}
/* Type definitions */
struct field {
  int dummy;
};

/* Variables and functions */
struct field *get_params(const char *uri, unsigned int *n) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.field = type { i32 }
define noalias %struct.field* @get_params(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret %struct.field* null
}
/* Variables and functions */
int /*<<< orphan*/ IncreaseNumber(int);
int /*<<< orphan*/ IncreaseNumber2(int *);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int num = 0;
  IncreaseNumber(num);
  printf("Num now equals: %d\n\n", num);
  IncreaseNumber2(&num);
  printf("Num now equals: %d\n\n", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <IncreaseNumber@plt>
mov    -0x4(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <IncreaseNumber2@plt>
mov    -0x4(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
xor    %edi,%edi
call   1050 <IncreaseNumber@plt>
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
lea    0xc(%rsp),%rdi
call   1030 <IncreaseNumber2@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Num now equals: %d\0A\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @IncreaseNumber(i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 0)
%5 = call i32 @IncreaseNumber2(i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
long int bar(void *s, long int i) { return i * 2; }


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

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

LLVM IR (-O0):
define i64 @bar(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 2
ret i64 %6
}

LLVM IR (-O2):
define i64 @bar(i8* nocapture readnone %0, i64 %1) {
%3 = shl nsw i64 %1, 1
ret i64 %3
}
/* Variables and functions */
int *get_random_arr(int);
int /*<<< orphan*/ print_arr(int *, int);
int /*<<< orphan*/ quick_sort(int *, int /*<<< orphan*/, int);
int main() {
  int len = 25;
  int *arr = get_random_arr(len);
  print_arr(arr, len);
  quick_sort(arr, 0, len - 1);
  print_arr(arr, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x19,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <get_random_arr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <print_arr@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1050 <quick_sort@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x19,%edi
call   1040 <get_random_arr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x19,%esi
call   1030 <print_arr@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1050 <quick_sort@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
call   1030 <print_arr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 25, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @get_random_arr(i32 %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %2
%8 = call i32 @print_arr(i32* %6, i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = call i32 @quick_sort(i32* %9, i32 0, i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %2
%15 = call i32 @print_arr(i32* %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @get_random_arr(i32 25)
%2 = tail call i32 @print_arr(i32* %1, i32 25)
%3 = tail call i32 @quick_sort(i32* %1, i32 0, i32 24)
%4 = tail call i32 @print_arr(i32* %1, i32 25)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bwlzh_compress_gen(unsigned int *, int const,
                                      unsigned char *, int *, int,
                                      int /*<<< orphan*/);
void bwlzh_compress(unsigned int *vals, const int nvals, unsigned char *output,
                    int *output_len) {
  bwlzh_compress_gen(vals, nvals, output, output_len, 1, 0);
}


x86 assembly (clang, -O0):
<bwlzh_compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <bwlzh_compress_gen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwlzh_compress>:
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    1030 <bwlzh_compress_gen@plt>

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

LLVM IR (-O2):
define void @bwlzh_compress(i32* %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @bwlzh_compress_gen(i32* %0, i32 %1, i8* %2, i32* %3, i32 1, i32 0)
ret void
}
int is_digit(int c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <is_digit+0x24>
cmpl   $0x39,-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):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
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 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_D7uint16_mem(unsigned short *val) {
  return ((*val) & (-0xD7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D7uint16_mem>:
movzwl (%rdi),%eax
test   $0xff29,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D7uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -215
%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_D7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -215
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo022(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo022(i32 %0) {
ret void
}
/* Variables and functions */
int cfg_processor_get_hex_int_attr(void *, char *);
int cfg_io_get_gpio_sel_addr(void *port) {
  return cfg_processor_get_hex_int_attr(port, "sel");
}


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

x86 assembly (clang, -O2):
<cfg_io_get_gpio_sel_addr>:
lea    0xee9(%rip),%rsi
jmp    1030 <cfg_processor_get_hex_int_attr@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"sel\00"
define i32 @cfg_io_get_gpio_sel_addr(i8* %0) {
%2 = tail call i32 @cfg_processor_get_hex_int_attr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ basic_test();
int /*<<< orphan*/ begin_with_timestamp_test();
int /*<<< orphan*/ gbk_test();
int /*<<< orphan*/ no_newline_test();
int /*<<< orphan*/ offset_test();
int /*<<< orphan*/ tail_test();
int main() {
  basic_test();
  gbk_test();
  offset_test();
  no_newline_test();
  begin_with_timestamp_test();
  tail_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1060 <gbk_test@plt>
mov    $0x0,%al
call   1040 <offset_test@plt>
mov    $0x0,%al
call   1070 <no_newline_test@plt>
mov    $0x0,%al
call   1080 <begin_with_timestamp_test@plt>
mov    $0x0,%al
call   1050 <tail_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <basic_test@plt>
xor    %eax,%eax
call   1060 <gbk_test@plt>
xor    %eax,%eax
call   1040 <offset_test@plt>
xor    %eax,%eax
call   1070 <no_newline_test@plt>
xor    %eax,%eax
call   1080 <begin_with_timestamp_test@plt>
xor    %eax,%eax
call   1050 <tail_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @basic_test()
%3 = call i32 (...) @gbk_test()
%4 = call i32 (...) @offset_test()
%5 = call i32 (...) @no_newline_test()
%6 = call i32 (...) @begin_with_timestamp_test()
%7 = call i32 (...) @tail_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic_test()
%2 = tail call i32 (...) @gbk_test()
%3 = tail call i32 (...) @offset_test()
%4 = tail call i32 (...) @no_newline_test()
%5 = tail call i32 (...) @begin_with_timestamp_test()
%6 = tail call i32 (...) @tail_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from file1.c\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello from file1.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t extract_variantkey_refalt(uint64_t vk) {
  return (uint32_t)(vk & 0x000000007FFFFFFF);
}


x86 assembly (clang, -O0):
<extract_variantkey_refalt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_variantkey_refalt>:
mov    %edi,%eax
and    $0x7fffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @extract_variantkey_refalt(i32 %0) {
%2 = and i32 %0, 2147483647
ret i32 %2
}
void set2(unsigned long addr) { *((int *)addr) = 2; }


x86 assembly (clang, -O0):
<set2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set2>:
movl   $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @set2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
store i32 2, i32* %4
ret void
}

LLVM IR (-O2):
define void @set2(i64 %0) {
%2 = inttoptr i64 %0 to i32*
store i32 2, i32* %2
ret void
}
void rop3_159_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_159_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_159_0_0>:
xor    (%rdi),%sil
and    %dl,%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_159_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_159_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
void *realloc(void *, size_t);
void *checked_realloc(void *ptr, size_t size) {
  void *ret = realloc(ptr, size);
  if (!ret && size)
    fail("Could not allocate memory: call to realloc failed.");
  return ret;
}


x86 assembly (clang, -O0):
<checked_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1163 <checked_realloc+0x43>
cmpq   $0x0,-0x10(%rbp)
je     1163 <checked_realloc+0x43>
lea    0xea2(%rip),%rdi
call   1030 <fail@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <checked_realloc+0x25>
test   %r14,%r14
jne    1145 <checked_realloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <fail@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Could not allocate memory: call to realloc failed.\00"
define i8* @checked_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @fail(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [51 x i8] c"Could not allocate memory: call to realloc failed.\00"
define noalias i8* @checked_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @fail(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sdTerminalTerm();
void ioTerm(void) { sdTerminalTerm(); }


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

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

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

LLVM IR (-O2):
define void @ioTerm() {
%1 = tail call i32 (...) @sdTerminalTerm()
ret void
}
float foo(float x) {
  x += 1;
  x -= 1;
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed8(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @foo(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float %3, 1.000000e+00
store float %4, float* %2
%5 = load float, float* %2
%6 = fsub float %5, 1.000000e+00
store float %6, float* %2
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
define float @foo(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fadd float %2, -1.000000e+00
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ free_pair_precomp();
void tersoff2_param_finalize() { free_pair_precomp(); }


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

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

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

LLVM IR (-O2):
define void @tersoff2_param_finalize() {
%1 = tail call i32 (...) @free_pair_precomp()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
pexit(char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pexit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @pexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @pexit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ M_PI;
double exp(double);
double lgamma(double);
double log(int /*<<< orphan*/);
double sphere_volume(double dimension) {
  double log_gamma, log_volume;
  log_gamma = lgamma(dimension / 2.0 + 1);
  log_volume = dimension / 2.0 * log(M_PI) - log_gamma;
  return exp(log_volume);
}


x86 assembly (clang, -O0):
<sphere_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <lgamma@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphere_volume>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
mulsd  0xec0(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xeba(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <lgamma@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <log@plt>
mulsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define double @sphere_volume(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fdiv double %5, 2.000000e+00
%7 = fadd double %6, 1.000000e+00
%8 = call double @lgamma(double %7)
store double %8, double* %3
%9 = load double, double* %2
%10 = fdiv double %9, 2.000000e+00
%11 = load i32, i32* @M_PI
%12 = call double @log(i32 %11)
%13 = load double, double* %3
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %10, double %12, double %14)
store double %15, double* %4
%16 = load double, double* %4
%17 = call double @exp(double %16)
ret double %17
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @sphere_volume(double %0) {
%2 = fmul double %0, 5.000000e-01
%3 = fadd double %2, 1.000000e+00
%4 = tail call double @lgamma(double %3)
%5 = load i32, i32* @M_PI
%6 = tail call double @log(i32 %5)
%7 = fneg double %4
%8 = tail call double @llvm.fmuladd.f64(double %2, double %6, double %7)
%9 = tail call double @exp(double %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void print_version(void) {
  fprintf(stdout, "YAUL version %s - Yet another UDP logger\n", "n/a");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xeff(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xf03(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [42 x i8] c"YAUL version %s - Yet another UDP logger\0A\00"
@.str.1 = [4 x i8] c"n/a\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [42 x i8] c"YAUL version %s - Yet another UDP logger\0A\00"
@.str.1 = [4 x i8] c"n/a\00"
define void @print_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int write(int fd, char *buf, int nbytes) {
  (void)fd;
  (void)buf;
  (void)nbytes;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WriteBytecode(char *);
void InitializeBytecode() {
  WriteBytecode(".class public Bytecode\n"
                ".super java/lang/Object\n\n"
                ".method public <init>()V\n"
                "\taload_0\n\n"
                "\tinvokenonvirtual java/lang/Object/<init>()V\n"
                "\treturn\n"
                ".end method\n\n"
                ".method public static main([Ljava/lang/String;)V\n"
                "\t.limit stack  10\n"
                "\t.limit locals 10\n");
}


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

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

LLVM IR (-O0):
@.str = [235 x i8] c".class public Bytecode\0A.super java/lang/Object\0A\0A.method public <init>()V\0A\09aload_0\0A\0A\09invokenonvirtual java/lang/Object/<init>()V\0A\09return\0A.end method\0A\0A.method public static main([Ljava/lang/String;)V\0A\09.limit stack 10\0A\09.limit locals 10\0A\00"
define void @InitializeBytecode() {
%1 = call i32 @WriteBytecode(i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [235 x i8] c".class public Bytecode\0A.super java/lang/Object\0A\0A.method public <init>()V\0A\09aload_0\0A\0A\09invokenonvirtual java/lang/Object/<init>()V\0A\09return\0A.end method\0A\0A.method public static main([Ljava/lang/String;)V\0A\09.limit stack 10\0A\09.limit locals 10\0A\00"
define void @InitializeBytecode() {
%1 = tail call i32 @WriteBytecode(i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hook(char *);
void run(void) { hook("run() called inside all-good."); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"run() called inside all-good.\00"
define void @run() {
%1 = call i32 @hook(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"run() called inside all-good.\00"
define void @run() {
%1 = tail call i32 @hook(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
char skip_chars(const char **c) {
  for (; **c == ' ' || **c == '\t'; *c = *c + 1)
    ;
  return **c;
}


x86 assembly (clang, -O0):
<skip_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1133 <skip_chars+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <skip_chars+0x43>
jmp    115f <skip_chars+0x5f>
jmp    1148 <skip_chars+0x48>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1108 <skip_chars+0x8>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_chars>:
mov    (%rdi),%rcx
jmp    1113 <skip_chars+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,(%rdi)
add    $0x1,%rcx
movzbl -0x1(%rcx),%eax
cmp    $0x20,%al
je     1110 <skip_chars+0x10>
cmp    $0x9,%al
je     1110 <skip_chars+0x10>
ret

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

LLVM IR (-O2):
define signext i8 @skip_chars(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long *);
void *foo_ptr(long i, long j) {
  printf("foo_ptr: i: %ld, address: %p\n", i, &i);
  printf("foo_ptr: j: %ld, address: %p\n", j, &j);
  return (void *)(i * j);
}


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

x86 assembly (clang, -O2):
<foo_ptr>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rdi,0x8(%rsp)
mov    %rbx,(%rsp)
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rdx
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rsp,%rdx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%rsp),%rax
imul   0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"foo_ptr: i: %ld, address: %p\0A\00"
@.str.1 = [30 x i8] c"foo_ptr: j: %ld, address: %p\0A\00"
define i8* @foo_ptr(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 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %5, i64* %3)
%7 = load i64, i64* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i64 %7, i64* %4)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = mul nsw i64 %9, %10
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
@.str = [30 x i8] c"foo_ptr: i: %ld, address: %p\0A\00"
@.str.1 = [30 x i8] c"foo_ptr: j: %ld, address: %p\0A\00"
define i8* @foo_ptr(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %0, i64* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i64 %1, i64* %4)
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul nsw i64 %8, %7
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_lstdelcontent(void *data, size_t size) {
  if (data)
    free(data);
  size = 0;
}


x86 assembly (clang, -O0):
<ft_lstdelcontent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <ft_lstdelcontent+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_lstdelcontent>:
test   %rdi,%rdi
je     111a <ft_lstdelcontent+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @ft_lstdelcontent(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
void zlRotatey(signed long y) {}


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

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

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

LLVM IR (-O2):
define void @zlRotatey(i64 %0) {
ret void
}
void aregister() { register int a3; }


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

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

LLVM IR (-O0):
define void @aregister() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @aregister() {
ret void
}
void fun() {}


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

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

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

LLVM IR (-O2):
define void @fun() {
ret void
}
notify(s) char *s;
{
  printf("%s test appears to be inconsistent...\n", s);
  printf("   PLEASE NOTIFY KARPINKSI!\n");
}


x86 assembly (clang, -O0):
<notify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notify>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"%s test appears to be inconsistent...\0A\00"
@.str.1 = [29 x i8] c" PLEASE NOTIFY KARPINKSI!\0A\00"
define i32 @notify(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [39 x i8] c"%s test appears to be inconsistent...\0A\00"
@str = [28 x i8] c" PLEASE NOTIFY KARPINKSI!\00"
define i32 @notify(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void outsb(int port, const void *addr, unsigned long count) {
  asm volatile("rep; outs"
               "b"
               : "+S"(addr), "+c"(count)
               : "d"(port));
}


x86 assembly (clang, -O0):
<outsb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x4(%rbp),%edx
rep outsb %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsb>:
mov    %rdx,%rcx
mov    %edi,%edx
rep outsb %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsb(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32, i32* %4
%10 = call { i8*, i64 } asm sideeffect "rep; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i8* %7, i64 %8)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsb(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
ret void
}
int test(int a) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int write_int(char *, int);
int idlestat_trace_enable(bool enable) {
  return write_int("/sys/kernel/debug/tracing"
                   "/tracing_on",
                   enable);
}


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

x86 assembly (clang, -O2):
<idlestat_trace_enable>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <write_int@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"/sys/kernel/debug/tracing/tracing_on\00"
define i32 @idlestat_trace_enable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write_int(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [37 x i8] c"/sys/kernel/debug/tracing/tracing_on\00"
define i32 @idlestat_trace_enable(i32 %0) {
%2 = tail call i32 @write_int(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}