xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void CTSettingReload() {
  FILE *settingFile = NULL;
  settingFile = fopen("server.cfg", "r");
  fclose(settingFile);
  settingFile = NULL;
}


x86 assembly (clang, -O0):
<CTSettingReload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CTSettingReload>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"server.cfg\00"
@.str.1 = [2 x i8] c"r\00"
define void @CTSettingReload() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
store i32* null, i32** %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"server.cfg\00"
@.str.1 = [2 x i8] c"r\00"
define void @CTSettingReload() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int spawn(int, char **);
int main(int argc, char *argv[]) {
  argv[0] = "ylc";
  return (spawn(argc, argv));
}


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    -0x10(%rbp),%rax
lea    0xecf(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <spawn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rax
mov    %rax,(%rsi)
jmp    1030 <spawn@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ylc\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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @spawn(i32 %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"ylc\00"
define i32 @main(i32 %0, i8** %1) {
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @spawn(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int ext2fs_set_bit(unsigned int nr, void *addr) {
  int mask, retval;
  unsigned char *ADDR = (unsigned char *)addr;
  ADDR += nr >> 3;
  mask = 1 << (nr & 0x07);
  retval = mask & *ADDR;
  *ADDR |= mask;
  return retval;
}


x86 assembly (clang, -O0):
<ext2fs_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2fs_set_bit>:
mov    %edi,%ecx
mov    %edi,%edx
shr    $0x3,%rdx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
movzbl (%rsi,%rdx,1),%edi
and    %edi,%eax
bts    %ecx,%edi
mov    %dil,(%rsi,%rdx,1)
ret

LLVM IR (-O0):
define i32 @ext2fs_set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i32, i32* %3
%10 = lshr i32 %9, 3
%11 = load i8*, i8** %7
%12 = zext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8* %13, i8** %7
%14 = load i32, i32* %3
%15 = and i32 %14, 7
%16 = shl i32 1, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %17, %20
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = load i8*, i8** %7
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @ext2fs_set_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = trunc i32 %7 to i8
%12 = or i8 %8, %11
store i8 %12, i8* %5
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XResizeRequestEvent;

/* Variables and functions */
unsigned long get_XResizeRequestEvent_window(void *_p) {
  return (unsigned long)((XResizeRequestEvent *)_p)->window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XResizeRequestEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XResizeRequestEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ fifoReset();
int /*<<< orphan*/ fifoResetErr();
void fifoOpen() {
  fifoReset();
  fifoResetErr();
}


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

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

LLVM IR (-O0):
define void @fifoOpen() {
%1 = call i32 (...) @fifoReset()
%2 = call i32 (...) @fifoResetErr()
ret void
}

LLVM IR (-O2):
define void @fifoOpen() {
%1 = tail call i32 (...) @fifoReset()
%2 = tail call i32 (...) @fifoResetErr()
ret void
}
void I422ToUYVYRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @I422ToUYVYRow_AVX2() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ biaised_random(float);
uint64_t stoec_of_float(float f) {
  int i;
  uint64_t value;
  for (value = 0, i = 0; i < 64; i++) {
    value += ((uint64_t)biaised_random(f)) << i;
  }
  return value;
}


x86 assembly (clang, -O0):
<stoec_of_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jge    1158 <stoec_of_float+0x48>
movss  -0x4(%rbp),%xmm0
call   1030 <biaised_random@plt>
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <stoec_of_float+0x1b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoec_of_float>:
push   %rbp
push   %rbx
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   (%rax)
movss  0x4(%rsp),%xmm0
call   1030 <biaised_random@plt>
mov    %ebp,%ecx
shl    %cl,%eax
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x40,%ebp
jne    1120 <stoec_of_float+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @stoec_of_float(float %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = phi i32 [ 0, %1 ], [ %9, %2 ]
%5 = tail call i64 @biaised_random(float %0)
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, %4
%8 = add nsw i32 %7, %3
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 64
br i1 %10, label %11, label %2
11: ; preds = %2
ret i32 %8
}
/* Type definitions */
struct mem_free_node {
  int dummy;
};
struct mem_block {
  int dummy;
};

/* Variables and functions */
struct mem_free_node *mem_block_payload(struct mem_block *);
struct mem_free_node *mem_block_get_free_node(struct mem_block *block) {
  ;
  return mem_block_payload(block);
}


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

x86 assembly (clang, -O2):
<mem_block_get_free_node>:
jmp    1030 <mem_block_payload@plt>

LLVM IR (-O0):
%struct.mem_free_node = type { i32 }
%struct.mem_block = type { i32 }
define %struct.mem_free_node* @mem_block_get_free_node(%struct.mem_block* %0) {
%2 = alloca %struct.mem_block*
store %struct.mem_block* %0, %struct.mem_block** %2
%3 = load %struct.mem_block*, %struct.mem_block** %2
%4 = call %struct.mem_free_node* @mem_block_payload(%struct.mem_block* %3)
ret %struct.mem_free_node* %4
}

LLVM IR (-O2):
%struct.mem_free_node = type { i32 }
%struct.mem_block = type { i32 }
define %struct.mem_free_node* @mem_block_get_free_node(%struct.mem_block* %0) {
%2 = tail call %struct.mem_free_node* @mem_block_payload(%struct.mem_block* %0)
ret %struct.mem_free_node* %2
}
/* Variables and functions */
int /*<<< orphan*/ fsemu_savestate_save(int);
void fsemu_control_save_state(int slot) { fsemu_savestate_save(slot); }


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

x86 assembly (clang, -O2):
<fsemu_control_save_state>:
jmp    1030 <fsemu_savestate_save@plt>

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

LLVM IR (-O2):
define void @fsemu_control_save_state(i32 %0) {
%2 = tail call i32 @fsemu_savestate_save(i32 %0)
ret void
}
void g_unichar_isspace() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_isspace() {
ret void
}
/* Variables and functions */
int add1(int, int);
int add_2(int, int);
int add2(int m, int n) {
  int c1 = m + n;
  int c2 = add1(m, n);
  c2 = add_2(m, n);
  return c1;
}


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

x86 assembly (clang, -O2):
<add2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    (%r14,%rbx,1),%ebp
call   1030 <add1@plt>
mov    %ebx,%edi
mov    %r14d,%esi
call   1040 <add_2@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @add2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @add1(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @add_2(i32 %13, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @add2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @add1(i32 %0, i32 %1)
%5 = tail call i32 @add_2(i32 %0, i32 %1)
ret i32 %3
}
double SN_get_residual(double *dparam) { return dparam[1]; }


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

x86 assembly (clang, -O2):
<SN_get_residual>:
movsd  0x8(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @SN_get_residual(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @SN_get_residual(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *Mem_Realloc(void *ptr, size_t n, const char *file, int line) {
  void *tmpptr = 0;
  if (!(tmpptr = realloc(ptr, n))) {
    fprintf(stderr, "Out of memory at %s:%d\n", file, line);
    exit(1);
  }
  return tmpptr;
}


x86 assembly (clang, -O0):
<Mem_Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1190 <Mem_Realloc+0x60>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xe7f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_Realloc>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1149 <Mem_Realloc+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Out of memory at %s:%d\0A\00"
define i8* @Mem_Realloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
store i8* null, i8** %9
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %9
%13 = icmp ne i8* %12, null
br i1 %13, label %20, label %14
14: ; preds = %4
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %4
%21 = load i8*, i8** %9
ret i8* %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Out of memory at %s:%d\0A\00"
define noalias i8* @Mem_Realloc(i8* nocapture %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @realloc(i8* %0, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %4
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int UINT64_C(int);
int32_t mask_signed(uint32_t value, int bits) {
  uint32_t mask = (UINT64_C(1) << bits) - 1;
  uint32_t sign_bit = UINT64_C(1) << (bits - 1);
  return ((value & mask) ^ sign_bit) - sign_bit;
}


x86 assembly (clang, -O0):
<mask_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_signed>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    %eax,%ebp
mov    %ebx,%ecx
shl    %cl,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
add    $0xff,%bl
mov    %ebx,%ecx
shl    %cl,%eax
and    %r14d,%ebp
xor    %eax,%ebp
sub    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mask_signed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @UINT64_C(i32 1)
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %5
%11 = call i32 @UINT64_C(i32 1)
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = shl i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = and i32 %15, %16
%18 = load i32, i32* %6
%19 = xor i32 %17, %18
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @mask_signed(i32 %0, i32 %1) {
%3 = tail call i32 @UINT64_C(i32 1)
%4 = shl i32 %3, %1
%5 = add nsw i32 %4, -1
%6 = tail call i32 @UINT64_C(i32 1)
%7 = add nsw i32 %1, -1
%8 = shl i32 %6, %7
%9 = and i32 %5, %0
%10 = xor i32 %9, %8
%11 = sub nsw i32 %10, %8
ret i32 %11
}
/* Type definitions */
typedef int u_long;

/* Variables and functions */
u_long NextPow2(u_long x) {
  if (((x << 1) >> 1) != x)
    x >>= 1;
  while ((x & (x - 1)) != 0)
    x &= (x - 1);
  return x << 1;
}


x86 assembly (clang, -O0):
<NextPow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sar    $0x1,%eax
cmp    -0x4(%rbp),%eax
je     1122 <NextPow2+0x22>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <NextPow2+0x27>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     114c <NextPow2+0x4c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <NextPow2+0x27>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextPow2>:
lea    0x40000000(%rdi),%ecx
shr    $0x1f,%ecx
sar    %cl,%edi
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
lea    -0x1(%rax),%edi
and    %eax,%edi
jne    1110 <NextPow2+0x10>
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @NextPow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = ashr i32 %4, 1
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = ashr i32 %9, 1
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 1
%16 = and i32 %13, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = load i32, i32* %2
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %2
%22 = and i32 %21, %20
store i32 %22, i32* %2
br label %12
23: ; preds = %12
%24 = load i32, i32* %2
%25 = shl i32 %24, 1
ret i32 %25
}

LLVM IR (-O2):
define i32 @NextPow2(i32 %0) {
%2 = add i32 %0, 1073741824
%3 = lshr i32 %2, 31
%4 = ashr i32 %0, %3
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ %4, %1 ], [ %8, %5 ]
%7 = add nsw i32 %6, -1
%8 = and i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = shl i32 %6, 1
ret i32 %11
}
double fd(x)
double x;
{ return 3 * x * x - 3; }


x86 assembly (clang, -O0):
<fd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.000000e+00, %3
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double -3.000000e+00)
ret double %6
}

LLVM IR (-O2):
define double @fd(double %0) {
%2 = fmul double %0, 3.000000e+00
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double -3.000000e+00)
ret double %3
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *newstring(size_t stringlen) {
  char *value;
  if (!(value = (char *)malloc(stringlen + 1)))
    return ((char *)NULL);
  value[0] = '\0';
  return (value);
}


x86 assembly (clang, -O0):
<newstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1144 <newstring+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1153 <newstring+0x43>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstring>:
push   %rax
add    $0x1,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     1124 <newstring+0x14>
movb   $0x0,(%rax)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @newstring(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 0, i8* %4
br label %7
7: ; preds = %1, %6
%8 = phi i8* [ %4, %6 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
char *PICA_id_to_base64(unsigned char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void denied_file_cb(const unsigned char *peer_id) {
  printf("denied_file_cb: peer_id %s \n", PICA_id_to_base64(peer_id, NULL));
}


x86 assembly (clang, -O0):
<denied_file_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <PICA_id_to_base64@plt>
mov    %rax,%rsi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<denied_file_cb>:
push   %rax
xor    %esi,%esi
call   1030 <PICA_id_to_base64@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"denied_file_cb: peer_id %s \0A\00"
define void @denied_file_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @PICA_id_to_base64(i8* %3, i32* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"denied_file_cb: peer_id %s \0A\00"
define void @denied_file_cb(i8* %0) {
%2 = tail call i8* @PICA_id_to_base64(i8* %0, i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int mesh_getVertexFromPool(struct vertex **pool, int n, struct vertex *v) {
  for (; n >= 0; --n) {
    if (pool[n] == v)
      return n;
  }
  return -1;
}


x86 assembly (clang, -O0):
<mesh_getVertexFromPool>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     114d <mesh_getVertexFromPool+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jne    113a <mesh_getVertexFromPool+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <mesh_getVertexFromPool+0x54>
jmp    113f <mesh_getVertexFromPool+0x3f>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <mesh_getVertexFromPool+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mesh_getVertexFromPool>:
mov    $0xffffffff,%eax
test   %esi,%esi
js     1121 <mesh_getVertexFromPool+0x21>
nopl   0x0(%rax)
mov    %esi,%ecx
cmp    %rdx,(%rdi,%rcx,8)
je     1122 <mesh_getVertexFromPool+0x22>
lea    -0x1(%rsi),%ecx
test   %esi,%esi
mov    %ecx,%esi
jg     1110 <mesh_getVertexFromPool+0x10>
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
%struct.vertex = type opaque
define i32 @mesh_getVertexFromPool(%struct.vertex** %0, i32 %1, %struct.vertex* %2) {
%4 = alloca i32
%5 = alloca %struct.vertex**
%6 = alloca i32
%7 = alloca %struct.vertex*
store %struct.vertex** %0, %struct.vertex*** %5
store i32 %1, i32* %6
store %struct.vertex* %2, %struct.vertex** %7
br label %8
8: ; preds = %22, %3
%9 = load i32, i32* %6
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load %struct.vertex**, %struct.vertex*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds %struct.vertex*, %struct.vertex** %12, i64 %14
%16 = load %struct.vertex*, %struct.vertex** %15
%17 = load %struct.vertex*, %struct.vertex** %7
%18 = icmp eq %struct.vertex* %16, %17
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = load i32, i32* %6
store i32 %20, i32* %4
br label %26
21: ; preds = %11
br label %22
22: ; preds = %21
%23 = load i32, i32* %6
%24 = add nsw i32 %23, -1
store i32 %24, i32* %6
br label %8
25: ; preds = %8
store i32 -1, i32* %4
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
%struct.vertex = type opaque
define i32 @mesh_getVertexFromPool(%struct.vertex** nocapture %0, i32 %1, %struct.vertex* readnone %2) {
%4 = icmp sgt i32 %1, -1
br i1 %4, label %5, label %14
5: ; preds = %3, %11
%6 = phi i32 [ %12, %11 ], [ %1, %3 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds %struct.vertex*, %struct.vertex** %0, i64 %7
%9 = load %struct.vertex*, %struct.vertex** %8
%10 = icmp eq %struct.vertex* %9, %2
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = add nsw i32 %6, -1
%13 = icmp sgt i32 %6, 0
br i1 %13, label %5, label %14
14: ; preds = %5, %11, %3
%15 = phi i32 [ -1, %3 ], [ -1, %11 ], [ %6, %5 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ xorr_scalar(scalar_t__ *, scalar_t__ const *, size_t);
void maddrc2_scalar(uint8_t *region1, const uint8_t *region2, uint8_t constant,
                    size_t length) {
  if (constant != 0)
    xorr_scalar(region1, region2, length);
}


x86 assembly (clang, -O0):
<maddrc2_scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1144 <maddrc2_scalar+0x34>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <xorr_scalar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maddrc2_scalar>:
test   %rdx,%rdx
je     111d <maddrc2_scalar+0xd>
mov    %rcx,%rdx
jmp    1030 <xorr_scalar@plt>
ret

LLVM IR (-O0):
define void @maddrc2_scalar(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
store i64* %0, i64** %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i64*, i64** %5
%13 = load i64*, i64** %6
%14 = load i64, i64* %8
%15 = call i32 @xorr_scalar(i64* %12, i64* %13, i64 %14)
br label %16
16: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
define void @maddrc2_scalar(i64* %0, i64* %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @xorr_scalar(i64* %0, i64* %1, i64 %3)
br label %8
8: ; preds = %6, %4
ret void
}
void logger_debugger(const char *line) {}


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

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

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

LLVM IR (-O2):
define void @logger_debugger(i8* nocapture %0) {
ret void
}
void I2SRxDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) &= ~0x00000002;
}


x86 assembly (clang, -O0):
<I2SRxDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    %rcx,0xc00(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxDisable>:
andq   $0xfffffffffffffffd,0xc00(%rdi)
fd
ret

LLVM IR (-O0):
define void @I2SRxDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 3072
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -3
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2SRxDisable(i64 %0) {
%2 = add i64 %0, 3072
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -3
store volatile i64 %5, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void uDMAChannelDisable(uint32_t ui32ChannelNum) {
  ASSERT((ui32ChannelNum & 0xffff) < 32);
  (*((volatile uint32_t *)(0x400FF02C))) = 1 << (ui32ChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
cmp    $0x20,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff02c,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelDisable>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   $0xffe0,%ebx
sete   %dil
call   1030 <ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
mov    %eax,0x400ff02c
pop    %rbx
ret

LLVM IR (-O0):
define void @uDMAChannelDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = icmp slt i32 %4, 32
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %2
%9 = and i32 %8, 31
%10 = shl i32 1, %9
store volatile i32 %10, i32* inttoptr (i64 1074786348 to i32*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelDisable(i32 %0) {
%2 = and i32 %0, 65504
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = and i32 %0, 31
%7 = shl nuw i32 1, %6
store volatile i32 %7, i32* inttoptr (i64 1074786348 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stderr;
void usage(const char *const exe) {
  fprintf(stderr,
          "Usage: %s [-h] [-i <n>] [-q] [-t<n>]\n"
          "-h: display this information.\n"
          "-i <n>: number of loop iterations.\n"
          "-q: quiet mode -- do not print computed error.\n"
          "-t <n>: number of OMP threads.\n",
          exe);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [181 x i8] c"Usage: %s [-h] [-i <n>] [-q] [-t<n>]\0A-h: display this information.\0A-i <n>: number of loop iterations.\0A-q: quiet mode -- do not print computed error.\0A-t <n>: number of OMP threads.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [181 x i8] c"Usage: %s [-h] [-i <n>] [-q] [-t<n>]\0A-h: display this information.\0A-i <n>: number of loop iterations.\0A-q: quiet mode -- do not print computed error.\0A-t <n>: number of OMP threads.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void uint322netbytes_m(uint32_t i, uint8_t *s) {
  s[0] = (uint8_t)(i >> 24);
  s[1] = (uint8_t)(i >> 16);
  s[2] = (uint8_t)(i >> 8);
  s[3] = (uint8_t)(i);
}


x86 assembly (clang, -O0):
<uint322netbytes_m>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
movslq -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint322netbytes_m>:
mov    %edi,%eax
sar    $0x18,%eax
cltq
mov    %rax,(%rsi)
mov    %edi,%eax
sar    $0x10,%eax
cltq
mov    %rax,0x8(%rsi)
movslq %edi,%rax
sar    $0x8,%edi
movslq %edi,%rcx
mov    %rcx,0x10(%rsi)
mov    %rax,0x18(%rsi)
ret

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

LLVM IR (-O2):
define void @uint322netbytes_m(i32 %0, i64* nocapture writeonly %1) {
%3 = ashr i32 %0, 24
%4 = sext i32 %3 to i64
store i64 %4, i64* %1
%5 = ashr i32 %0, 16
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %6, i64* %7
%8 = ashr i32 %0, 8
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %1, i64 2
store i64 %9, i64* %10
%11 = sext i32 %0 to i64
%12 = getelementptr inbounds i64, i64* %1, i64 3
store i64 %11, i64* %12
ret void
}
void drain2(void) {
  while ((*(volatile unsigned long *)(0x80000000 + (0x1140))) & 0x00800000)
    ;
}


x86 assembly (clang, -O0):
<drain2>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <drain2+0x9>
mov    $0x80001140,%eax
mov    (%rax),%rax
and    $0x800000,%rax
cmp    $0x0,%rax
je     1126 <drain2+0x26>
jmp    1109 <drain2+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drain2>:
mov    $0x80001140,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x800000,(%rax)
jne    1110 <drain2+0x10>
ret

LLVM IR (-O0):
define void @drain2() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i64, i64* inttoptr (i64 2147488064 to i64*)
%3 = and i64 %2, 8388608
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @drain2() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 2147488064 to i64*)
%3 = and i64 %2, 8388608
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ make_http_body();
int make_packet(char *_packet, char *_fname, int *_body_len) {
  int header_len;
  int packet_len;
  char *body_line = calloc(sizeof(char), 1024 * 1024);
  char *header_line = calloc(sizeof(char), 1024 * 1024);
  make_http_body();
  return 123;
}


x86 assembly (clang, -O0):
<make_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%edi
mov    $0x100000,%esi
call   1040 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x1,%edi
mov    $0x100000,%esi
call   1040 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1030 <make_http_body@plt>
mov    $0x7b,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_packet>:
push   %rax
xor    %eax,%eax
call   1030 <make_http_body@plt>
mov    $0x7b,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @make_packet(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%11 = call i8* @calloc(i32 1, i32 1048576)
store i8* %11, i8** %9
%12 = call i8* @calloc(i32 1, i32 1048576)
store i8* %12, i8** %10
%13 = call i32 (...) @make_http_body()
ret i32 123
}

LLVM IR (-O2):
define i32 @make_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = tail call i32 (...) @make_http_body()
ret i32 123
}
int *_testfunc_ai8(int a[8]) { return a; }


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

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

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

LLVM IR (-O2):
define i32* @_testfunc_ai8(i32* readnone returned %0) {
ret i32* %0
}
int logicalShift(int x, int n) { return (int)((unsigned int)x >> n); }


x86 assembly (clang, -O0):
<logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicalShift>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_files();
int /*<<< orphan*/ declare_variables();
int /*<<< orphan*/ opt_statement();
main() {
  clear_files();
  opt_statement();
  declare_variables();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clear_files@plt>
mov    $0x0,%al
call   1040 <opt_statement@plt>
mov    $0x0,%al
call   1050 <declare_variables@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @clear_files()
%2 = call i32 (...) @opt_statement()
%3 = call i32 (...) @declare_variables()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @clear_files()
%2 = tail call i32 (...) @opt_statement()
%3 = tail call i32 (...) @declare_variables()
ret i32 0
}
void RotatePlane90() {}


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

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

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

LLVM IR (-O2):
define void @RotatePlane90() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
int main() {
  char buf[16];
  sprintf(buf, "%d", 0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
xor    %edx,%edx
call   1030 <sprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
__typeof__(fputs(1, "")) test_fputs_209(void) { return fputs(1, ""); }


x86 assembly (clang, -O0):
<test_fputs_209>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fputs_209>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_fputs_209() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @fputs to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_fputs_209() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @fputs to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int quad(int y_min, int y_max, int x) {
  int y;
  static const int passer_bonus[8] = {0, 0, 0, 26, 77, 154, 256, 0};
  y = y_min + ((y_max - y_min) * passer_bonus[x] + 128) / 256;
  return y;
}


x86 assembly (clang, -O0):
<quad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
movslq -0xc(%rbp),%rdx
lea    0xedc(%rip),%rcx
imul   (%rcx,%rdx,4),%eax
add    $0x80,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad>:
sub    %edi,%esi
movslq %edx,%rax
lea    0xef4(%rip),%rcx
imul   (%rcx,%rax,4),%esi
lea    0x80(%rsi),%ecx
lea    0x17f(%rsi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x8,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
@quad.passer_bonus = internal constant [8 x i32] [i32 0, i32 0, i32 0, i32 26, i32 77, i32 154, i32 256, i32 0]
define i32 @quad(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [8 x i32], [8 x i32]* @quad.passer_bonus, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = mul nsw i32 %11, %15
%17 = add nsw i32 %16, 128
%18 = sdiv i32 %17, 256
%19 = add nsw i32 %8, %18
store i32 %19, i32* %7
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@quad.passer_bonus = internal unnamed_addr constant [8 x i32] [i32 0, i32 0, i32 0, i32 26, i32 77, i32 154, i32 256, i32 0]
define i32 @quad(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @quad.passer_bonus, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, %4
%9 = add nsw i32 %8, 128
%10 = sdiv i32 %9, 256
%11 = add nsw i32 %10, %0
ret i32 %11
}
/* Variables and functions */
unsigned short read_chan(int);
unsigned short read_temp(void) { return read_chan(0x10); }


x86 assembly (clang, -O0):
<read_temp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <read_chan@plt>
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_temp>:
mov    $0x10,%edi
jmp    1030 <read_chan@plt>

LLVM IR (-O0):
define zeroext i16 @read_temp() {
%1 = call zeroext i16 @read_chan(i32 16)
ret i16 %1
}

LLVM IR (-O2):
define zeroext i16 @read_temp() {
%1 = tail call zeroext i16 @read_chan(i32 16)
ret i16 %1
}
const char *deviceRelayGetName(void) { return "relay"; }


x86 assembly (clang, -O0):
<deviceRelayGetName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deviceRelayGetName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"relay\00"
define i8* @deviceRelayGetName() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"relay\00"
define i8* @deviceRelayGetName() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void title_exit_button_click(struct button *button, struct world *world) {}


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

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

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

LLVM IR (-O2):
%struct.button = type opaque
%struct.world = type opaque
define void @title_exit_button_click(%struct.button* nocapture %0, %struct.world* nocapture %1) {
ret void
}