xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void non_monotonic_error() {
  fprintf(stderr, "%s: error: adirissa values not monotonic\n", "do_spline");
  exit(-1);
}


x86 assembly (clang, -O0):
<non_monotonic_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xeef(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<non_monotonic_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef2(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"%s: error: adirissa values not monotonic\0A\00"
@.str.1 = [10 x i8] c"do_spline\00"
define void @non_monotonic_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"%s: error: adirissa values not monotonic\0A\00"
@.str.1 = [10 x i8] c"do_spline\00"
define void @non_monotonic_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char);
void print_string(char *str) {
  int i = 0;
  while (str[i]) {
    print_char(str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1154 <print_string+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <print_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @print_char(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int C_Utils_compare_byte(const unsigned char item1, const unsigned char item2) {
  if (item1 == item2)
    return 0;
  return item1 < item2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    112c <C_Utils_compare_byte+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1146 <C_Utils_compare_byte+0x46>
movzbl -0x5(%rbp),%edx
movzbl -0x6(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_byte>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %sil,%dil
setae  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @C_Utils_compare_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %20
12: ; preds = %2
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = icmp slt i32 %14, %16
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 -1, i32 1
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @C_Utils_compare_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp eq i8 %0, %1
%4 = icmp ult i8 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
unsigned int get_bank_num(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @get_bank_num() {
ret i32 1
}
char *my_strlcat(char *str) { return (str); }


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

x86 assembly (clang, -O2):
<my_strlcat>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @my_strlcat(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void usage(char **argv) {
  puts("A program that runs threads, with optional CPU affinity");
  printf("usage: %s regular|affine|antiaffine [nthreads]\n", argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xee2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xeee(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"A program that runs threads, with optional CPU affinity\00"
@.str.1 = [48 x i8] c"usage: %s regular|affine|antiaffine [nthreads]\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [56 x i8] c"A program that runs threads, with optional CPU affinity\00"
@.str.1 = [48 x i8] c"usage: %s regular|affine|antiaffine [nthreads]\0A\00"
define void @usage(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void foo_2_2_1_1_1_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_1_1_1_2_2_2() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int *Int_array(int size) {
  return ((int *)malloc((unsigned)(size * sizeof(int))));
}


x86 assembly (clang, -O0):
<Int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_array>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @Int_array(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}

LLVM IR (-O2):
define i32* @Int_array(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
int test_imm_26uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x26 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_26uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x26,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_26uint64_midword_mem>:
testb  $0x26,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_26uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 38
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_26uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2490368
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void login() { printf("You are logged in. Access granted!\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"You are logged in. Access granted!\0A\00"
define void @login() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"You are logged in. Access granted!\00"
define void @login() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flash_init();
int /*<<< orphan*/ power_init();
void board_init() {
  power_init();
  flash_init();
}


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

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

LLVM IR (-O0):
define void @board_init() {
%1 = call i32 (...) @power_init()
%2 = call i32 (...) @flash_init()
ret void
}

LLVM IR (-O2):
define void @board_init() {
%1 = tail call i32 (...) @power_init()
%2 = tail call i32 (...) @flash_init()
ret void
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
struct timespec sancus_time_fp_to_ts(double d) {
  struct timespec t = {
      .tv_sec = (long)d,
  };
  d -= (double)t.tv_sec;
  d *= 1000000000.;
  d += .5;
  t.tv_nsec = (long)d;
  return t;
}


x86 assembly (clang, -O0):
<sancus_time_fp_to_ts>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_time_fp_to_ts>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xeea(%rip),%xmm0
addsd  0xeea(%rip),%xmm0
cvttsd2si %xmm0,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @sancus_time_fp_to_ts(double %0) {
%2 = alloca %struct.timespec
%3 = alloca double
store double %0, double* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%5 = load double, double* %3
%6 = fptosi double %5 to i64
store i64 %6, i64* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = load double, double* %3
%12 = fsub double %11, %10
store double %12, double* %3
%13 = load double, double* %3
%14 = fmul double %13, 1.000000e+09
store double %14, double* %3
%15 = load double, double* %3
%16 = fadd double %15, 5.000000e-01
store double %16, double* %3
%17 = load double, double* %3
%18 = fptosi double %17 to i64
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %18, i64* %19
%20 = bitcast %struct.timespec* %2 to { i64, i64 }*
%21 = load { i64, i64 }, { i64, i64 }* %20
ret { i64, i64 } %21
}

LLVM IR (-O2):
define { i64, i64 } @sancus_time_fp_to_ts(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 1.000000e+09
%6 = fadd double %5, 5.000000e-01
%7 = fptosi double %6 to i64
%8 = insertvalue { i64, i64 } poison, i64 %2, 0
%9 = insertvalue { i64, i64 } %8, i64 %7, 1
ret { i64, i64 } %9
}
/* Variables and functions */
int readReg(int);
void flushFifo() {
  while (readReg(0x28) & (0x40 | 0x10))
    readReg(0x00);
}


x86 assembly (clang, -O0):
<flushFifo>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flushFifo+0x9>
mov    $0x28,%edi
call   1030 <readReg@plt>
and    $0x50,%eax
cmp    $0x0,%eax
je     113b <flushFifo+0x2b>
xor    %edi,%edi
call   1030 <readReg@plt>
jmp    1119 <flushFifo+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushFifo>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x28,%edi
call   1030 <readReg@plt>
test   $0x50,%al
je     1137 <flushFifo+0x27>
xor    %edi,%edi
call   1030 <readReg@plt>
jmp    1120 <flushFifo+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flushFifo() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @readReg(i32 40)
%3 = and i32 %2, 80
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @readReg(i32 0)
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flushFifo() {
%1 = tail call i32 @readReg(i32 40)
%2 = and i32 %1, 80
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @readReg(i32 0)
%6 = tail call i32 @readReg(i32 40)
%7 = and i32 %6, 80
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %0
ret void
}
void upper(string) char *string;
{
  char *p;
  for (p = string; *p; p++)
    if (islower(*p))
      *p = toupper(*p);
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <upper+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     116a <upper+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    116f <upper+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <upper+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1165 <upper+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <upper+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <upper+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1140 <upper+0x20>
mov    %ebp,%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <upper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @islower(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @toupper(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %4, %10
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret void
}
/* Variables and functions */
void clear_row(size_t M, size_t N, int matrix[M][N], size_t row) {
  size_t i;
  for (i = 0; i < N; i++) {
    matrix[row][i] = 0;
  }
}


x86 assembly (clang, -O0):
<clear_row>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1162 <clear_row+0x62>
mov    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%rax
imul   -0x20(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1124 <clear_row+0x24>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_row>:
test   %rsi,%rsi
je     1133 <clear_row+0x23>
push   %rax
mov    %rsi,%rax
imul   %rsi,%rcx
lea    (%rdx,%rcx,4),%rdi
shl    $0x2,%rax
xor    %esi,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @clear_row(i64 %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
store i64 0, i64* %9
br label %12
12: ; preds = %23, %4
%13 = load i64, i64* %9
%14 = load i64, i64* %6
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i32*, i32** %7
%18 = load i64, i64* %8
%19 = mul nsw i64 %18, %11
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i64, i64* %9
%22 = getelementptr inbounds i32, i32* %20, i64 %21
store i32 0, i32* %22
br label %23
23: ; preds = %16
%24 = load i64, i64* %9
%25 = add i64 %24, 1
store i64 %25, i64* %9
br label %12
26: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @clear_row(i64 %0, i64 %1, i32* nocapture writeonly %2, i64 %3) {
%5 = icmp eq i64 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = mul nsw i64 %3, %1
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = bitcast i32* %8 to i8*
%10 = shl nuw i64 %1, 2
br label %11
11: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gtp_printf(char *);
void gtp_panic() { gtp_printf("! panic\n\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"! panic\0A\0A\00"
define void @gtp_panic() {
%1 = call i32 @gtp_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"! panic\0A\0A\00"
define void @gtp_panic() {
%1 = tail call i32 @gtp_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_bi_qpel_v64_8_avx2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long GetFileSize(FILE *f) {
  long pos, size;
  pos = ftell(f);
  fseek(f, 0, SEEK_END);
  size = ftell(f);
  fseek(f, pos, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<GetFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileSize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @GetFileSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @GetFileSize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
/* Variables and functions */
int cow_str_count(char const *, char);
int cow_str_count_safe(const char *str, char c) {
  if (!str)
    return 0;
  return cow_str_count(str, c);
}


x86 assembly (clang, -O0):
<cow_str_count_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <cow_str_count_safe+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1149 <cow_str_count_safe+0x39>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <cow_str_count@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow_str_count_safe>:
test   %rdi,%rdi
je     111e <cow_str_count_safe+0xe>
movsbl %sil,%esi
jmp    1030 <cow_str_count@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cow_str_count_safe(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @cow_str_count(i8* %0, i8 signext %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ dailyWeather(double, double, int, int, char *, char *, int);
void dailyWeather_R(double *latitude, double *longitude, int *yearLow,
                    int *yearHigh, char **site, char **directory,
                    int *siteNum) {
  dailyWeather(*latitude, *longitude, *yearLow, *yearHigh, *site, *directory,
               *siteNum);
}


x86 assembly (clang, -O0):
<dailyWeather_R>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
mov    -0x30(%rbp),%rax
mov    (%rax),%rcx
mov    0x10(%rbp),%rax
mov    (%rax),%r8d
call   1030 <dailyWeather@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dailyWeather_R>:
mov    0x8(%rsp),%rax
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    (%rdx),%edi
mov    (%rcx),%esi
mov    (%r8),%rdx
mov    (%r9),%rcx
mov    (%rax),%r8d
jmp    1030 <dailyWeather@plt>

LLVM IR (-O0):
define void @dailyWeather_R(double* %0, double* %1, i32* %2, i32* %3, i8** %4, i8** %5, i32* %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i8**
%13 = alloca i8**
%14 = alloca i32*
store double* %0, double** %8
store double* %1, double** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i8** %4, i8*** %12
store i8** %5, i8*** %13
store i32* %6, i32** %14
%15 = load double*, double** %8
%16 = load double, double* %15
%17 = load double*, double** %9
%18 = load double, double* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load i32*, i32** %11
%22 = load i32, i32* %21
%23 = load i8**, i8*** %12
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %13
%26 = load i8*, i8** %25
%27 = load i32*, i32** %14
%28 = load i32, i32* %27
%29 = call i32 @dailyWeather(double %16, double %18, i32 %20, i32 %22, i8* %24, i8* %26, i32 %28)
ret void
}

LLVM IR (-O2):
define void @dailyWeather_R(double* nocapture %0, double* nocapture %1, i32* nocapture %2, i32* nocapture %3, i8** nocapture %4, i8** nocapture %5, i32* nocapture %6) {
%8 = load double, double* %0
%9 = load double, double* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = tail call i32 @dailyWeather(double %8, double %9, i32 %10, i32 %11, i8* %12, i8* %13, i32 %14)
ret void
}
int main(void) {
  int var = 0;
  while ((var < 10)) {
    ++var;
  }
  while ((var < 20))
    ++var;
  return var;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    112f <main+0x2f>
cmpl   $0x14,-0x8(%rbp)
jge    1147 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0x2f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 20
}
/* Variables and functions */
int EINVAL;
int sd_is_socket_internal(int, int, int);
__attribute__((visibility("hidden"))) int
sd_is_socket(int fd, int family, int type, int listening) {
  int r;
  if (family < 0)
    return -EINVAL;
  if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
    return r;
  return 1;
}


x86 assembly (clang, -O0):
<sd_is_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1141 <sd_is_socket+0x31>
xor    %eax,%eax
mov    0x2ea9(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <sd_is_socket+0x5d>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <sd_is_socket_internal@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jg     1166 <sd_is_socket+0x56>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <sd_is_socket+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_is_socket>:
push   %rax
test   %esi,%esi
js     112c <sd_is_socket+0x1c>
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <sd_is_socket_internal@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0x1,%eax
cmovle %ecx,%eax
pop    %rcx
ret
mov    0x2ead(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define hidden i32 @sd_is_socket(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = load i32, i32* @EINVAL
%15 = sub nsw i32 0, %14
store i32 %15, i32* %5
br label %25
16: ; preds = %4
%17 = load i32, i32* %6
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = call i32 @sd_is_socket_internal(i32 %17, i32 %18, i32 %19)
store i32 %20, i32* %10
%21 = icmp sle i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %16
%23 = load i32, i32* %10
store i32 %23, i32* %5
br label %25
24: ; preds = %16
store i32 1, i32* %5
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
@EINVAL = global i32 0
define hidden i32 @sd_is_socket(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %1, 0
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
br label %13
9: ; preds = %4
%10 = tail call i32 @sd_is_socket_internal(i32 %0, i32 %2, i32 %3)
%11 = icmp slt i32 %10, 1
%12 = select i1 %11, i32 %10, i32 1
br label %13
13: ; preds = %9, %6
%14 = phi i32 [ %8, %6 ], [ %12, %9 ]
ret i32 %14
}
void test_isr(void) {
  printf_vga_tk("Test isr:\n");
  asm volatile("int $0x0\n\t"
               "int $0x3\n\t"
               "int $0x0\n\t");
  printf_vga_tk("Test isr ................ OK.\n");
}


x86 assembly (clang, -O0):
<test_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf_vga_tk@plt>
int    $0x0
int3
int    $0x0
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf_vga_tk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isr>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf_vga_tk@plt>
int    $0x0
int3
int    $0x0
lea    0xee0(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf_vga_tk@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Test isr:\0A\00"
@.str.1 = [31 x i8] c"Test isr ................ OK.\0A\00"
define void @test_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @printf_vga_tk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @printf_vga_tk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Test isr:\0A\00"
@.str.1 = [31 x i8] c"Test isr ................ OK.\0A\00"
define void @test_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printf_vga_tk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
tail call void asm sideeffect "int $$0x0\0A\09int $$0x3\0A\09int $$0x0\0A\09", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printf_vga_tk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void component_rock_get_param(void *handle, unsigned int index, char *buffer,
                              int buffer_size) {}


x86 assembly (clang, -O0):
<component_rock_get_param>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @component_rock_get_param(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @component_rock_get_param(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ puts(char *);
int setjmp(int /*<<< orphan*/);
int main(void) {
  jmp_buf jb;
  int val;
  val = setjmp(jb);
  puts("Hello!");
  if (val == 0)
    longjmp(jb, 1);
  else
    puts("End");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <setjmp@plt>
mov    %eax,-0xc(%rbp)
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0xc(%rbp)
jne    116d <main+0x3d>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1050 <longjmp@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <setjmp@plt>
mov    %eax,%ebx
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
je     1158 <main+0x28>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%esi
call   1050 <longjmp@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Hello!\00"
@.str.1 = [4 x i8] c"End\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @setjmp(i32 %4)
store i32 %5, i32* %3
%6 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @longjmp(i32 %10, i32 1)
unreachable
12: ; preds = %0
%13 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello!\00"
@.str.1 = [4 x i8] c"End\00"
define i32 @main() {
%1 = call i32 @setjmp(i32 undef)
%2 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @longjmp(i32 undef, i32 1)
unreachable
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ readNumBytesIntoBuffer(int, void *);
void readFourCC(void *buffer) { readNumBytesIntoBuffer(4, buffer); }


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

x86 assembly (clang, -O2):
<readFourCC>:
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <readNumBytesIntoBuffer@plt>

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

LLVM IR (-O2):
define void @readFourCC(i8* %0) {
%2 = tail call i32 @readNumBytesIntoBuffer(i32 4, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ listen_on_dom_socket(char *);
int main(int argc, char *argv[]) {
  listen_on_dom_socket("/var/run/clacks/"
                       "clacksid.sock");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"/var/run/clacks/clacksid.sock\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 = call i32 @listen_on_dom_socket(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"/var/run/clacks/clacksid.sock\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @listen_on_dom_socket(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fn_c() {
  printf("fn_c() called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"fn_c() called\0A\00"
define i32 @fn_c() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"fn_c() called\00"
define i32 @fn_c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void sti() { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int EVP_CipherInit(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                   unsigned char const *, unsigned char const *, int);
int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
                    const unsigned char *key, const unsigned char *iv) {
  return EVP_CipherInit(ctx, cipher, key, iv, 1);
}


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

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

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

LLVM IR (-O2):
define i32 @EVP_EncryptInit(i32* %0, i32* %1, i8* %2, i8* %3) {
%5 = tail call i32 @EVP_CipherInit(i32* %0, i32* %1, i8* %2, i8* %3, i32 1)
ret i32 %5
}
void eglQueryAPI(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglQueryAPI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHM_RND;
scalar_t__ shmat(int, int /*<<< orphan*/, int /*<<< orphan*/);
char *initShmBuffer(int shmID) {
  char *buffer;
  if (shmID != -1) {
    buffer = (char *)shmat(shmID, 0, SHM_RND);
    return buffer;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<initShmBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     1149 <initShmBuffer+0x39>
mov    -0xc(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <shmat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <initShmBuffer+0x41>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initShmBuffer>:
cmp    $0xffffffff,%edi
je     112b <initShmBuffer+0x1b>
push   %rax
mov    0x2ecb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <shmat@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@SHM_RND = global i32 0
define i8* @initShmBuffer(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @SHM_RND
%5 = tail call i64 @shmat(i32 %0, i32 0, i32 %4)
%6 = inttoptr i64 %5 to i8*
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
void pcm8_start(void) {}


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

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

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

LLVM IR (-O2):
define void @pcm8_start() {
ret void
}
void ff_hevc_put_hevc_bi_epel_hv64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv64_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, long);
void fvec_0(float *v, long n) { memset(v, 0, n * sizeof(*v)); }


x86 assembly (clang, -O0):
<fvec_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_0>:
lea    0x0(,%rsi,4),%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @fvec_0(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
%5 = load float*, float** %3
%6 = load i64, i64* %4
%7 = mul i64 %6, 4
%8 = call i32 @memset(float* %5, i32 0, i64 %7)
ret void
}

LLVM IR (-O2):
define void @fvec_0(float* %0, i64 %1) {
%3 = shl i64 %1, 2
%4 = tail call i32 @memset(float* %0, i32 0, i64 %3)
ret void
}
int dummy_get_otp(struct bladerf *dev, char *otp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.bladerf = type opaque
define i32 @dummy_get_otp(%struct.bladerf* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void const *, void *, int);
void test_qual_conversion_memcpy(void *d, const void *s) {
  memcpy(d, s, sizeof(int));
  memcpy(s, d, sizeof(int));
}


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

x86 assembly (clang, -O2):
<test_qual_conversion_memcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @test_qual_conversion_memcpy(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 @memcpy(i8* %5, i8* %6, i32 4)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @memcpy(i8* %8, i8* %9, i32 4)
ret void
}

LLVM IR (-O2):
define void @test_qual_conversion_memcpy(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 4)
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i32 4)
ret void
}
unsigned char bitSet(unsigned char base, short int i) {
  unsigned char mask = 1 << i;
  return base | mask;
}


x86 assembly (clang, -O0):
<bitSet>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x5(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x5(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @bitSet(i8 zeroext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
%5 = alloca i8
store i8 %0, i8* %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = shl i32 1, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @bitSet(i8 zeroext %0, i16 signext %1) {
%3 = zext i16 %1 to i32
%4 = shl nuw i32 1, %3
%5 = trunc i32 %4 to i8
%6 = or i8 %5, %0
ret i8 %6
}