xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ si475x_set_property(int, unsigned char);
void si475xFMRX_set_volume(unsigned char volume) {
  si475x_set_property(0x0301, 0);
  si475x_set_property(0x0300, volume);
}


x86 assembly (clang, -O0):
<si475xFMRX_set_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x301,%edi
xor    %esi,%esi
call   1030 <si475x_set_property@plt>
mov    $0x300,%edi
movzbl -0x1(%rbp),%esi
call   1030 <si475x_set_property@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xFMRX_set_volume>:
push   %rbx
mov    %edi,%ebx
mov    $0x301,%edi
xor    %esi,%esi
call   1030 <si475x_set_property@plt>
mov    $0x300,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <si475x_set_property@plt>

LLVM IR (-O0):
define void @si475xFMRX_set_volume(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @si475x_set_property(i32 769, i8 zeroext 0)
%4 = load i8, i8* %2
%5 = call i32 @si475x_set_property(i32 768, i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @si475xFMRX_set_volume(i8 zeroext %0) {
%2 = tail call i32 @si475x_set_property(i32 769, i8 zeroext 0)
%3 = tail call i32 @si475x_set_property(i32 768, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void f_memcpy_(void *new, void *old, int *length) {
  memcpy(new, old, *length);
  return;
}


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

x86 assembly (clang, -O2):
<f_memcpy_>:
mov    (%rdx),%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @f_memcpy_(i8* %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeCharToSerial(int /*<<< orphan*/);
void writeStringToSerial(char *str) {
  while (*str != 0x00)
    writeCharToSerial(*str++);
}


x86 assembly (clang, -O0):
<writeStringToSerial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <writeStringToSerial+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <writeCharToSerial@plt>
jmp    111c <writeStringToSerial+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeStringToSerial>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <writeStringToSerial+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <writeCharToSerial@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <writeStringToSerial+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @writeStringToSerial(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @writeCharToSerial(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRB4_set(void) { return U_WMRCORENONE_set("U_WMRB4"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB4\00"
define i8* @U_WMRB4_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB4\00"
define i8* @U_WMRB4_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void DCMI_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DCMI_IRQHandler() {
ret void
}
int rt_hw_interrupt_disable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rt_hw_interrupt_disable() {
ret i32 0
}
int dbg_is_power_cut(const struct ubifs_info *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_is_power_cut(%struct.ubifs_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_1f(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x46BD7771;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x46bd7771,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_1f>:
xor    $0x46bd7771,%edi
jmp    1030 <yahoo_M1Common@plt>

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

LLVM IR (-O2):
define i32 @yahoo_f01_1f(i32 %0, i32 %1) {
%3 = xor i32 %0, 1186822001
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DrawReversed(int);
int main() {
  DrawReversed(5170984);
  DrawReversed(406567);
  DrawReversed(368750);
  DrawReversed(2369510);
  DrawReversed(2183293);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4ee728,%edi
call   1030 <DrawReversed@plt>
mov    $0x63427,%edi
call   1030 <DrawReversed@plt>
mov    $0x5a06e,%edi
call   1030 <DrawReversed@plt>
mov    $0x2427e6,%edi
call   1030 <DrawReversed@plt>
mov    $0x21507d,%edi
call   1030 <DrawReversed@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4ee728,%edi
call   1030 <DrawReversed@plt>
mov    $0x63427,%edi
call   1030 <DrawReversed@plt>
mov    $0x5a06e,%edi
call   1030 <DrawReversed@plt>
mov    $0x2427e6,%edi
call   1030 <DrawReversed@plt>
mov    $0x21507d,%edi
call   1030 <DrawReversed@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @DrawReversed(i32 5170984)
%3 = call i32 @DrawReversed(i32 406567)
%4 = call i32 @DrawReversed(i32 368750)
%5 = call i32 @DrawReversed(i32 2369510)
%6 = call i32 @DrawReversed(i32 2183293)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @DrawReversed(i32 5170984)
%2 = tail call i32 @DrawReversed(i32 406567)
%3 = tail call i32 @DrawReversed(i32 368750)
%4 = tail call i32 @DrawReversed(i32 2369510)
%5 = tail call i32 @DrawReversed(i32 2183293)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fail_file();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *umalloc(size_t size) {
  void *const addr = malloc(size);
  if (addr == 0) {
    fprintf(stderr, "malloc failed: %zu bytes\n", size);
    fail_file();
  }
  return addr;
}


x86 assembly (clang, -O0):
<umalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <umalloc+0x44>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <fail_file@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1163 <umalloc+0x33>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <fail_file@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"malloc failed: %zu bytes\0A\00"
define i8* @umalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @fail_file()
br label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"malloc failed: %zu bytes\0A\00"
define noalias i8* @umalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @fail_file()
br label %8
8: ; preds = %4, %1
ret i8* %2
}
void XGeometry() {}


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

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

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

LLVM IR (-O2):
define void @XGeometry() {
ret void
}
double fmul(double a, double b) { return a * b; }


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

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

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

LLVM IR (-O2):
define double @fmul(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int _setgroupent(int /*<<< orphan*/);
int _setgrent(void) { return (_setgroupent(0)); }


x86 assembly (clang, -O0):
<_setgrent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_setgroupent@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_setgrent>:
xor    %edi,%edi
jmp    1030 <_setgroupent@plt>

LLVM IR (-O0):
define i32 @_setgrent() {
%1 = call i32 @_setgroupent(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @_setgrent() {
%1 = tail call i32 @_setgroupent(i32 0)
ret i32 %1
}
/* Variables and functions */
int SIGUSR1;
int SIGUSR2;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void signalHandler(int signo) {
  if (signo == SIGUSR1) {
    printf("\nReceived SIGUSR1 -> stop\n");
    exit(0);
  } else {
    if (signo == SIGUSR2) {
      printf("\nReceived SIGUSR2\n");
    }
  }
  return;
}


x86 assembly (clang, -O0):
<signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1150 <signalHandler+0x30>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%eax
jne    116e <signalHandler+0x4e>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <signalHandler+0x53>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHandler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
je     1146 <signalHandler+0x26>
mov    0x2ea5(%rip),%rax
cmp    %edi,(%rax)
jne    1144 <signalHandler+0x24>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@.str = [27 x i8] c"\0AReceived SIGUSR1 -> stop\0A\00"
@SIGUSR2 = global i32 0
@.str.1 = [19 x i8] c"\0AReceived SIGUSR2\0A\00"
define void @signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @SIGUSR2
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
br label %16
16: ; preds = %15
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIGUSR2 = global i32 0
@str = [18 x i8] c"\0AReceived SIGUSR2\00"
@str.2 = [26 x i8] c"\0AReceived SIGUSR1 -> stop\00"
define void @signalHandler(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = load i32, i32* @SIGUSR2
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %7, %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputs(char const *const, int /*<<< orphan*/ *const);
__attribute__((__unused__)) int(cheat_unwrapped_fputs)(
    char const *const message, FILE *const stream) {
  return fputs(message, stream);
}


x86 assembly (clang, -O0):
<cheat_unwrapped_fputs>:
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 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheat_unwrapped_fputs>:
jmp    1030 <fputs@plt>

LLVM IR (-O0):
define i32 @cheat_unwrapped_fputs(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 i32 @fputs(i8* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cheat_unwrapped_fputs(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fputs(i8* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
unsigned int radio_change_frequency(int /*<<< orphan*/);
unsigned int radio_inc_frequency(void) { return radio_change_frequency(0); }


x86 assembly (clang, -O0):
<radio_inc_frequency>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <radio_change_frequency@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<radio_inc_frequency>:
xor    %edi,%edi
jmp    1030 <radio_change_frequency@plt>

LLVM IR (-O0):
define i32 @radio_inc_frequency() {
%1 = call i32 @radio_change_frequency(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @radio_inc_frequency() {
%1 = tail call i32 @radio_change_frequency(i32 0)
ret i32 %1
}
/* Variables and functions */
scalar_t__ VALUE(int);
int /*<<< orphan*/ VAR(int);
int /*<<< orphan*/ printatomi(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void printlit(int l) {
  if (VALUE(l) == 0)
    printf("-");
  printatomi(VAR(l));
}


x86 assembly (clang, -O0):
<printlit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <VALUE@plt>
cmp    $0x0,%rax
jne    1169 <printlit+0x29>
lea    0xe9c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <VAR@plt>
mov    %eax,%edi
call   1060 <printatomi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlit>:
push   %rbx
mov    %edi,%ebx
call   1040 <VALUE@plt>
test   %rax,%rax
jne    1157 <printlit+0x17>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1050 <VAR@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <printatomi@plt>

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

LLVM IR (-O2):
define void @printlit(i32 %0) {
%2 = tail call i64 @VALUE(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @putchar(i32 45)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @VAR(i32 %0)
%8 = tail call i32 @printatomi(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
ushort my_ntohs(ushort netshort) { return ntohs(netshort); }


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

x86 assembly (clang, -O2):
<my_ntohs>:
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @my_ntohs(i32 %0) {
%2 = tail call i32 @ntohs(i32 %0)
ret i32 %2
}
/* Variables and functions */
int rand();
int pivot(int arr[], int i, int j) {
  int pivot = i + rand() % (j - i + 1);
  return pivot;
}


x86 assembly (clang, -O0):
<pivot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pivot>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pivot(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = call i32 (...) @rand()
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
%14 = srem i32 %9, %13
%15 = add nsw i32 %8, %14
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @pivot(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @rand()
%5 = sub i32 1, %1
%6 = add i32 %5, %2
%7 = srem i32 %4, %6
%8 = add nsw i32 %7, %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main() {
  static int x = 456;
  int y = 789;
  foo();
  foo();
  foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x315,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.x = internal global i32 456
define i32 @main() {
%1 = alloca i32
store i32 789, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 (...) @foo()
%4 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
scalar_t__ isalnum(int);
int BS_non_hyphen_length(char *boundary) {
  int count = 0;
  char *p = boundary;
  while (*p) {
    if (isalnum((int)*p))
      count++;
    p++;
  };
  return count;
}


x86 assembly (clang, -O0):
<BS_non_hyphen_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <BS_non_hyphen_length+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     1157 <BS_non_hyphen_length+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112b <BS_non_hyphen_length+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BS_non_hyphen_length>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114c <BS_non_hyphen_length+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isalnum@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <BS_non_hyphen_length+0x20>
jmp    114e <BS_non_hyphen_length+0x3e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @BS_non_hyphen_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i8* [ %13, %4 ], [ %0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = tail call i64 @isalnum(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int sum(int);
int main(int argc, char *argv[]) {
  int ret;
  int N;
  N = 1000;
  ret = sum(N);
  printf("1 + 2 + ... + %d = %d\n", N, ret);
  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)
movl   $0x3e8,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <sum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"1 + 2 + ... + %d = %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
store i32 1000, i32* %7
%8 = load i32, i32* %7
%9 = call i32 @sum(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"1 + 2 + ... + %d = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sum(i32 1000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1000, i32 %3)
ret i32 0
}
char HexChar(char ch) {
  static char const *const HexChars = "0123456789ABCDEF";
  return HexChars[ch & 0x0F];
}


x86 assembly (clang, -O0):
<HexChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HexChar>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@HexChar.HexChars = internal constant i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0)
@.str = [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @HexChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define signext i8 @HexChar(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ hieth_phy_reset();
void hieth_phy_resume(void) { hieth_phy_reset(); }


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

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

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

LLVM IR (-O2):
define void @hieth_phy_resume() {
%1 = tail call i32 (...) @hieth_phy_reset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f2();
int main(void) {
  int i;
  for (i = 0; i < 10; i++)
    f2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <f2@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @f2()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f2()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 (...) @f2()
%4 = tail call i32 (...) @f2()
%5 = tail call i32 (...) @f2()
%6 = tail call i32 (...) @f2()
%7 = tail call i32 (...) @f2()
%8 = tail call i32 (...) @f2()
%9 = tail call i32 (...) @f2()
%10 = tail call i32 (...) @f2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
long sysconf(int /*<<< orphan*/);
size_t get_page(void) {
  long int page;
  page = sysconf(_SC_PAGESIZE);
  if (page < 0)
    return 4096;
  return (size_t)page;
}


x86 assembly (clang, -O0):
<get_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1142 <get_page+0x32>
movq   $0x1000,-0x8(%rbp)
jmp    114a <get_page+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_page>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
test   %rax,%rax
mov    $0x1000,%ecx
cmovs  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i64 @get_page() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i64 @sysconf(i32 %1)
%3 = icmp slt i64 %2, 0
%4 = select i1 %3, i64 4096, i64 %2
ret i64 %4
}
/* Variables and functions */
long SnortStrtol(char const *, char **, int);
long SnortStrtolRange(const char *nptr, char **endptr, int base, long lo,
                      long hi) {
  long iRet = SnortStrtol(nptr, endptr, base);
  if ((iRet > hi) || (iRet < lo))
    *endptr = (char *)nptr;
  return iRet;
}


x86 assembly (clang, -O0):
<SnortStrtolRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <SnortStrtol@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
jg     115b <SnortStrtolRange+0x4b>
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1166 <SnortStrtolRange+0x56>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SnortStrtolRange>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r12
mov    %rcx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <SnortStrtol@plt>
cmp    %r12,%rax
jg     1133 <SnortStrtolRange+0x23>
cmp    %r15,%rax
jge    1136 <SnortStrtolRange+0x26>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @SnortStrtolRange(i8* %0, i8** %1, i32 %2, i64 %3, i64 %4) {
%6 = tail call i64 @SnortStrtol(i8* %0, i8** %1, i32 %2)
%7 = icmp sgt i64 %6, %4
%8 = icmp slt i64 %6, %3
%9 = or i1 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %5
store i8* %0, i8** %1
br label %11
11: ; preds = %5, %10
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *a, int length) {
  int i;
  for (i = 0; i < length; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
char *toupper_str(str)
char *str;
{
  static char temp_str[256];
  char *ptr;
  strcpy(temp_str, str);
  ptr = temp_str;
  while ((*ptr = (char)toupper((int)*ptr)))
    ptr++;
  return (temp_str);
}


x86 assembly (clang, -O0):
<toupper_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f09(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2efd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1172 <toupper_str+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <toupper_str+0x27>
lea    0x2ec7(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper_str>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f15(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1140 <toupper_str+0x20>
lea    0x2ee7(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@toupper_str.temp_str = internal global [256 x i8] zeroinitializer
define i8* @toupper_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @toupper_str.temp_str, i64 0, i64 0), i8* %4)
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @toupper_str.temp_str, i64 0, i64 0), i8** %3
br label %6
6: ; preds = %14, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 @toupper(i32 %9)
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
store i8 %11, i8* %12
%13 = icmp ne i8 %11, 0
br i1 %13, label %14, label %17
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %6
17: ; preds = %6
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @toupper_str.temp_str, i64 0, i64 0)
}

LLVM IR (-O2):
@toupper_str.temp_str = internal global [256 x i8] zeroinitializer
define i8* @toupper_str(i8* nocapture %0) {
%2 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @toupper_str.temp_str, i64 0, i64 0), i8* dereferenceable(1) %0)
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @toupper_str.temp_str, i64 0, i64 0), %1 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = tail call i32 @toupper(i32 %6)
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @toupper_str.temp_str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ _assert_true(unsigned long long, char *, char *, int);
int /*<<< orphan*/ free(void *);
void free_value(const void *value, void *cleanup_value_data) {
  _assert_true(((unsigned long long)((value))), "value",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/PGer/incubator-hawq/refs/"
               "heads/master/src/test/unit/cmockery/cmockery.c",
               501);
  free((void *)value);
}


x86 assembly (clang, -O0):
<free_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x1f5,%ecx
call   1040 <_assert_true@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_value>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0x1f5,%ecx
call   1040 <_assert_true@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"value\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PGer/incubator-hawq/refs/heads/master/src/test/unit/cmockery/cmockery.c\00"
define void @free_value(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = call i32 @_assert_true(i64 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i32 501)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"value\00"
@.str.1 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PGer/incubator-hawq/refs/heads/master/src/test/unit/cmockery/cmockery.c\00"
define void @free_value(i8* %0, i8* nocapture readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @_assert_true(i64 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.1, i64 0, i64 0), i32 501)
%5 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void swizzle(uint32_t *x) {
  uint32_t y;
  uint8_t *z;
  z = (uint8_t *)x;
  y = *x;
  z[0] = y & 0xFF;
  z[1] = (y >> 8) & 0xFF;
  z[2] = (y >> 16) & 0xFF;
  z[3] = (y >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<swizzle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swizzle>:
mov    (%rdi),%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %eax,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @swizzle(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32* %5, i32** %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, 255
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %3
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32, i32* %3
%18 = ashr i32 %17, 16
%19 = and i32 %18, 255
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32, i32* %3
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @swizzle(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 255
store i32 %3, i32* %0
%4 = lshr i32 %2, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %2, 16
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = lshr i32 %2, 24
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%i\n", sizeof(void *));
  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
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

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


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

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

LLVM IR (-O0):
define i32 @destroy_dlink_stack() {
%1 = call i32 (...) @destroy_dlink()
ret i32 %1
}

LLVM IR (-O2):
define i32 @destroy_dlink_stack() {
%1 = tail call i32 (...) @destroy_dlink()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void VM_putchar(int ch) { putchar(ch); }


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

x86 assembly (clang, -O2):
<VM_putchar>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @VM_putchar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strpbrk(char const *, char *);
__attribute__((__pure__)) bool string_is_glob(const char *p) {
  return !!strpbrk(p, "*?[");
}


x86 assembly (clang, -O0):
<string_is_glob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strpbrk@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_glob>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strpbrk@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"*?[\00"
define i32 @string_is_glob(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strpbrk(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"*?[\00"
define i32 @string_is_glob(i8* %0) {
%2 = tail call i32 @strpbrk(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}