xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void initialize(void) { setbuf(stdout, NULL); }


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <setbuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @initialize() {
%1 = load i32, i32* @stdout
%2 = call i32 @setbuf(i32 %1, i32* null)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @initialize() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setbuf(i32 %1, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bswap32(int /*<<< orphan*/);
uint32_t cpu_to_be32(uint32_t x) { return bswap32(x); }


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

x86 assembly (clang, -O2):
<cpu_to_be32>:
jmp    1030 <bswap32@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_be32(i32 %0) {
%2 = tail call i32 @bswap32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int visible;
typedef int control_id;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void BatchSetVisible(unsigned short int control_id, unsigned char visible) {
  SendChar(((control_id) >> 8) & 0xFF);
  SendChar((control_id)&0xFF);
  SendChar((1) & 0xFF);
  SendChar((visible)&0xFF);
}


x86 assembly (clang, -O0):
<BatchSetVisible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0x1,%edi
call   1030 <SendChar@plt>
movzbl -0x3(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BatchSetVisible>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bpl,%edi
call   1030 <SendChar@plt>
mov    $0x1,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @BatchSetVisible(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @SendChar(i32 %8)
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = and i32 %11, 255
%13 = call i32 @SendChar(i32 %12)
%14 = call i32 @SendChar(i32 1)
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = and i32 %16, 255
%18 = call i32 @SendChar(i32 %17)
ret void
}

LLVM IR (-O2):
define void @BatchSetVisible(i16 zeroext %0, i8 zeroext %1) {
%3 = zext i16 %0 to i32
%4 = lshr i32 %3, 8
%5 = tail call i32 @SendChar(i32 %4)
%6 = and i32 %3, 255
%7 = tail call i32 @SendChar(i32 %6)
%8 = tail call i32 @SendChar(i32 1)
%9 = zext i8 %1 to i32
%10 = tail call i32 @SendChar(i32 %9)
ret void
}
/* Variables and functions */
int INLINE_SYSCALL_CALL(int (*)(void const *), void const *);
int shmdt(const void *shmaddr) { return INLINE_SYSCALL_CALL(shmdt, shmaddr); }


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

x86 assembly (clang, -O2):
<shmdt>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rdi
jmp    1030 <INLINE_SYSCALL_CALL@plt>

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

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

/* Variables and functions */
unsigned char *tiger_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_tiger(unsigned char *out, FILE *fp) {
  return tiger_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_tiger>:
jmp    1030 <tiger_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_tiger(i8* %0, i32* %1) {
%3 = tail call i8* @tiger_file(i8* %0, i32* %1)
ret i8* %3
}
void CloseCOM(int portnum) { portnum; }


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

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

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

LLVM IR (-O2):
define void @CloseCOM(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void err_exit(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_exit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @err_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @err_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void bit_on(uint8_t *byte, uint8_t n) { *byte |= 1 << n; }


x86 assembly (clang, -O0):
<bit_on>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_on>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @bit_on(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i32, i32* %0
%5 = or i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wFree(char *);
int /*<<< orphan*/ wNotYet(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasTally() {
  char *search, *match;
  match = wPopString();
  search = wPopString();
  wNotYet("Tally");
  wFree(match);
  wFree(search);
  wPushNumber(0);
}


x86 assembly (clang, -O0):
<wBasTally>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x8(%rbp)
lea    0xe9b(%rip),%rdi
call   1050 <wNotYet@plt>
mov    -0x10(%rbp),%rdi
call   1060 <wFree@plt>
mov    -0x8(%rbp),%rdi
call   1060 <wFree@plt>
xor    %edi,%edi
call   1040 <wPushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasTally>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rdi
call   1050 <wNotYet@plt>
mov    %r14,%rdi
call   1060 <wFree@plt>
mov    %rbx,%rdi
call   1060 <wFree@plt>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <wPushNumber@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Tally\00"
define void @wBasTally() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @wPopString()
store i8* %3, i8** %2
%4 = call i8* (...) @wPopString()
store i8* %4, i8** %1
%5 = call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @wFree(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @wFree(i8* %8)
%10 = call i32 @wPushNumber(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Tally\00"
define void @wBasTally() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @wFree(i8* %1)
%5 = tail call i32 @wFree(i8* %2)
%6 = tail call i32 @wPushNumber(i32 0)
ret void
}
f(a) char *a;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i8* nocapture readnone %0) {
ret i32 0
}
double f0(double x) { return x * x * x; }


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

x86 assembly (clang, -O2):
<f0>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @f0(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
pr_elsif(quest) char *quest;
{
  printf("fprint( outfile, \"}\else if\");");
  pr_text_with_conversions(quest + 5);
  printf("fprint( outfile, \"{\");");
}


x86 assembly (clang, -O0):
<pr_elsif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
add    $0x5,%rdi
mov    $0x0,%al
call   1030 <pr_text_with_conversions@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_elsif>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x5,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <pr_text_with_conversions@plt>
lea    0xed7(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"fprint( outfile, \22}\1Blse if\22);\00"
@.str.1 = [23 x i8] c"fprint( outfile, \22{\22);\00"
define i32 @pr_elsif(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @pr_text_with_conversions to i32 (i8*, ...)*)(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [30 x i8] c"fprint( outfile, \22}\1Blse if\22);\00"
@.str.1 = [23 x i8] c"fprint( outfile, \22{\22);\00"
define i32 @pr_elsif(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 5
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @pr_text_with_conversions to i32 (i8*, ...)*)(i8* %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ display();
int /*<<< orphan*/ helper(char);
int /*<<< orphan*/ printf(char *);
void branching(char c) {
  switch (c) {
  case 'a':
  case 's':
    helper(c);
    break;
  case 'd':
    display();
    break;
  case 'q':
    break;
  default:
    printf("Invalid input!\n");
  }
}


x86 assembly (clang, -O0):
<branching>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x12,%eax
ja     1187 <branching+0x57>
mov    -0x10(%rbp),%rax
lea    0xea1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x1(%rbp),%edi
call   1050 <helper@plt>
jmp    1193 <branching+0x63>
mov    $0x0,%al
call   1030 <display@plt>
jmp    1193 <branching+0x63>
jmp    1193 <branching+0x63>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<branching>:
lea    -0x61(%rdi),%eax
cmp    $0x12,%eax
ja     1151 <branching+0x21>
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl %dil,%edi
jmp    1050 <helper@plt>
lea    0xef4(%rip),%rdi
jmp    1030 <puts@plt>
xor    %eax,%eax
jmp    1040 <display@plt>
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Invalid input!\0A\00"
define void @branching(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %11 [
i32 97, label %5
i32 115, label %5
i32 100, label %8
i32 113, label %10
]
5: ; preds = %1, %1
%6 = load i8, i8* %2
%7 = call i32 @helper(i8 signext %6)
br label %13
8: ; preds = %1
%9 = call i32 (...) @display()
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %10, %8, %5
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Invalid input!\00"
define void @branching(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 97, label %3
i32 115, label %3
i32 100, label %5
i32 113, label %9
]
3: ; preds = %1, %1
%4 = tail call i32 @helper(i8 signext %0)
br label %9
5: ; preds = %1
%6 = tail call i32 (...) @display()
br label %9
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1, %5, %3
ret void
}
/* Variables and functions */
long long _f_llrint(double);
long long int llrint(double x) { return _f_llrint(x); }


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

x86 assembly (clang, -O2):
<llrint>:
jmp    1030 <_f_llrint@plt>

LLVM IR (-O0):
define i64 @llrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @_f_llrint(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = tail call i64 @_f_llrint(double %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void avro_allocator_system_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<avro_allocator_system_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @avro_allocator_system_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int __test() { return sizeof("foo"); }


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

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

LLVM IR (-O0):
define i32 @__test() {
ret i32 4
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 4
}
void f(void) {
  int i = 0;
  i = (i) ?: 42;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1125 <f+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <f+0x32>
mov    $0x2a,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <f+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %4
%7 = phi i32 [ %2, %4 ], [ 42, %5 ]
store i32 %7, i32* %1
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, int);
bool write_8(FILE *this, int8_t x) { return fprintf(this, "%c", x) >= 0; }


x86 assembly (clang, -O0):
<write_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_8>:
push   %rax
mov    %esi,%edx
lea    0xee6(%rip),%rsi
call   1030 <fprintf@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @write_8(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i64 @fprintf(i32* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp sge i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @write_8(i32* nocapture %0, i32 %1) {
%3 = tail call i64 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
int bitAnd(int x, int y) { return (~(~x | ~y)); }


x86 assembly (clang, -O0):
<bitAnd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitAnd>:
mov    %edi,%eax
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bitAnd(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
void NOR_SPI_RX_ISR(void) {}


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

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

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

LLVM IR (-O2):
define void @NOR_SPI_RX_ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned char uart0GetCh();
void myfunc() {
  unsigned char ch;
  ch = uart0GetCh();
  switch (ch) {
  case 'h':
    printf("myfunc:  hello ! \r\n");
    break;
  }
  return;
}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <uart0GetCh@plt>
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
sub    $0x68,%al
jne    114e <myfunc+0x2e>
jmp    1142 <myfunc+0x22>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunc>:
push   %rax
xor    %eax,%eax
call   1040 <uart0GetCh@plt>
cmp    $0x68,%al
jne    1139 <myfunc+0x19>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"myfunc: hello ! \0D\0A\00"
define void @myfunc() {
%1 = alloca i8
%2 = call zeroext i8 (...) @uart0GetCh()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
switch i32 %4, label %7 [
i32 104, label %5
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"myfunc: hello ! \0D\00"
define void @myfunc() {
%1 = tail call zeroext i8 (...) @uart0GetCh()
%2 = icmp eq i8 %1, 104
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
int OK;
int resetterm() { return (OK); }


x86 assembly (clang, -O0):
<resetterm>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetterm>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @resetterm() {
%1 = load i32, i32* @OK
ret i32 %1
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @resetterm() {
%1 = load i32, i32* @OK
ret i32 %1
}
/* Variables and functions */
int write(int, int *, int);
int writebyte(int fd, int byte) { return (write(fd, &byte, 1)); }


x86 assembly (clang, -O0):
<writebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writebyte>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @writebyte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @write(i32 %5, i32* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @writebyte(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, size_t, int);
void skip(FILE *f, size_t n) {
  if (n > 0) {
    fseek(f, n, 1);
  }
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    113d <skip+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
test   %rsi,%rsi
je     111f <skip+0xf>
mov    $0x1,%edx
jmp    1030 <fseek@plt>
ret

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

LLVM IR (-O2):
define void @skip(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @fseek(i32* %0, i64 %1, i32 1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *join(const char *s1, const char *s2) {
  char *result = malloc(strlen(s1) + strlen(s2) + 1);
  if (result) {
    strcpy(result, s1);
    strcat(result, s2);
  }
  return result;
}


x86 assembly (clang, -O0):
<join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     119f <join+0x5f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1186 <join+0x46>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @join(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
%11 = tail call i32 @strcat(i8* %7, i8* %1)
br label %12
12: ; preds = %9, %2
ret i8* %7
}
/* Variables and functions */
int anetGenericResolve(char *, char *, char *, size_t, int);
int anetResolveIP(char *err, char *host, char *ipbuf, size_t ipbuf_len) {
  return anetGenericResolve(err, host, ipbuf, ipbuf_len, (1 << 0));
}


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

x86 assembly (clang, -O2):
<anetResolveIP>:
mov    $0x1,%r8d
jmp    1030 <anetGenericResolve@plt>

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

LLVM IR (-O2):
define i32 @anetResolveIP(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @anetGenericResolve(i8* %0, i8* %1, i8* %2, i64 %3, i32 1)
ret i32 %5
}
/* Variables and functions */
unsigned int next_utf8(char const *, int *);
int fn_cl_48_53(const char *text) {
  int pos = 0;
  unsigned int c = next_utf8(text, &pos);
  if (c >= 48 && c <= 53)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_cl_48_53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x30,-0x18(%rbp)
jb     1152 <fn_cl_48_53+0x42>
cmpl   $0x35,-0x18(%rbp)
ja     1152 <fn_cl_48_53+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <fn_cl_48_53+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_cl_48_53>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,%ecx
add    $0xffffffd0,%ecx
mov    $0xffffffff,%eax
cmp    $0x6,%ecx
jae    1136 <fn_cl_48_53+0x26>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_cl_48_53(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @next_utf8(i8* %6, i32* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp uge i32 %8, 48
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* %5
%12 = icmp ule i32 %11, 53
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %16
15: ; preds = %10, %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @fn_cl_48_53(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = add i32 %4, -48
%6 = icmp ult i32 %5, 6
%7 = load i32, i32* %2
%8 = select i1 %6, i32 %7, i32 -1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ __my_little_hc128_seeded_init(int /*<<< orphan*/ *);
void hc128random_set(uint8_t seed[16]) { __my_little_hc128_seeded_init(seed); }


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

x86 assembly (clang, -O2):
<hc128random_set>:
jmp    1030 <__my_little_hc128_seeded_init@plt>

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

LLVM IR (-O2):
define void @hc128random_set(i32* %0) {
%2 = tail call i32 @__my_little_hc128_seeded_init(i32* %0)
ret void
}
void __VERIFIER_plot(const char *name, ...) { (void)name; }


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

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

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

LLVM IR (-O2):
define void @__VERIFIER_plot(i8* nocapture %0, ...) {
ret void
}
void timer_stats_timer_set_start_info(struct timer_list *timer) {}


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

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

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

LLVM IR (-O2):
%struct.timer_list = type opaque
define void @timer_stats_timer_set_start_info(%struct.timer_list* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ res;
typedef int id;

/* Variables and functions */
int _check_schedparam(unsigned int);
int _set_schedparam(unsigned int id, unsigned int pr) {
  unsigned int cmd;
  int res;
  cmd = ((0x12000000) | (((0x0) & 0x00000003) << 16) |
         (((id)&0x000000FF) << 8) | (((0x5C) & 0x000000FF) << 0));
  ((*(volatile unsigned int *)(cmd)) = pr);
  res = _check_schedparam(id);
  if (((res)&0x00000001))
    return (-1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<_set_schedparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
or     $0x12000000,%eax
or     $0x5c,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edi
call   1030 <_check_schedparam@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1162 <_set_schedparam+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <_set_schedparam+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_schedparam>:
push   %rax
mov    %edi,%eax
shl    $0x8,%eax
movzwl %ax,%eax
mov    %esi,0x1200005c(%rax)
call   1030 <_check_schedparam@plt>
and    $0x1,%eax
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_set_schedparam(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = or i32 301989888, %10
%12 = or i32 %11, 92
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %13, i32* %16
%17 = load i32, i32* %4
%18 = call i32 @_check_schedparam(i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = and i32 %19, 1
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %2
store i32 -1, i32* %3
br label %24
23: ; preds = %2
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @_set_schedparam(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = and i32 %3, 65280
%5 = or i32 %4, 301989980
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 %1, i32* %7
%8 = tail call i32 @_check_schedparam(i32 %0)
%9 = and i32 %8, 1
%10 = sub nsw i32 0, %9
ret i32 %10
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int EXIT_FAILURE;
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ perror(char *);
int get_file_size(int fildes) {
  struct stat file_stat;
  if (fstat(fildes, &file_stat) < 0)
    do {
      perror("fstat");
      return EXIT_FAILURE;
    } while (0);
  return file_stat.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jge    1163 <get_file_size+0x43>
jmp    1146 <get_file_size+0x26>
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <get_file_size+0x49>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
js     1133 <get_file_size+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [6 x i8] c"fstat\00"
@EXIT_FAILURE = global i32 0
define i32 @get_file_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
br label %9
9: ; preds = %8
%10 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %2
br label %16
12: ; No predecessors!
br label %13
13: ; preds = %12, %1
%14 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%15 = load i32, i32* %14
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [6 x i8] c"fstat\00"
@EXIT_FAILURE = global i32 0
define i32 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
br label %12
12: ; preds = %9, %6
%13 = phi i32 [ %8, %6 ], [ %11, %9 ]
ret i32 %13
}
void __attribute__((constructor)) initialize2() {
  printf(__func__);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<initialize2>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@__func__.initialize2 = [12 x i8] c"initialize2\00"
@.str = [2 x i8] c"\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize2, i8* null }]
define void @initialize2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.initialize2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.initialize2 = [12 x i8] c"initialize2\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize2, i8* null }]
define void @initialize2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.initialize2, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetWaitConstants(char byBoardNum, short wMasterClock, short wDiskingWait,
                       short wParallelWait, short wAfterExposureWait,
                       short wSerialWait, short wFlushSerialWait) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetWaitConstants>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8d,-0x1c(%rbp)
mov    %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    %eax,-0x18(%rbp)
mov    %edx,%eax
mov    -0x18(%rbp),%edx
mov    %eax,-0x14(%rbp)
mov    %esi,%eax
mov    -0x14(%rbp),%esi
mov    %eax,-0x10(%rbp)
mov    %edi,%r8d
mov    -0x10(%rbp),%edi
mov    %r9w,%ax
mov    0x10(%rbp),%r9w
mov    %r8b,-0x1(%rbp)
mov    %di,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
lea    0xe9e(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetWaitConstants(i8 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6) {
%8 = alloca i8
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i16
store i8 %0, i8* %8
store i16 %1, i16* %9
store i16 %2, i16* %10
store i16 %3, i16* %11
store i16 %4, i16* %12
store i16 %5, i16* %13
store i16 %6, i16* %14
%15 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetWaitConstants(i8 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6) {
%8 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
scalar_t__ dds_lookup(int);
int16_t dds_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale,
                int32_t phase) {
  int16_t amp;
  amp = (int16_t)(((int32_t)dds_lookup(*phase_acc + phase) * scale) >> 15);
  *phase_acc += phase_rate;
  return amp;
}


x86 assembly (clang, -O0):
<dds_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
add    -0x14(%rbp),%edi
call   1030 <dds_lookup@plt>
imul   -0x10(%rbp),%eax
sar    $0xf,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dds_mod>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
add    (%rdi),%ecx
mov    %ecx,%edi
call   1030 <dds_lookup@plt>
imul   %ebx,%eax
sar    $0xf,%eax
add    %r14d,0x0(%rbp)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dds_mod(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = load i32, i32* %8
%13 = add nsw i32 %11, %12
%14 = call i64 @dds_lookup(i32 %13)
%15 = trunc i64 %14 to i32
%16 = load i32, i32* %7
%17 = mul nsw i32 %15, %16
%18 = ashr i32 %17, 15
store i32 %18, i32* %9
%19 = load i32, i32* %6
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = add nsw i32 %21, %19
store i32 %22, i32* %20
%23 = load i32, i32* %9
ret i32 %23
}

LLVM IR (-O2):
define i32 @dds_mod(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* %0
%6 = add nsw i32 %5, %3
%7 = tail call i64 @dds_lookup(i32 %6)
%8 = trunc i64 %7 to i32
%9 = mul nsw i32 %8, %2
%10 = ashr i32 %9, 15
%11 = load i32, i32* %0
%12 = add nsw i32 %11, %1
store i32 %12, i32* %0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(void *);
void xfree(void *ptr) {
  if (ptr == NULL)
    errx(2, NULL);
  free(ptr);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <xfree+0x25>
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <errx@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1135 <xfree+0x15>
mov    $0x2,%edi
xor    %esi,%esi
call   1040 <errx@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @errx(i32 2, i32* null)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @free(i8* %0)
ret void
}
void tval() { asm volatile("movq $0x0, (%%r11)\n\t" :::); }


x86 assembly (clang, -O0):
<tval>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,(%r11)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tval>:
movq   $0x0,(%r11)
ret

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

LLVM IR (-O2):
define void @tval() {
tail call void asm sideeffect "movq $$0x0, (%r11)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void x3(void) {}


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

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

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

LLVM IR (-O2):
define void @x3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void show_version(void) {
  fputs("C "
        "0.06"
        "\n"
        "\n"
        "Copyright (C) 2006 Cybozu Labs, Inc.\n"
        "This is free software; see the source for copying conditions.  There "
        "is NO\n"
        "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
        "PURPOSE.\n"
        "\n"
        "Written by Kazuho Oku (http://labs.cybozu.co.jp/blog/kazuhoatwork/)\n",
        stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [266 x i8] c"C 0.06\0A\0ACopyright (C) 2006 Cybozu Labs, Inc.\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\0AWritten by Kazuho Oku (http://labs.cybozu.co.jp/blog/kazuhoatwork/)\0A\00"
@stdout = global i32 0
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [266 x i8] c"C 0.06\0A\0ACopyright (C) 2006 Cybozu Labs, Inc.\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\0AWritten by Kazuho Oku (http://labs.cybozu.co.jp/blog/kazuhoatwork/)\0A\00"
@stdout = global i32 0
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([266 x i8], [266 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ExecCfg(char *);
long CDRconfigure() {
  ExecCfg("configure");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"configure\00"
define i64 @CDRconfigure() {
%1 = tail call i32 @ExecCfg(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i64 0
}