xunge/DecIR huggingface dataset:
int host_sound_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @host_sound_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int dig, rev, a;
  printf("Enter the number");
  scanf("%d", &dig);
  for (dig; dig >= 1;) {
    a = dig % 10;
    rev = rev * 10 + a;
  }
  printf("%d ", rev);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1174 <main+0x54>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"Enter the number\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
unreachable
}
/* Variables and functions */
scalar_t__ isPrime(int);
int /*<<< orphan*/ printf(char *, unsigned long long);
int main(void) {
  long long unsigned sum = 0;
  int i = 0;
  while (i < 2000000) {
    if (isPrime(i)) {
      sum += i;
    }
    i++;
  }
  printf("\nsum: %llu\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e8480,-0x14(%rbp)
jge    1177 <main+0x57>
mov    -0x14(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     1169 <main+0x49>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x1e>
mov    -0x10(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %ebx,%edi
call   1040 <isPrime@plt>
test   %rax,%rax
cmovne %rbx,%rax
add    %rax,%r14
add    $0x1,%rbx
cmp    $0x1e8480,%rbx
jne    1130 <main+0x10>
lea    0xeab(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0Asum: %llu\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %9, %1 ]
%3 = phi i64 [ 0, %0 ], [ %8, %1 ]
%4 = trunc i64 %2 to i32
%5 = tail call i64 @isPrime(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i64 0, i64 %2
%8 = add i64 %7, %3
%9 = add nuw nsw i64 %2, 1
%10 = icmp eq i64 %9, 2000000
br i1 %10, label %11, label %1
11: ; preds = %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ write(int, char *, int);
void *process(void *arg) {
  int i;
  fprintf(stderr, "Starting process %s\n", (char *)arg);
  for (i = 0; i < 10000; i++) {
    write(1, (char *)arg, 1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1177 <process+0x57>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <process+0x2c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x2710,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0xffffffff,%ebp
jne    1150 <process+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Starting process %s\0A\00"
define i8* @process(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
store i32 0, i32* %3
br label %7
7: ; preds = %13, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10000
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = call i32 @write(i32 1, i8* %11, i32 1)
br label %13
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %7
16: ; preds = %7
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Starting process %s\0A\00"
define noalias i8* @process(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 0, %1 ], [ %7, %4 ]
%6 = tail call i32 @write(i32 1, i8* %0, i32 1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 10000
br i1 %8, label %9, label %4
9: ; preds = %4
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ert_format_timestamp(struct timespec *, char *, size_t,
                                        int /*<<< orphan*/ *);
void ert_exif_format_time(struct timespec *ts, size_t length, char *string) {
  ert_format_timestamp(ts, "%H/1,%M/1,%S/1", length, (uint8_t *)string);
}


x86 assembly (clang, -O0):
<ert_exif_format_time>:
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
lea    0xec9(%rip),%rsi
call   1030 <ert_format_timestamp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ert_exif_format_time>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <ert_format_timestamp@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [15 x i8] c"%H/1,%M/1,%S/1\00"
define void @ert_exif_format_time(%struct.timespec* %0, i64 %1, i8* %2) {
%4 = alloca %struct.timespec*
%5 = alloca i64
%6 = alloca i8*
store %struct.timespec* %0, %struct.timespec** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = call i32 @ert_format_timestamp(%struct.timespec* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %8, i32* %10)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@.str = [15 x i8] c"%H/1,%M/1,%S/1\00"
define void @ert_exif_format_time(%struct.timespec* %0, i64 %1, i8* %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @ert_format_timestamp(%struct.timespec* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %1, i32* %4)
ret void
}
int RAND_load_file(const char *file, long bytes) {
  if (bytes == -1)
    return 123456;
  else
    return bytes;
}


x86 assembly (clang, -O0):
<RAND_load_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    1123 <RAND_load_file+0x23>
movl   $0x1e240,-0x4(%rbp)
jmp    112a <RAND_load_file+0x2a>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_load_file>:
cmp    $0xffffffffffffffff,%rsi
mov    $0x1e240,%eax
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @RAND_load_file(i8* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, -1
%4 = trunc i64 %1 to i32
%5 = select i1 %3, i32 123456, i32 %4
ret i32 %5
}
/* Variables and functions */
double __nv_fabs(double);
double fabs(double __a) { return __nv_fabs(__a); }


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

x86 assembly (clang, -O2):
<fabs>:
jmp    1030 <__nv_fabs@plt>

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

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call double @__nv_fabs(double %0)
ret double %2
}
/* Variables and functions */
int sscanf(char *, char *, int *);
void parse_option_code(char *option_line, char *options_format, int *ret,
                       int override) {
  int minimal_options;
  if (sscanf(option_line, options_format, &minimal_options) == 1) {
    if (override) {
      *ret = minimal_options;
    } else {
      *ret |= minimal_options;
    }
  }
}


x86 assembly (clang, -O0):
<parse_option_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jne    1169 <parse_option_code+0x59>
cmpl   $0x0,-0x1c(%rbp)
je     1159 <parse_option_code+0x49>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1164 <parse_option_code+0x54>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
jmp    1169 <parse_option_code+0x59>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_option_code>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jne    1133 <parse_option_code+0x23>
mov    0x4(%rsp),%eax
test   %ebp,%ebp
jne    1131 <parse_option_code+0x21>
or     (%rbx),%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @parse_option_code(i8* nocapture %0, i8* nocapture %1, i32* nocapture %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 @sscanf(i8* %0, i8* %1, i32* %5)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = icmp eq i32 %3, 0
%11 = load i32, i32* %5
br i1 %10, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = or i32 %13, %11
br label %15
15: ; preds = %9, %12
%16 = phi i32 [ %14, %12 ], [ %11, %9 ]
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %4
ret void
}
/* Variables and functions */
int FASTR_getConnectionChar(void *);
int callGetCMethod(void *conn) { return FASTR_getConnectionChar(conn); }


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

x86 assembly (clang, -O2):
<callGetCMethod>:
jmp    1030 <FASTR_getConnectionChar@plt>

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

LLVM IR (-O2):
define i32 @callGetCMethod(i8* %0) {
%2 = tail call i32 @FASTR_getConnectionChar(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x05() {
  Assert_real((isprint(5) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              30, ("isprint should be 0 for 0x05"));
}


x86 assembly (clang, -O0):
<t_isprint_0x05>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x05>:
push   %rax
mov    $0x5,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x05\00"
define void @t_isprint_0x05() {
%1 = call i64 @isprint(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x05\00"
define void @t_isprint_0x05() {
%1 = tail call i64 @isprint(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
__attribute__((always_)) int iii() {
  int ans;
  asm("iii_label: .globl iii_label");
  ans = jjj() + 1;
  asm("iii_label2: .globl iii_label2");
  return ans;
}


x86 assembly (clang, -O0):
<iii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp

x86 assembly (clang, -O2):
<iii>:
push   %rax

LLVM IR (-O0):
define i32 @iii() {
%1 = alloca i32
%2 = call i32 (...) @jjj()
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @iii() {
tail call void asm sideeffect "iii_label: .globl iii_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @jjj()
%2 = add nsw i32 %1, 1
tail call void asm sideeffect "iii_label2: .globl iii_label2", "~{dirflag},~{fpsr},~{flags}"()
ret i32 %2
}
/* Variables and functions */
int __irq_xxidle();
int __irq_ready() { return __irq_xxidle(); }


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

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

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

LLVM IR (-O2):
define i32 @__irq_ready() {
%1 = tail call i32 (...) @__irq_xxidle()
ret i32 %1
}
/* Variables and functions */
long long ff_rint(double);
long long ff_llrint(double x) { return ff_rint(x); }


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

x86 assembly (clang, -O2):
<ff_llrint>:
jmp    1030 <ff_rint@plt>

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

LLVM IR (-O2):
define i64 @ff_llrint(double %0) {
%2 = tail call i64 @ff_rint(double %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *appli) {
  printf("%s have to be started with the address and the port number of the "
         "server\n",
         appli);
  printf("example: %s \"127.0.0.1\" 10000   will start a client connected on "
         "the server 127.0.0.1:10000\n",
         appli);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"%s have to be started with the address and the port number of the server\0A\00"
@.str.1 = [93 x i8] c"example: %s \22127.0.0.1\22 10000 will start a client connected on the server 127.0.0.1:10000\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [74 x i8] c"%s have to be started with the address and the port number of the server\0A\00"
@.str.1 = [93 x i8] c"example: %s \22127.0.0.1\22 10000 will start a client connected on the server 127.0.0.1:10000\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
char *create_tmp(int *);
int /*<<< orphan*/ write(int, char const *, size_t);
char *payload_deploy(const char *payload, size_t payload_size) {
  char *payload_path = NULL;
  int payload_fd = -1;
  payload_path = create_tmp(&payload_fd);
  write(payload_fd, payload, payload_size);
  close(payload_fd);
  return payload_path;
}


x86 assembly (clang, -O0):
<payload_deploy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   1050 <create_tmp@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <write@plt>
mov    -0x1c(%rbp),%edi
call   1040 <close@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<payload_deploy>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xc(%rsp),%rdi
call   1050 <create_tmp@plt>
mov    %rax,%r15
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
mov    0xc(%rsp),%edi
call   1040 <close@plt>
mov    %r15,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @payload_deploy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i8* null, i8** %5
store i32 -1, i32* %6
%7 = call i8* @create_tmp(i32* %6)
store i8* %7, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @write(i32 %8, i8* %9, i64 %10)
%12 = load i32, i32* %6
%13 = call i32 @close(i32 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @payload_deploy(i8* nocapture %0, i64 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = call i8* @create_tmp(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @write(i32 %6, i8* %0, i64 %1)
%8 = load i32, i32* %3
%9 = call i32 @close(i32 %8)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
uint16_t ntohs(uint16_t n) { return htons(n); }


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

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

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

LLVM IR (-O2):
define i32 @ntohs(i32 %0) {
%2 = tail call i32 @htons(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *fmsg(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
void log_msg_arg1(int msg_nr, int arg1) {
  char buf[128];
  sprintf(buf, fmsg(msg_nr), arg1);
  fprintf(stderr, buf);
  exit(-1);
}


x86 assembly (clang, -O0):
<log_msg_arg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fmsg@plt>
mov    -0x98(%rbp),%rdi
mov    %rax,%rsi
mov    -0x8(%rbp),%edx
call   1050 <sprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<log_msg_arg1>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %esi,%ebx
call   1030 <fmsg@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @log_msg_arg1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [128 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i8* @fmsg(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @sprintf(i8* %6, i8* %8, i32 %9)
%11 = load i32, i32* @stderr
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%13 = call i32 @fprintf(i32 %11, i8* %12)
%14 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @log_msg_arg1(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = tail call i8* @fmsg(i32 %0)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %5, i32 %1)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* %4)
%9 = call i32 @exit(i32 -1)
unreachable
}
void ipc_check(void) {}


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

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

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

LLVM IR (-O2):
define void @ipc_check() {
ret void
}
/* Variables and functions */
int gprc_equation_dynamic_instruction_set(int *);
int gprcm_equation_dynamic_instruction_set(int *instruction_set) {
  return gprc_equation_dynamic_instruction_set(instruction_set);
}


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

x86 assembly (clang, -O2):
<gprcm_equation_dynamic_instruction_set>:
jmp    1030 <gprc_equation_dynamic_instruction_set@plt>

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

LLVM IR (-O2):
define i32 @gprcm_equation_dynamic_instruction_set(i32* %0) {
%2 = tail call i32 @gprc_equation_dynamic_instruction_set(i32* %0)
ret i32 %2
}
void rop3_46_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

LLVM IR (-O0):
define void @rop3_46_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_46_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void move_d(unsigned long *p, unsigned short *o) {
  *p = (((*p) >> 3) & 0777) | (((*p) << 9) & 07000) | ((*p) & 077770000);
  *o = (((*o) >> 2) & 0x3f) | (((*o) << 6) & 0xc0) | ((*o) & 0xff00);
}


x86 assembly (clang, -O0):
<move_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
shr    $0x3,%rcx
and    $0x1ff,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x9,%rax
and    $0xe00,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xfff000,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
movzwl (%rax),%eax
sar    $0x2,%eax
and    $0x3f,%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
shl    $0x6,%ecx
and    $0xc0,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_d>:
mov    (%rdi),%rax
mov    %eax,%ecx
shr    $0x3,%ecx
and    $0x1ff,%ecx
mov    %eax,%edx
and    $0x7,%edx
shl    $0x9,%rdx
and    $0xfff000,%eax
or     %rdx,%rax
or     %rcx,%rax
mov    %rax,(%rdi)
movzwl (%rsi),%eax
mov    %eax,%ecx
shr    $0x2,%ecx
and    $0x3f,%ecx
mov    %eax,%edx
shl    $0x6,%edx
movzbl %dl,%edx
and    $0xffffff00,%eax
or     %edx,%eax
or     %ecx,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @move_d(i64* %0, i16* %1) {
%3 = alloca i64*
%4 = alloca i16*
store i64* %0, i64** %3
store i16* %1, i16** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = lshr i64 %6, 3
%8 = and i64 %7, 511
%9 = load i64*, i64** %3
%10 = load i64, i64* %9
%11 = shl i64 %10, 9
%12 = and i64 %11, 3584
%13 = or i64 %8, %12
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = and i64 %15, 16773120
%17 = or i64 %13, %16
%18 = load i64*, i64** %3
store i64 %17, i64* %18
%19 = load i16*, i16** %4
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = ashr i32 %21, 2
%23 = and i32 %22, 63
%24 = load i16*, i16** %4
%25 = load i16, i16* %24
%26 = zext i16 %25 to i32
%27 = shl i32 %26, 6
%28 = and i32 %27, 192
%29 = or i32 %23, %28
%30 = load i16*, i16** %4
%31 = load i16, i16* %30
%32 = zext i16 %31 to i32
%33 = and i32 %32, 65280
%34 = or i32 %29, %33
%35 = trunc i32 %34 to i16
%36 = load i16*, i16** %4
store i16 %35, i16* %36
ret void
}

LLVM IR (-O2):
define void @move_d(i64* nocapture %0, i16* nocapture %1) {
%3 = load i64, i64* %0
%4 = lshr i64 %3, 3
%5 = and i64 %4, 511
%6 = shl i64 %3, 9
%7 = and i64 %6, 3584
%8 = and i64 %3, 16773120
%9 = or i64 %7, %8
%10 = or i64 %9, %5
store i64 %10, i64* %0
%11 = load i16, i16* %1
%12 = lshr i16 %11, 2
%13 = and i16 %12, 63
%14 = shl i16 %11, 6
%15 = and i16 %14, 192
%16 = and i16 %11, -256
%17 = or i16 %15, %16
%18 = or i16 %17, %13
store i16 %18, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern int my_pe(void) { printf("\nOpenSHMEM Analyzer\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i32 @my_pe() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i32 @my_pe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct iio_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct iio_context *iio_create_local_context(void) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<iio_create_local_context>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iio_create_local_context>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.iio_context* @iio_create_local_context() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret %struct.iio_context* null
}

LLVM IR (-O2):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.iio_context* @iio_create_local_context() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret %struct.iio_context* null
}
void LOS_EvbLedInit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @LOS_EvbLedInit() {
ret void
}
/* Variables and functions */
void *malloc(long);
void *hugo_blockalloc(long num) { return malloc(num * sizeof(char)); }


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

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

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

LLVM IR (-O2):
define noalias i8* @hugo_blockalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void routine_failed(char *func_name, int rc) {
  __LOG(3, __FUNCTION__, 45, "%s failed with rc = %d !\n", func_name, rc);
  ;
}


x86 assembly (clang, -O0):
<routine_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    $0x3,%edi
lea    0xecd(%rip),%rsi
mov    $0x2d,%edx
lea    0xed0(%rip),%rcx
mov    $0x0,%al
call   1030 <__LOG@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine_failed>:
mov    %esi,%r9d
mov    %rdi,%r8
lea    0xee3(%rip),%rsi
lea    0xeeb(%rip),%rcx
mov    $0x3,%edi
mov    $0x2d,%edx
xor    %eax,%eax
jmp    1030 <__LOG@plt>

LLVM IR (-O0):
@__FUNCTION__.routine_failed = [15 x i8] c"routine_failed\00"
@.str = [26 x i8] c"%s failed with rc = %d !\0A\00"
define void @routine_failed(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 (i32, i8*, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @__LOG to i32 (i32, i8*, i32, i8*, i8*, i32, ...)*)(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.routine_failed, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.routine_failed = [15 x i8] c"routine_failed\00"
@.str = [26 x i8] c"%s failed with rc = %d !\0A\00"
define void @routine_failed(i8* %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, i8*, i8*, i32, ...) bitcast (i32 (...)* @__LOG to i32 (i32, i8*, i32, i8*, i8*, i32, ...)*)(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.routine_failed, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_ethernet_header(unsigned char *, int);
void ProcessPacket(unsigned char *buffer, int size) {
  print_ethernet_header(buffer, size);
}


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

x86 assembly (clang, -O2):
<ProcessPacket>:
jmp    1030 <print_ethernet_header@plt>

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

LLVM IR (-O2):
define void @ProcessPacket(i8* %0, i32 %1) {
%3 = tail call i32 @print_ethernet_header(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
unsigned int read_multiple_input_lines(char **, int /*<<< orphan*/ *,
                                       unsigned int);
unsigned int get_multi_input_line(char **string, unsigned int option) {
  return read_multiple_input_lines(string, NULL, option);
}


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

x86 assembly (clang, -O2):
<get_multi_input_line>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <read_multiple_input_lines@plt>

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

LLVM IR (-O2):
define i32 @get_multi_input_line(i8** %0, i32 %1) {
%3 = tail call i32 @read_multiple_input_lines(i8** %0, i32* null, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ rcvbuf;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVBUF;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              char *, int);
void set_recv_window(int sockfd, int rcvbuf) {
  setsockopt(sockfd, SOL_SOCKET, SO_RCVBUF, (char *)&rcvbuf, sizeof(rcvbuf));
}


x86 assembly (clang, -O0):
<set_recv_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_recv_window>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define void @set_recv_window(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* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVBUF
%8 = bitcast i32* %4 to i8*
%9 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 4)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVBUF = global i32 0
define void @set_recv_window(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_RCVBUF
%6 = bitcast i32* %3 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %6, i32 4)
ret void
}
PI_App_init() { return (1); }


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

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

LLVM IR (-O0):
define i32 @PI_App_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @PI_App_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bar(int y) {
  printf("fool llvm\n");
  return y;
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [10 x i8] c"fool llvm\00"
define i32 @bar(i32 returned %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ output_in_clause_parameter(char *);
int /*<<< orphan*/ output_in_clause_stdin();
int main(int argc, char **argv) {
  if (argc == 2) {
    output_in_clause_parameter(argv[1]);
  } else {
    output_in_clause_stdin();
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jne    1152 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <output_in_clause_parameter@plt>
jmp    1159 <main+0x39>
mov    $0x0,%al
call   1030 <output_in_clause_stdin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1040 <output_in_clause_parameter@plt>
jmp    1138 <main+0x18>
xor    %eax,%eax
call   1030 <output_in_clause_stdin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @output_in_clause_parameter(i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (...) @output_in_clause_stdin()
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @output_in_clause_parameter(i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @output_in_clause_stdin()
br label %10
10: ; preds = %8, %4
ret i32 0
}
int lower_one_mask(int n) { return (2 << (n - 1)) - 1; }


x86 assembly (clang, -O0):
<lower_one_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x2,%eax
shl    %cl,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_one_mask>:
lea    -0x1(%rdi),%ecx
mov    $0x2,%eax
shl    %cl,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @lower_one_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = shl i32 2, %4
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @lower_one_mask(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = shl i32 2, %2
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
sdp_event_query_service_record_handle_get_total_count(const uint8_t *event) {
  return little_endian_read_16(event, 2);
}


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

x86 assembly (clang, -O2):
<sdp_event_query_service_record_handle_get_total_count>:
mov    $0x2,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @sdp_event_query_service_record_handle_get_total_count(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int Fib(int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char const *argv[]) {
  assert(Fib(8) == 21);
  assert(Fib(12) == 144);
  puts("All assertions correct - success!");
  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)
mov    $0x8,%edi
call   1050 <Fib@plt>
cmp    $0x15,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xc,%edi
call   1050 <Fib@plt>
cmp    $0x90,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1050 <Fib@plt>
xor    %edi,%edi
cmp    $0x15,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0xc,%edi
call   1050 <Fib@plt>
xor    %edi,%edi
cmp    $0x90,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"All assertions correct - success!\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 @Fib(i32 8)
%7 = icmp eq i32 %6, 21
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @Fib(i32 12)
%11 = icmp eq i32 %10, 144
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"All assertions correct - success!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Fib(i32 8)
%4 = icmp eq i32 %3, 21
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @Fib(i32 12)
%8 = icmp eq i32 %7, 144
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}