xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *trim_start(char *str) {
  while (0 != *str) {
    if (!isspace(*str)) {
      return str;
    }
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<trim_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1160 <trim_start+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114f <trim_start+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <trim_start+0x58>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <trim_start+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_start>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <trim_start+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1138 <trim_start+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <trim_start+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim_start(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
char d(void) { return 'd'; }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
mov    $0x64,%al
ret

LLVM IR (-O0):
define signext i8 @d() {
ret i8 100
}

LLVM IR (-O2):
define signext i8 @d() {
ret i8 100
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_AddVec2_init(void) {
  _hmt_register_covercase("HMM_AddVec2", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_AddVec2_init>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"HMM_AddVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_AddVec2_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"HMM_AddVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_AddVec2_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void helper_func_0() { ; }


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

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

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

LLVM IR (-O2):
define void @helper_func_0() {
ret void
}
void SteamAPI_vr_IVRCompositor_CompositorGoToBack(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_vr_IVRCompositor_CompositorGoToBack>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_CompositorGoToBack = [45 x i8] c"SteamAPI_vr_IVRCompositor_CompositorGoToBack\00"
define void @SteamAPI_vr_IVRCompositor_CompositorGoToBack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @__func__.SteamAPI_vr_IVRCompositor_CompositorGoToBack, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_CompositorGoToBack = [45 x i8] c"SteamAPI_vr_IVRCompositor_CompositorGoToBack\00"
define void @SteamAPI_vr_IVRCompositor_CompositorGoToBack(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @__func__.SteamAPI_vr_IVRCompositor_CompositorGoToBack, i64 0, i64 0), i8* %0)
ret void
}
__attribute((always_)) void glm_make_rad(float *deg) {
  *deg = *deg * ((float)3.14159265358979323846264338327950288) / 180.0f;
}


x86 assembly (clang, -O0):
<glm_make_rad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xef0(%rip),%xmm0
mulss  (%rax),%xmm0
movss  0xee0(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_make_rad>:
movss  (%rdi),%xmm0
mulss  0xef4(%rip),%xmm0
divss  0xef0(%rip),%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @glm_make_rad(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fmul float %4, 0x400921FB60000000
%6 = fdiv float %5, 1.800000e+02
%7 = load float*, float** %2
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @glm_make_rad(float* nocapture %0) {
%2 = load float, float* %0
%3 = fmul float %2, 0x400921FB60000000
%4 = fdiv float %3, 1.800000e+02
store float %4, float* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int beholddb_exec(int /*<<< orphan*/ *, char *);
int beholddb_rollback(sqlite3 *db) { return beholddb_exec(db, "rollback;"); }


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

x86 assembly (clang, -O2):
<beholddb_rollback>:
lea    0xee9(%rip),%rsi
jmp    1030 <beholddb_exec@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"rollback;\00"
define i32 @beholddb_rollback(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @beholddb_exec(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"rollback;\00"
define i32 @beholddb_rollback(i32* %0) {
%2 = tail call i32 @beholddb_exec(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int color_test();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int color_off(FILE *f) {
  int use_color = color_test();
  switch (use_color) {
  case 1:
    fprintf(f, "\033[0m");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<color_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1040 <color_test@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    1157 <color_off+0x37>
jmp    1147 <color_off+0x27>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_off>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <color_test@plt>
cmp    $0x1,%eax
jne    1149 <color_off+0x29>
lea    0xec9(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define i32 @color_off(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 (...) @color_test()
store i32 %4, i32* %3
%5 = load i32, i32* %3
switch i32 %5, label %9 [
i32 1, label %6
]
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %1, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define i32 @color_off(i32* nocapture %0) {
%2 = tail call i32 (...) @color_test()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
br label %6
6: ; preds = %1, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void plugin_unload(void *handle) { dlclose(handle); }


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

x86 assembly (clang, -O2):
<plugin_unload>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @plugin_unload(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Variables and functions */
int *split(int *, int *);
void quicksort(const int a[], int *low, int *high) {
  int *middle;
  if (low >= high) {
    return;
  }
  middle = split(low, high);
  quicksort(a, low, (middle - 1));
  quicksort(a, (middle + 1), high);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1147 <quicksort+0x27>
jmp    1182 <quicksort+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <split@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0xfffffffffffffffc,%rdx
call   1030 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x4,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jae    1169 <quicksort+0x49>
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <split@plt>
mov    %rax,%rbx
lea    -0x4(%rax),%rdx
mov    %r14,%rdi
mov    %r12,%rsi
call   1030 <quicksort@plt>
add    $0x4,%rbx
mov    %rbx,%r12
cmp    %r15,%rbx
jb     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32* %1, i32* %2) {
%4 = icmp ult i32* %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32* [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32* @split(i32* %6, i32* %2)
%8 = getelementptr inbounds i32, i32* %7, i64 -1
tail call void @quicksort(i32* %0, i32* %6, i32* %8)
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = icmp ult i32* %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/ *, size_t, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
void *pmem_map_cl(int fd, size_t len) {
  void *base;
  if ((base = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)) ==
      MAP_FAILED)
    return NULL;
  return base;
}


x86 assembly (clang, -O0):
<pmem_map_cl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
mov    0x2e9d(%rip),%rax
or     (%rax),%edx
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    -0xc(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e6f(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <pmem_map_cl+0x5f>
movq   $0x0,-0x8(%rbp)
jmp    1177 <pmem_map_cl+0x67>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmem_map_cl>:
push   %rbx
mov    %edi,%r8d
mov    0x2edd(%rip),%rax
mov    0x2eae(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
xor    %ebx,%ebx
xor    %edi,%edi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
define i8* @pmem_map_cl(i32 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = load i32, i32* @PROT_READ
%9 = load i32, i32* @PROT_WRITE
%10 = or i32 %8, %9
%11 = load i32, i32* @MAP_SHARED
%12 = load i32, i32* %4
%13 = call i8* @mmap(i32* null, i64 %7, i32 %10, i32 %11, i32 %12, i32 0)
store i8* %13, i8** %6
%14 = load i8*, i8** @MAP_FAILED
%15 = icmp eq i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
store i8* null, i8** %3
br label %19
17: ; preds = %2
%18 = load i8*, i8** %6
store i8* %18, i8** %3
br label %19
19: ; preds = %17, %16
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
define i8* @pmem_map_cl(i32 %0, i64 %1) {
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @PROT_WRITE
%5 = or i32 %4, %3
%6 = load i32, i32* @MAP_SHARED
%7 = tail call i8* @mmap(i32* null, i64 %1, i32 %5, i32 %6, i32 %0, i32 0)
%8 = load i8*, i8** @MAP_FAILED
%9 = icmp eq i8* %7, %8
%10 = select i1 %9, i8* null, i8* %7
ret i8* %10
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void call_accept(int fd, short event, void *arg) {
  printf("come in a new accept\n");
  struct sockaddr_in cliaddr;
  socklen_t clilen;
  int connfd;
  connfd = accept(fd, (struct sockaddr *)&cliaddr, &clilen);
  printf("accept from cliaddr\n");
  char buf[100];
}


x86 assembly (clang, -O0):
<call_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x20(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_accept>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1040 <accept@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [22 x i8] c"come in a new accept\0A\00"
@.str.1 = [21 x i8] c"accept from cliaddr\0A\00"
define void @call_accept(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.sockaddr_in
%8 = alloca i32
%9 = alloca i32
%10 = alloca [100 x i8]
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%14 = call i32 @accept(i32 %12, %struct.sockaddr* %13, i32* %8)
store i32 %14, i32* %9
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@str = [21 x i8] c"come in a new accept\00"
@str.2 = [20 x i8] c"accept from cliaddr\00"
define void @call_accept(i32 %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%7 = bitcast %struct.sockaddr_in* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%10 = call i32 @accept(i32 %0, %struct.sockaddr* %9, i32* %5)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int /*<<< orphan*/ replace();
int main(int x) {
  f();
  {
    replace();
    replace();
  }
  g();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1050 <replace@plt>
mov    $0x0,%al
call   1050 <replace@plt>
mov    $0x0,%al
call   1040 <g@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @f()
%4 = call i32 (...) @replace()
%5 = call i32 (...) @replace()
%6 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @replace()
%4 = tail call i32 (...) @replace()
%5 = tail call i32 (...) @g()
ret i32 0
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  {
    state[0UL] = input[0UL] + (unsigned char)69;
    if ((state[0UL] >> (unsigned char)4) & (unsigned char)1) {
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] + 903211243UL) * (unsigned char)223;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x45,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <RandomFunc+0x3e>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
jmp    114b <RandomFunc+0x4b>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
add    $0x35d5e8eb,%rax
imul   $0xdf,%rax,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzbl (%rdi),%eax
imul   $0xffffffbe,%eax,%eax
add    $0xeb,%al
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = mul i8 %3, -66
%5 = add i8 %4, -21
store i8 %5, i8* %1
ret void
}
int sfd_isspace(const char c) { return (c == ' ' || ((c >= 9) && (c <= 13))); }


x86 assembly (clang, -O0):
<sfd_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1141 <sfd_isspace+0x41>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x3(%rbp)
jl     113b <sfd_isspace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_isspace>:
cmp    $0x20,%dil
sete   %al
add    $0xf7,%dil
cmp    $0x5,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @sfd_isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 9
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 13
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ false, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ true, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @sfd_isspace(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = add i8 %0, -9
%4 = icmp ult i8 %3, 5
%5 = or i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int midi_is_enabled() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @midi_is_enabled() {
ret i32 0
}
int reverse(int no) {
  int rev = 0;
  while (no > 0) {
    int r = no % 10;
    rev = rev * 10 + r;
    no = no / 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1143 <reverse+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <reverse+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = urem i32 %4, 10
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %4, 10
%10 = icmp ult i32 %4, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ esperar();
int main(void) {
  volatile unsigned char *ddr_b = (unsigned char *)0x24;
  *ddr_b = *ddr_b | (0x20);
  volatile unsigned char *puerto_b = (unsigned char *)0x25;
  while (1) {
    *puerto_b = *puerto_b | (0x20);
    esperar();
    *puerto_b = *puerto_b & (~(0x20));
    esperar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x24,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
movzbl %al,%eax
or     $0x20,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    $0x25,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
movzbl %al,%eax
or     $0x20,%eax
mov    %eax,-0x20(%rbp)
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <esperar@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
movzbl %al,%eax
and    $0xffffffdf,%eax
mov    %eax,-0x1c(%rbp)
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <esperar@plt>
jmp    1145 <main+0x35>

x86 assembly (clang, -O2):
<main>:
push   %rax
orb    $0x20,0x24
20
nopl   0x0(%rax)
orb    $0x20,0x25
20
xor    %eax,%eax
call   1030 <esperar@plt>
andb   $0xdf,0x25
df
xor    %eax,%eax
call   1030 <esperar@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* inttoptr (i64 36 to i8*), i8** %2
%4 = load i8*, i8** %2
%5 = load volatile i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 32
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %2
store volatile i8 %8, i8* %9
store i8* inttoptr (i64 37 to i8*), i8** %3
br label %10
10: ; preds = %0, %10
%11 = load i8*, i8** %3
%12 = load volatile i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %13, 32
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
store volatile i8 %15, i8* %16
%17 = call i32 (...) @esperar()
%18 = load i8*, i8** %3
%19 = load volatile i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, -33
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %3
store volatile i8 %22, i8* %23
%24 = call i32 (...) @esperar()
br label %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = load volatile i8, i8* inttoptr (i64 36 to i8*)
%2 = or i8 %1, 32
store volatile i8 %2, i8* inttoptr (i64 36 to i8*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i8, i8* inttoptr (i64 37 to i8*)
%5 = or i8 %4, 32
store volatile i8 %5, i8* inttoptr (i64 37 to i8*)
%6 = tail call i32 (...) @esperar()
%7 = load volatile i8, i8* inttoptr (i64 37 to i8*)
%8 = and i8 %7, -33
store volatile i8 %8, i8* inttoptr (i64 37 to i8*)
%9 = tail call i32 (...) @esperar()
br label %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool __filt_even_val_1(void *cc, void *k, void *v) {
  return !(*(uint32_t *)v % 2);
}


x86 assembly (clang, -O0):
<__filt_even_val_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__filt_even_val_1>:
mov    (%rdx),%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__filt_even_val_1(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @__filt_even_val_1(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ vsprintf(char *, char const *, int /*<<< orphan*/);
const char *kp_sprintfv(const char *fmt, va_list argp) {
  char *msg = malloc(128);
  vsprintf(msg, fmt, argp);
  return msg;
}


x86 assembly (clang, -O0):
<kp_sprintfv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x80,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vsprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kp_sprintfv>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x80,%edi
call   1030 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <vsprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @kp_sprintfv(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i8* @malloc(i32 128)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vsprintf(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @kp_sprintfv(i8* nocapture %0, i32 %1) {
%3 = tail call dereferenceable_or_null(128) i8* @malloc(i32 128)
%4 = tail call i32 @vsprintf(i8* %3, i8* %0, i32 %1)
ret i8* %3
}
void curveb_(basisid) int *basisid;
{ curvebasis((short)*basisid); }


x86 assembly (clang, -O0):
<curveb_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movswl %ax,%edi
mov    $0x0,%al
call   1030 <curvebasis@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curveb_>:
movswl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <curvebasis@plt>

LLVM IR (-O0):
define void @curveb_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i16
%6 = sext i16 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @curvebasis to i32 (i32, ...)*)(i32 %6)
ret void
}

LLVM IR (-O2):
define void @curveb_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = ashr exact i32 %3, 16
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @curvebasis to i32 (i32, ...)*)(i32 %4)
ret void
}
int test_imm_83uint8_reg(unsigned char val) {
  return ((val) & (-0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff7d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_83uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 125
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void INT_Excep_TPU3_TCI3V(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU3_TCI3V() {
ret void
}
unsigned long b_input(unsigned char *str, unsigned long nbr) {
  unsigned long len;
  asm volatile("call *0x00100020" : "=c"(len) : "c"(nbr), "D"(str));
  return len;
}


x86 assembly (clang, -O0):
<b_input>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdi
call   *0x100020
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_input>:
mov    %rsi,%rcx
call   *0x100020
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_input(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i8*, i8** %3
%8 = call i64 asm sideeffect "call *0x00100020", "={cx},{cx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %6, i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @b_input(i8* %0, i64 %1) {
%3 = tail call i64 asm sideeffect "call *0x00100020", "={cx},{cx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %1, i8* %0)
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, int *, int);
float modbus_get_float(const uint16_t *src) {
  float f = 0.0f;
  uint32_t i;
  i = (((uint32_t)src[1]) << 16) + src[0];
  memcpy(&f, &i, sizeof(float));
  return f;
}


x86 assembly (clang, -O0):
<modbus_get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbus_get_float>:
push   %rax
movl   $0x0,(%rsp)
mov    0x4(%rdi),%eax
shl    $0x10,%eax
add    (%rdi),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @modbus_get_float(i32* %0) {
%2 = alloca i32*
%3 = alloca float
%4 = alloca i32
store i32* %0, i32** %2
store float 0.000000e+00, float* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
store i32 %12, i32* %4
%13 = call i32 @memcpy(float* %3, i32* %4, i32 4)
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @modbus_get_float(i32* nocapture %0) {
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32, i32* %0
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = call i32 @memcpy(float* %2, i32* %3, i32 4)
%12 = load float, float* %2
ret float %12
}
/* Variables and functions */
int suma(int, int);
int main(int argc, char *argv[]) {
  int x;
  int result = suma(x, 2);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1030 <suma@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @suma(i32 undef, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(int);
scalar_t__ isgraph(int);
int ispunct(int c) { return isgraph(c) && !isalpha(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isgraph@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1158 <ispunct+0x38>
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbx
mov    %edi,%ebx
call   1040 <isgraph@plt>
test   %rax,%rax
je     113f <ispunct+0x1f>
mov    %ebx,%edi
call   1030 <isalpha@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isgraph(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalpha(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isgraph(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @isalpha(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void tx_request_command() {
  volatile unsigned char r_val;
  printf("Send transmit-request \n");
  r_val = *((volatile unsigned char *)(0xfff20000 + 0x0001)) | 0x01;
  *((volatile unsigned char *)(0xfff20000 + 0x0001)) = r_val;
  printf("command register: 0x%X \n\n",
         *((volatile unsigned char *)(0xfff20000 + 0x0001)));
}


x86 assembly (clang, -O0):
<tx_request_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff20001,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xfff20001,%eax
mov    %cl,(%rax)
mov    $0xfff20001,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_request_command>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfff20001,%eax
mov    (%rax),%cl
or     $0x1,%cl
mov    %cl,0x7(%rsp)
mov    0x7(%rsp),%cl
mov    %cl,(%rax)
movzbl (%rax),%esi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Send transmit-request \0A\00"
@.str.1 = [26 x i8] c"command register: 0x%X \0A\0A\00"
define void @tx_request_command() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load volatile i8, i8* inttoptr (i64 4294049793 to i8*)
%4 = zext i8 %3 to i32
%5 = or i32 %4, 1
%6 = trunc i32 %5 to i8
store volatile i8 %6, i8* %1
%7 = load volatile i8, i8* %1
store volatile i8 %7, i8* inttoptr (i64 4294049793 to i8*)
%8 = load volatile i8, i8* inttoptr (i64 4294049793 to i8*)
%9 = zext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"command register: 0x%X \0A\0A\00"
@str = [23 x i8] c"Send transmit-request \00"
define void @tx_request_command() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = load volatile i8, i8* inttoptr (i64 4294049793 to i8*)
%4 = or i8 %3, 1
store volatile i8 %4, i8* %1
%5 = load volatile i8, i8* %1
store volatile i8 %5, i8* inttoptr (i64 4294049793 to i8*)
%6 = load volatile i8, i8* inttoptr (i64 4294049793 to i8*)
%7 = zext i8 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
char bar(char x, char y) { return x - y; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%eax
sub    %sil,%al
ret

LLVM IR (-O0):
define signext i8 @bar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @bar(i8 signext %0, i8 signext %1) {
%3 = sub i8 %0, %1
ret i8 %3
}
int test_imm_23int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x23 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_23int64_highword_mem>:
testb  $0x23,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_23int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 35
%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_23int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 150323855360
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void cleanArray(int a[]) {
  int i = 0;
  int len = sizeof(a);
  for (i = 0; i < len; i++) {
    a[i] = 0;
  }
}


x86 assembly (clang, -O0):
<cleanArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1146 <cleanArray+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <cleanArray+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanArray>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @cleanArray(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cubeByReference(int *);
int /*<<< orphan*/ cubeByValue(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 10;
  printf("val of n is %d\n", n);
  cubeByValue(n);
  printf("val of n is %d\n", n);
  cubeByReference(&n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <cubeByValue@plt>
mov    -0x4(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <cubeByReference@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <cubeByValue@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
lea    0xc(%rsp),%rdi
call   1030 <cubeByReference@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"val of n is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @cubeByValue(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @cubeByReference(i32* %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"val of n is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 @cubeByValue(i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = call i32 @cubeByReference(i32* %1)
ret i32 0
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inorderBST(struct node *, int *, int);
void inorder(struct node *root, int *arr) { inorderBST(root, arr, 1); }


x86 assembly (clang, -O0):
<inorder>:
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    $0x1,%edx
call   1030 <inorderBST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inorder>:
mov    $0x1,%edx
jmp    1030 <inorderBST@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @inorder(%struct.node* %0, i32* %1) {
%3 = alloca %struct.node*
%4 = alloca i32*
store %struct.node* %0, %struct.node** %3
store i32* %1, i32** %4
%5 = load %struct.node*, %struct.node** %3
%6 = load i32*, i32** %4
%7 = call i32 @inorderBST(%struct.node* %5, i32* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @inorder(%struct.node* %0, i32* %1) {
%3 = tail call i32 @inorderBST(%struct.node* %0, i32* %1, i32 1)
ret void
}
void __attribute__((noipa)) consume(void) {}


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

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

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

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