xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reccursive_natural_till_0(int num) {
  if (num >= 0)
    printf("%d\n", num);
  else
    return 0;
  reccursive_natural_till_0(num - 1);
}


x86 assembly (clang, -O0):
<reccursive_natural_till_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1149 <reccursive_natural_till_0+0x29>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <reccursive_natural_till_0+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1160 <reccursive_natural_till_0+0x40>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <reccursive_natural_till_0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reccursive_natural_till_0>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     113f <reccursive_natural_till_0+0x2f>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jb     1130 <reccursive_natural_till_0+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @reccursive_natural_till_0(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %4, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 0
}
void troca(int *vet, int i, int j) {
  int aux = vet[i];
  vet[i] = vet[j];
  vet[j] = aux;
}


x86 assembly (clang, -O0):
<troca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<troca>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @troca(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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dterm();
int /*<<< orphan*/ dterms();
void cterm() {
  dterm();
  dterms();
}


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

x86 assembly (clang, -O2):
<cterm>:
push   %rax
xor    %eax,%eax
call   1040 <dterm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <dterms@plt>

LLVM IR (-O0):
define void @cterm() {
%1 = call i32 (...) @dterm()
%2 = call i32 (...) @dterms()
ret void
}

LLVM IR (-O2):
define void @cterm() {
%1 = tail call i32 (...) @dterm()
%2 = tail call i32 (...) @dterms()
ret void
}
/* Variables and functions */
int f363(int *);
int f364(int *p) { return f363(p); }


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

x86 assembly (clang, -O2):
<f364>:
jmp    1030 <f363@plt>

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

LLVM IR (-O2):
define i32 @f364(i32* %0) {
%2 = tail call i32 @f363(i32* %0)
ret i32 %2
}
unsigned int opp_limit_to_ceiling(int limit) {
  unsigned int ceiling;
  if (limit >= 0)
    ceiling = (limit < 8 ? limit : 8 - 1);
  else
    ceiling = 0;
  return ceiling;
}


x86 assembly (clang, -O0):
<opp_limit_to_ceiling>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113e <opp_limit_to_ceiling+0x3e>
cmpl   $0x8,-0x4(%rbp)
jge    1126 <opp_limit_to_ceiling+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <opp_limit_to_ceiling+0x33>
mov    $0x7,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <opp_limit_to_ceiling+0x33>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <opp_limit_to_ceiling+0x45>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opp_limit_to_ceiling>:
cmp    $0x7,%edi
mov    $0x7,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @opp_limit_to_ceiling(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32, i32* %2
br label %12
11: ; preds = %6
br label %12
12: ; preds = %11, %9
%13 = phi i32 [ %10, %9 ], [ 7, %11 ]
store i32 %13, i32* %3
br label %15
14: ; preds = %1
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @opp_limit_to_ceiling(i32 %0) {
%2 = icmp slt i32 %0, 7
%3 = select i1 %2, i32 %0, i32 7
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
int ZBarcode_Version() { return (2 * 10000) + (6 * 100) + 1; }


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

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

LLVM IR (-O0):
define i32 @ZBarcode_Version() {
ret i32 20601
}

LLVM IR (-O2):
define i32 @ZBarcode_Version() {
ret i32 20601
}
void uip_UdpAppHubInit(void) {}


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

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

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

LLVM IR (-O2):
define void @uip_UdpAppHubInit() {
ret void
}
double campox(double dy, double Bz) { return 1; }


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

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

LLVM IR (-O0):
define double @campox(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @campox(double %0, double %1) {
ret double 1.000000e+00
}
void int_to_leds_m$output_done(void) { int_to_leds_m$input$output_complete(1); }


x86 assembly (clang, -O0):
<int_to_leds_m$output_done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <int_to_leds_m$input$output_complete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_leds_m$output_done>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <int_to_leds_m$input$output_complete@plt>

LLVM IR (-O0):
define void @"int_to_leds_m$output_done"() {
%1 = call i32 (i32, ...) bitcast (i32 (...)* @"int_to_leds_m$input$output_complete" to i32 (i32, ...)*)(i32 1)
ret void
}

LLVM IR (-O2):
define void @"int_to_leds_m$output_done"() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @"int_to_leds_m$input$output_complete" to i32 (i32, ...)*)(i32 1)
ret void
}
main(ac, av) char **av;
{ execv("/opt/vclfiddle/run-varnish-container.pl", av); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"/opt/vclfiddle/run-varnish-container.pl\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execv to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8** %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"/opt/vclfiddle/run-varnish-container.pl\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i8*, i8**, ...) bitcast (i32 (...)* @execv to i32 (i8*, i8**, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_end(FILE *f) { fputs("</rss>\n", f); }


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

x86 assembly (clang, -O2):
<print_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"</rss>\0A\00"
define void @print_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"</rss>\0A\00"
define void @print_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret void
}
void border_ne_ext_diagonal_special_sand_long_hori(unsigned char *pic,
                                                   unsigned char *mirr) {
  *pic = 0x30;
  *mirr = 0x02;
}


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

x86 assembly (clang, -O2):
<border_ne_ext_diagonal_special_sand_long_hori>:
movb   $0x30,(%rdi)
movb   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @border_ne_ext_diagonal_special_sand_long_hori(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
store i8 48, i8* %5
%6 = load i8*, i8** %4
store i8 2, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_ne_ext_diagonal_special_sand_long_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 48, i8* %0
store i8 2, i8* %1
ret void
}
signed int vfprintf(struct _IO_FILE *restrict __stream,
                    const char *restrict __fmt, void **__ap) {
  signed int return_value___vfprintf_chk$1;
  return_value___vfprintf_chk$1 = __vfprintf_chk(__stream, 2 - 1, __fmt, __ap);
  return return_value___vfprintf_chk$1;
}


x86 assembly (clang, -O0):
<vfprintf>:
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),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <__vfprintf_chk@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <__vfprintf_chk@plt>

LLVM IR (-O0):
%struct._IO_FILE = type opaque
define i32 @vfprintf(%struct._IO_FILE* noalias %0, i8* noalias %1, i8** %2) {
%4 = alloca %struct._IO_FILE*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store %struct._IO_FILE* %0, %struct._IO_FILE** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%8 = load %struct._IO_FILE*, %struct._IO_FILE** %4
%9 = load i8*, i8** %5
%10 = load i8**, i8*** %6
%11 = call i32 (%struct._IO_FILE*, i32, i8*, i8**, ...) bitcast (i32 (...)* @__vfprintf_chk to i32 (%struct._IO_FILE*, i32, i8*, i8**, ...)*)(%struct._IO_FILE* %8, i32 1, i8* %9, i8** %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%struct._IO_FILE = type opaque
define i32 @vfprintf(%struct._IO_FILE* noalias %0, i8* noalias %1, i8** %2) {
%4 = tail call i32 (%struct._IO_FILE*, i32, i8*, i8**, ...) bitcast (i32 (...)* @__vfprintf_chk to i32 (%struct._IO_FILE*, i32, i8*, i8**, ...)*)(%struct._IO_FILE* %0, i32 1, i8* %1, i8** %2)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put4(void *p, uint32_t v) {
  uint8_t *u = p;
  u[0] = v >> 24;
  u[1] = v >> 16;
  u[2] = v >> 8;
  u[3] = v >> 0;
}


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

x86 assembly (clang, -O2):
<put4>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @put4(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = ashr i32 %1, 24
store i32 %4, i32* %3
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
%8 = ashr i32 %1, 8
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = getelementptr inbounds i8, i8* %0, i64 12
%12 = bitcast i8* %11 to i32*
store i32 %1, i32* %12
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 0U) {
      if (!(state[0UL] > local1)) {
        state[local1] = state[0UL] * state[0UL];
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 45871808UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    1154 <RandomFunc+0x54>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
ja     1145 <RandomFunc+0x45>
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
imul   $0x2bbf2c0,%rax,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
imul   $0x2bbf2c0,(%rdi),%eax
add    $0xc896adc0,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %29, %2
%13 = load i32, i32* %6
%14 = icmp ult i32 %13, 0
br i1 %14, label %15, label %34
15: ; preds = %12
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = icmp ugt i32 %17, %18
br i1 %19, label %29, label %20
20: ; preds = %15
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%22 = load i32, i32* %21
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%24 = load i32, i32* %23
%25 = mul i32 %22, %24
%26 = load i32, i32* %6
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %27
store i32 %25, i32* %28
br label %29
29: ; preds = %20, %15
%30 = load i32, i32* %6
%31 = zext i32 %30 to i64
%32 = add i64 %31, 2
%33 = trunc i64 %32 to i32
store i32 %33, i32* %6
br label %12
34: ; preds = %12
%35 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%36 = load i32, i32* %35
%37 = zext i32 %36 to i64
%38 = mul i64 %37, 45871808
%39 = trunc i64 %38 to i32
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 0
store i32 %39, i32* %41
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = mul i32 %3, 45871808
%5 = add i32 %4, -929649216
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pointer_arith2_Ok(int);
void call_pointer_arith2_Ok() { pointer_arith2_Ok(100); }


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

x86 assembly (clang, -O2):
<call_pointer_arith2_Ok>:
mov    $0x64,%edi
jmp    1030 <pointer_arith2_Ok@plt>

LLVM IR (-O0):
define void @call_pointer_arith2_Ok() {
%1 = call i32 @pointer_arith2_Ok(i32 100)
ret void
}

LLVM IR (-O2):
define void @call_pointer_arith2_Ok() {
%1 = tail call i32 @pointer_arith2_Ok(i32 100)
ret void
}
int run_admin(const char *path, const char *arguments) { return -1; }


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

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

LLVM IR (-O0):
define i32 @run_admin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @run_admin(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
char *strchr(char *, char);
char *eatcomments(char *line) {
  char *cptr;
  cptr = strchr(line, '#');
  if (cptr != NULL)
    line[cptr - line] = 0;
  return line;
}


x86 assembly (clang, -O0):
<eatcomments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <eatcomments+0x3c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @eatcomments(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %4, %1
ret i8* %0
}
void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
                                 const char *name) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_dbus_signal_blob_added(%struct.wpa_supplicant* nocapture %0, i8* nocapture %1) {
ret void
}
int __fpclassify(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<__fpclassify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fpclassify>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.__fpclassify = [13 x i8] c"__fpclassify\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @__fpclassify(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.__fpclassify, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.__fpclassify = [13 x i8] c"__fpclassify\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i32 @__fpclassify(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.__fpclassify, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void intHandler(int i) { printf("Interrupt signal catch\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Interrupt signal catch\0A\00"
define void @intHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Interrupt signal catch\00"
define void @intHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ process_line();
main() {
  char line[1000];
  while (process_line())
    ;
  printf("</ul>\n<!--#exec cmd=\"trailer\" -->\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <process_line@plt>
cmp    $0x0,%rax
je     1148 <main+0x28>
jmp    1132 <main+0x12>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <process_line@plt>
test   %rax,%rax
jne    1130 <main+0x10>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"</ul>\0A<!--#exec cmd=\22trailer\22 -->\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i64 (...) @process_line()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"</ul>\0A<!--#exec cmd=\22trailer\22 -->\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @process_line()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int bad9(const char *x) { return __builtin_constant_p(x[123456]); }


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

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

LLVM IR (-O0):
define i32 @bad9(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 123456
%5 = load i8, i8* %4
%6 = call i1 @llvm.is.constant.i8(i8 %5)
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @bad9(i8* nocapture %0) {
ret i32 0
}
int test_imm_F9int16_reg(short val) {
  return ((val) & (0xF9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F9int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xf9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F9int16_reg>:
test   $0xf9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F9int16_reg(i16 signext %0) {
%2 = and i16 %0, 249
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
char *strncpy_alloc(char **, char const *, int /*<<< orphan*/);
char *strcpy_alloc(char **to, const char *from) {
  return (strncpy_alloc(to, from, strlen(from)));
}


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

x86 assembly (clang, -O2):
<strcpy_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncpy_alloc@plt>

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

LLVM IR (-O2):
define i8* @strcpy_alloc(i8** %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @strncpy_alloc(i8** %0, i8* %1, i32 %3)
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ init();
int /*<<< orphan*/ run();
int main() {
  pid_t pid = fork();
  if (pid < 0)
    exit(1);
  if (pid == 0) {
    init();
    run();
    exit(0);
  } else {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    116f <main+0x2f>
mov    $0x1,%edi
call   1050 <exit@plt>
cmpq   $0x0,-0x10(%rbp)
jne    118f <main+0x4f>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <run@plt>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fork@plt>
test   %rax,%rax
jns    1157 <main+0x17>
mov    $0x1,%edi
call   1050 <exit@plt>
jne    1167 <main+0x27>
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <run@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = call i32 (...) @init()
%13 = call i32 (...) @run()
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %8
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = icmp eq i64 %1, 0
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = tail call i32 (...) @init()
%9 = tail call i32 (...) @run()
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %5
%12 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *, char *);
void pathtoolong(char *p, char *f) {
  error("Path buffer overflow for %s/%s\n", p, f);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Path buffer overflow for %s/%s\0A\00"
define void @pathtoolong(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Path buffer overflow for %s/%s\0A\00"
define void @pathtoolong(i8* %0, i8* %1) {
%3 = tail call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void UARTEnableSIR(uint32_t ui32Base, bool bLowPower) {
  ;
  if (bLowPower) {
    (*((volatile uint32_t *)(ui32Base + 0x00000030))) |=
        (0x00000002 | 0x00000004);
  } else {
    (*((volatile uint32_t *)(ui32Base + 0x00000030))) |= (0x00000002);
  }
}


x86 assembly (clang, -O0):
<UARTEnableSIR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <UARTEnableSIR+0x28>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
or     $0x6,%ecx
mov    %ecx,(%rax)
jmp    1137 <UARTEnableSIR+0x37>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTEnableSIR>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
movslq %edi,%rcx
shl    $0x2,%eax
or     0x30(%rcx),%eax
or     $0x2,%eax
mov    %eax,0x30(%rcx)
ret

LLVM IR (-O0):
define void @UARTEnableSIR(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 48
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, 6
store volatile i32 %13, i32* %11
br label %21
14: ; preds = %2
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 48
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = or i32 %19, 2
store volatile i32 %20, i32* %18
br label %21
21: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
define void @UARTEnableSIR(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i32 %0, 48
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = select i1 %3, i32 2, i32 6
%9 = or i32 %7, %8
store volatile i32 %9, i32* %6
ret void
}
int Bematech_FI_NumeroReducoes(Var, Retorno) {
  return Formata("\x1b|35|09|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_NumeroReducoes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_NumeroReducoes>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|09|\1B\00"
define i32 @Bematech_FI_NumeroReducoes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|09|\1B\00"
define i32 @Bematech_FI_NumeroReducoes(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int symb_count(char *);
int main() {
  char str[256];
  scanf("%s", &str[0]);
  printf("Characters count: %d\n", symb_count(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <symb_count@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <symb_count@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [22 x i8] c"Characters count: %d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @symb_count(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getmsec(void) {
  struct timeval tv;
  uint64_t msec;
  gettimeofday(&tv, NULL);
  msec = ((uint64_t)tv.tv_sec * 1000 + (uint64_t)tv.tv_usec / 1000);
  return msec;
}


x86 assembly (clang, -O0):
<getmsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmsec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @getmsec() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %7, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @getmsec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %11, %7
ret i32 %12
}
/* Variables and functions */
int test_if10(void) {
  if (1 - 1)
    return 0;
  return 'j';
}


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

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

LLVM IR (-O0):
define i32 @test_if10() {
ret i32 106
}

LLVM IR (-O2):
define i32 @test_if10() {
ret i32 106
}
unsigned int call_spawn(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_spawn() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PF_PACKET;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int CreateRawSocket(int protocol) {
  int rawsock;
  if ((rawsock = socket(PF_PACKET, SOCK_RAW, htons(protocol))) == -1) {
    perror("Error creating raw socket");
    exit(-1);
  }
  return rawsock;
}


x86 assembly (clang, -O0):
<CreateRawSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htons@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1060 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    119a <CreateRawSocket+0x5a>
lea    0xe75(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateRawSocket>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ea6(%rip),%rax
mov    (%rax),%ebx
mov    0x2e8d(%rip),%rax
mov    (%rax),%ebp
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1060 <socket@plt>
cmp    $0xffffffff,%eax
je     1171 <CreateRawSocket+0x31>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe88(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@.str = [26 x i8] c"Error creating raw socket\00"
define i32 @CreateRawSocket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @PF_PACKET
%5 = load i32, i32* @SOCK_RAW
%6 = load i32, i32* %2
%7 = call i32 @htons(i32 %6)
%8 = call i32 @socket(i32 %4, i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@.str = [26 x i8] c"Error creating raw socket\00"
define i32 @CreateRawSocket(i32 %0) {
%2 = load i32, i32* @PF_PACKET
%3 = load i32, i32* @SOCK_RAW
%4 = tail call i32 @htons(i32 %0)
%5 = tail call i32 @socket(i32 %2, i32 %3, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *nmx_alloc(size_t size) {
  void *p;
  p = malloc(size);
  return p;
}


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

x86 assembly (clang, -O2):
<nmx_alloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @nmx_alloc(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
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @nmx_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int sci_get_chip_id();
int soc_id_is_sc8735v1(void) {
  return ((sci_get_chip_id() & (0xFFFFFFFF)) == ((0x8300a001) & (0xFFFFFFFF)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc8735v1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sci_get_chip_id@plt>
and    $0xffffffff,%eax
cmp    $0x8300a001,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc8735v1>:
push   %rax
xor    %eax,%eax
call   1030 <sci_get_chip_id@plt>
xor    %ecx,%ecx
cmp    $0x8300a001,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @soc_id_is_sc8735v1() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = and i32 %1, -1
%3 = icmp eq i32 %2, -2097111039
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @soc_id_is_sc8735v1() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = icmp eq i32 %1, -2097111039
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ExportVaultDialog(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char const *);
void MenuExportVault(const char *key) { ExportVaultDialog(atoi(key)); }


x86 assembly (clang, -O0):
<MenuExportVault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <ExportVaultDialog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MenuExportVault>:
push   %rax
call   1040 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ExportVaultDialog@plt>

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

LLVM IR (-O2):
define void @MenuExportVault(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = tail call i32 @ExportVaultDialog(i32 %2)
ret void
}