xunge/DecIR huggingface dataset:
/* Type definitions */
struct vec4i {
  int dummy;
};
struct mat4 {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec4i_multiply_mat4(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *, float *);
__attribute__((always_)) struct vec4i *
psvec4i_multiply_mat4(struct vec4i *result, struct vec4i *a, struct mat4 *m) {
  vec4i_multiply_mat4((int32_t *)result, (int32_t *)a, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4i_multiply_mat4>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4i_multiply_mat4@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4i = type { i32 }
%struct.mat4 = type { i32 }
define %struct.vec4i* @psvec4i_multiply_mat4(%struct.vec4i* %0, %struct.vec4i* %1, %struct.mat4* %2) {
%4 = alloca %struct.vec4i*
%5 = alloca %struct.vec4i*
%6 = alloca %struct.mat4*
store %struct.vec4i* %0, %struct.vec4i** %4
store %struct.vec4i* %1, %struct.vec4i** %5
store %struct.mat4* %2, %struct.mat4** %6
%7 = load %struct.vec4i*, %struct.vec4i** %4
%8 = bitcast %struct.vec4i* %7 to i32*
%9 = load %struct.vec4i*, %struct.vec4i** %5
%10 = bitcast %struct.vec4i* %9 to i32*
%11 = load %struct.mat4*, %struct.mat4** %6
%12 = bitcast %struct.mat4* %11 to float*
%13 = call i32 @vec4i_multiply_mat4(i32* %8, i32* %10, float* %12)
%14 = load %struct.vec4i*, %struct.vec4i** %4
ret %struct.vec4i* %14
}

LLVM IR (-O2):
%struct.vec4i = type { i32 }
%struct.mat4 = type { i32 }
define %struct.vec4i* @psvec4i_multiply_mat4(%struct.vec4i* returned %0, %struct.vec4i* %1, %struct.mat4* %2) {
%4 = getelementptr %struct.vec4i, %struct.vec4i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec4i, %struct.vec4i* %1, i64 0, i32 0
%6 = bitcast %struct.mat4* %2 to float*
%7 = tail call i32 @vec4i_multiply_mat4(i32* %4, i32* %5, float* %6)
ret %struct.vec4i* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(int argc, char **argv) { exit(77); }


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    $0x4d,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4d,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @exit(i32 77)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 77)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("\nab");
  printf("\bsi");
  printf("\rha");
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\0Aab\00"
@.str.1 = [4 x i8] c"\08si\00"
@.str.2 = [4 x i8] c"\0Dha\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0Aab\00"
@.str.1 = [4 x i8] c"\08si\00"
@.str.2 = [4 x i8] c"\0Dha\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_FOLLOW;
int linkat(int /*<<< orphan*/, char const *, int /*<<< orphan*/, char const *,
           int /*<<< orphan*/);
int link(const char *name1, const char *name2) {
  return linkat(AT_FDCWD, name1, AT_FDCWD, name2, AT_SYMLINK_FOLLOW);
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    0x2ea7(%rip),%rax
mov    (%rax),%r8d
call   1030 <linkat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    %rsi,%rcx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    0x2ec2(%rip),%rax
mov    (%rax),%r8d
mov    %edi,%edx
jmp    1030 <linkat@plt>

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

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@AT_SYMLINK_FOLLOW = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = load i32, i32* @AT_SYMLINK_FOLLOW
%5 = tail call i32 @linkat(i32 %3, i8* %0, i32 %3, i8* %1, i32 %4)
ret i32 %5
}
int test_imm_21int64_lowword_reg(long long val) {
  return ((val) & (0x21 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_21int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 33
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void count_closed_crq(void) {}


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

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

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

LLVM IR (-O2):
define void @count_closed_crq() {
ret void
}
char hexToNibble(char n) { return n - (n <= '9' ? '0' : ('a' - 10)); }


x86 assembly (clang, -O0):
<hexToNibble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x1(%rbp),%esi
mov    $0x57,%ecx
mov    $0x30,%edx
cmp    $0x39,%esi
cmovle %edx,%ecx
sub    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexToNibble>:
cmp    $0x3a,%dil
mov    $0xd0,%ecx
mov    $0xa9,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hexToNibble(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sle i32 %6, 57
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 48, i32 87
%10 = sub nsw i32 %4, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @hexToNibble(i8 signext %0) {
%2 = icmp slt i8 %0, 58
%3 = select i1 %2, i8 -48, i8 -87
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_smoother_reset() {
  printf("NOT IMPLEMENTED:"
         "pa_smoother_reset"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_smoother_reset\00"
define i32 @pa_smoother_reset() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_CLEAR_BIT(int, int);
void xburst_cgm_ungate_gpvlc() { MIPS_CLEAR_BIT((0xB0000000 + 0x28), 7); }


x86 assembly (clang, -O0):
<xburst_cgm_ungate_gpvlc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x7,%esi
call   1030 <MIPS_CLEAR_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_ungate_gpvlc>:
mov    $0xb0000028,%edi
mov    $0x7,%esi
jmp    1030 <MIPS_CLEAR_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_ungate_gpvlc() {
%1 = call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 7)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_ungate_gpvlc() {
%1 = tail call i32 @MIPS_CLEAR_BIT(i32 -1342177240, i32 7)
ret void
}
int tegra_cl_dvfs_vmin_cmp_needed(struct tegra_cl_dvfs *cld, int *needed_mv) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tegra_cl_dvfs = type opaque
define i32 @tegra_cl_dvfs_vmin_cmp_needed(%struct.tegra_cl_dvfs* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
int tputs(char *string, int nlines, int (*outfun)(char)) {
  while (*string)
    outfun(*string++);
  return 0;
}


x86 assembly (clang, -O0):
<tputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <tputs+0x3d>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%edi
call   *%rax
jmp    1113 <tputs+0x13>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1131 <tputs+0x31>
mov    %rdx,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   *%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tputs+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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


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

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

LLVM IR (-O0):
define i32 @fun554() {
ret i32 554
}

LLVM IR (-O2):
define i32 @fun554() {
ret i32 554
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ call_longjmp_1(int /*<<< orphan*/ *);
int call_longjmp(jmp_buf *buf) { call_longjmp_1(buf); }


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

x86 assembly (clang, -O2):
<call_longjmp>:
jmp    1030 <call_longjmp_1@plt>

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

LLVM IR (-O2):
define i32 @call_longjmp(i32* %0) {
%2 = tail call i32 @call_longjmp_1(i32* %0)
ret i32 undef
}
/* Variables and functions */
int write(int, char *, int);
int write_file_n_(int *fd, char *buf, int *nbytes, int *ierr) {
  int bytes_written;
  bytes_written = write(*fd, buf, *nbytes);
  if (bytes_written != *nbytes) {
    *ierr = -1;
  } else {
    *ierr = 0;
  }
  return *ierr;
}


x86 assembly (clang, -O0):
<write_file_n_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <write@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
je     115e <write_file_n_+0x4e>
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    1168 <write_file_n_+0x58>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file_n_>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    (%rbx),%eax
setne  %cl
neg    %ecx
mov    %ecx,(%r14)
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @write_file_n_(i32* nocapture %0, i8* nocapture %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %2
%7 = tail call i32 @write(i32 %5, i8* %1, i32 %6)
%8 = load i32, i32* %2
%9 = icmp ne i32 %7, %8
%10 = sext i1 %9 to i32
store i32 %10, i32* %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ touchwin(int /*<<< orphan*/);
void ScheduleFullRedraw(void) { touchwin(stdscr); }


x86 assembly (clang, -O0):
<ScheduleFullRedraw>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <touchwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScheduleFullRedraw>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <touchwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @ScheduleFullRedraw() {
%1 = load i32, i32* @stdscr
%2 = call i32 @touchwin(i32 %1)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @ScheduleFullRedraw() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @touchwin(i32 %1)
ret void
}
/* Variables and functions */
long long string_to_milliseconds(char const *);
long long string_to_seconds(const char *str) {
  long long ret = string_to_milliseconds(str);
  if (-1 == ret)
    return ret;
  return ret / 1000;
}


x86 assembly (clang, -O0):
<string_to_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <string_to_milliseconds@plt>
mov    %rax,-0x18(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    -0x18(%rbp),%rax
jne    1147 <string_to_seconds+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <string_to_seconds+0x49>
mov    -0x18(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_seconds>:
push   %rax
call   1030 <string_to_milliseconds@plt>
cmp    $0xffffffffffffffff,%rax
je     113c <string_to_seconds+0x2c>
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x7,%rax
add    %rcx,%rax
pop    %rcx
ret
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @string_to_seconds(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @string_to_milliseconds(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp eq i64 -1, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i64, i64* %4
store i64 %10, i64* %2
br label %14
11: ; preds = %1
%12 = load i64, i64* %4
%13 = sdiv i64 %12, 1000
store i64 %13, i64* %2
br label %14
14: ; preds = %11, %9
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @string_to_seconds(i8* %0) {
%2 = tail call i64 @string_to_milliseconds(i8* %0)
%3 = icmp eq i64 %2, -1
%4 = sdiv i64 %2, 1000
%5 = select i1 %3, i64 -1, i64 %4
ret i64 %5
}
int check_allrouters_membership(int sock, struct Interface *iface) {
  return (0);
}


x86 assembly (clang, -O0):
<check_allrouters_membership>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.Interface = type opaque
define i32 @check_allrouters_membership(i32 %0, %struct.Interface* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __test_strcase();
int /*<<< orphan*/ __test_strdup();
int /*<<< orphan*/ __test_strstr();
int main(int argc, char **argv) {
  __test_strstr();
  __test_strcase();
  __test_strdup();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @__test_strstr()
%7 = call i32 (...) @__test_strcase()
%8 = call i32 (...) @__test_strdup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @__test_strstr()
%4 = tail call i32 (...) @__test_strcase()
%5 = tail call i32 (...) @__test_strdup()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ inv_dct16_1d_internal_c(int /*<<< orphan*/ *const,
                                           int /*<<< orphan*/ const, int const,
                                           int const, int /*<<< orphan*/);
void dav1d_inv_dct16_1d_c(int32_t *const c, const ptrdiff_t stride,
                          const int min, const int max) {
  inv_dct16_1d_internal_c(c, stride, min, max, 0);
}


x86 assembly (clang, -O0):
<dav1d_inv_dct16_1d_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <inv_dct16_1d_internal_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dav1d_inv_dct16_1d_c>:
xor    %r8d,%r8d
jmp    1030 <inv_dct16_1d_internal_c@plt>

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

LLVM IR (-O2):
define void @dav1d_inv_dct16_1d_c(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @inv_dct16_1d_internal_c(i32* %0, i32 %1, i32 %2, i32 %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(int);
void uninitvar_toupper(void) {
  int c;
  (void)toupper(c);
}


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

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

LLVM IR (-O0):
define void @uninitvar_toupper() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @toupper(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_toupper() {
ret void
}
int test_imm_B5int8_reg(signed char val) {
  return ((val) & (0xB5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B5int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 181
%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_B5int8_reg(i8 signext %0) {
%2 = and i8 %0, -75
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn66() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn66");
  return result;
}


x86 assembly (clang, -O0):
<fn66>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn66>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn66\00"
define i8* @fn66() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn66\00"
define i8* @fn66() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ ReverseBit(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, i;
  scanf("%i", &num);
  printf("original number: %08X\n", num);
  ReverseBit(&num);
  printf("after reversing: %08X\n", num);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <ReverseBit@plt>
mov    0xc(%rsp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [23 x i8] c"original number: %08X\0A\00"
@.str.2 = [23 x i8] c"after reversing: %08X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @ReverseBit(i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [23 x i8] c"original number: %08X\0A\00"
@.str.2 = [23 x i8] c"after reversing: %08X\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @ReverseBit(i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
void node_id_burn(unsigned short id) {}


x86 assembly (clang, -O0):
<node_id_burn>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @node_id_burn(i16 zeroext %0) {
ret void
}
int main1(int a) {
  int b;
  int z;
  b = a;
  {
    int g;
    int c;
    c = b;
    g = c;
    z = g + c;
  }
  return z + 1;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @main1(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void *RSA_generate_key() { return 0; }


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

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

LLVM IR (-O0):
define i8* @RSA_generate_key() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @RSA_generate_key() {
ret i8* null
}
struct desc_track *call_desc_update(int id) {}


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

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

LLVM IR (-O0):
%struct.desc_track = type opaque
define %struct.desc_track* @call_desc_update(i32 %0) {
%2 = alloca %struct.desc_track*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load %struct.desc_track*, %struct.desc_track** %2
ret %struct.desc_track* %4
}

LLVM IR (-O2):
%struct.desc_track = type opaque
define noalias %struct.desc_track* @call_desc_update(i32 %0) {
ret %struct.desc_track* undef
}
/* Type definitions */
struct servent {
  int s_port;
  int /*<<< orphan*/ s_proto;
};

/* Variables and functions */
int /*<<< orphan*/ strdup(char *);
int lc_get_service_info(char *service, char *protocol, struct servent **spp) {
  static struct servent ses;
  struct servent *sp;
  int rv = 0;
  ses.s_proto = strdup("tcp");
  ses.s_port = 13;
  *spp = &ses;
  return rv;
}


x86 assembly (clang, -O0):
<lc_get_service_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xece(%rip),%rdi
call   1030 <strdup@plt>
mov    %eax,0x2ef3(%rip)
movl   $0xd,0x2ee5(%rip)
mov    -0x18(%rbp),%rax
lea    0x2eda(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lc_get_service_info>:
push   %rbx
mov    %rdx,%rbx
lea    0xee5(%rip),%rdi
call   1030 <strdup@plt>
mov    %eax,0x2f0a(%rip)
lea    0x2eff(%rip),%rax
movl   $0xd,0x2ef5(%rip)
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.servent = type { i32, i32 }
@lc_get_service_info.ses = internal global %struct.servent zeroinitializer
@.str = [4 x i8] c"tcp\00"
define i32 @lc_get_service_info(i8* %0, i8* %1, %struct.servent** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.servent**
%7 = alloca %struct.servent*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.servent** %2, %struct.servent*** %6
store i32 0, i32* %8
%9 = call i32 @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* getelementptr inbounds (%struct.servent, %struct.servent* @lc_get_service_info.ses, i32 0, i32 1)
store i32 13, i32* getelementptr inbounds (%struct.servent, %struct.servent* @lc_get_service_info.ses, i32 0, i32 0)
%10 = load %struct.servent**, %struct.servent*** %6
store %struct.servent* @lc_get_service_info.ses, %struct.servent** %10
%11 = load i32, i32* %8
ret i32 %11
}

LLVM IR (-O2):
%struct.servent = type { i32, i32 }
@lc_get_service_info.ses = internal global %struct.servent zeroinitializer
@.str = [4 x i8] c"tcp\00"
define i32 @lc_get_service_info(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.servent** nocapture writeonly %2) {
%4 = tail call i32 @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* getelementptr inbounds (%struct.servent, %struct.servent* @lc_get_service_info.ses, i64 0, i32 1)
store i32 13, i32* getelementptr inbounds (%struct.servent, %struct.servent* @lc_get_service_info.ses, i64 0, i32 0)
store %struct.servent* @lc_get_service_info.ses, %struct.servent** %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ usleep(int);
int main() {
  int i = 0;
  do {
    i = i + 1;
    gotoxy(12, 5);
    printf("hello i=%d\r", i);
    gotoxy(10, 5);
    printf("hello i-1=%d\r", i - 1);
    usleep(3 * 1000);
  } while (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0xc,%edi
mov    $0x5,%esi
call   1040 <gotoxy@plt>
mov    -0x4(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x5,%esi
call   1040 <gotoxy@plt>
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    $0xbb8,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
mov    $0x5,%esi
call   1040 <gotoxy@plt>
lea    0xeb9(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0x5,%esi
call   1040 <gotoxy@plt>
lea    0xea5(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    $0xbb8,%edi
call   1050 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"hello i=%d\0D\00"
@.str.1 = [14 x i8] c"hello i-1=%d\0D\00"
define i32 @main() {
%1 = tail call i32 @gotoxy(i32 12, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @gotoxy(i32 10, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = tail call i32 @usleep(i32 3000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ aodl_run();
int main(int argc, char *argv[]) { aodl_run(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @aodl_run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long long llabs(long long x) { abort(); }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<llabs>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *strchr(char const *, char);
int string_num_dots(const char *s) {
  int count = 0;
  while ((s = strchr(s, '.'))) {
    s++;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<string_num_dots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1159 <string_num_dots+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <string_num_dots+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_num_dots>:
push   %rbx
mov    $0x2e,%esi
call   1030 <strchr@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1149 <string_num_dots+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
add    $0x1,%ebx
mov    %rax,%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <string_num_dots+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @string_num_dots(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = tail call i8* @strchr(i8* dereferenceable(1) %7, i8 signext 46)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "touch", message); }


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

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [6 x i8] c"touch\00"
define void @g_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [6 x i8] c"touch\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void b1(void) {
  for (void (*f)(void);;)
    ;
}


x86 assembly (clang, -O0):
<b1>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <b1+0x4>

x86 assembly (clang, -O2):
<b1>:
jmp    1100 <b1>

LLVM IR (-O0):
define void @b1() {
%1 = alloca void ()*
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define void @b1() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void Usage() {
  printf("shptreedump [-maxdepth n] [-search xmin ymin xmax ymax]\n"
         "            [-v] [-o indexfilename] [-i indexfilename]\n"
         "            shp_file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [133 x i8] c"shptreedump [-maxdepth n] [-search xmin ymin xmax ymax]\0A [-v] [-o indexfilename] [-i indexfilename]\0A shp_file\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [132 x i8] c"shptreedump [-maxdepth n] [-search xmin ymin xmax ymax]\0A [-v] [-o indexfilename] [-i indexfilename]\0A shp_file\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ arreglo(int *, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  srand(time(0));
  int valor, posicion;
  arreglo(&valor, &posicion);
  printf("El maximo valor es %d\n", valor);
  printf("Y su posicion es la %d\n", posicion);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <arreglo@plt>
mov    -0x8(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <arreglo@plt>
mov    0x4(%rsp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"El maximo valor es %d\0A\00"
@.str.1 = [24 x i8] c"Y su posicion es la %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32 0)
%5 = call i32 @srand(i32 %4)
%6 = call i32 @arreglo(i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"El maximo valor es %d\0A\00"
@.str.1 = [24 x i8] c"Y su posicion es la %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srand(i32 %3)
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = call i32 @arreglo(i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll_wait_common(struct tcb *);
int sys_epoll_wait(struct tcb *tcp) {
  epoll_wait_common(tcp);
  return 0;
}


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

x86 assembly (clang, -O2):
<sys_epoll_wait>:
push   %rax
call   1030 <epoll_wait_common@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_epoll_wait(%struct.tcb* %0) {
%2 = tail call i32 @epoll_wait_common(%struct.tcb* %0)
ret i32 0
}
int test_imm_CAuint16_reg(unsigned short val) {
  return ((val) & (0xCA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CAuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 202
%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_CAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 202
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void somewhat_scary(void) {
  volatile int *x = 0xdeadbeef;
  *x = 10;
}


x86 assembly (clang, -O0):
<somewhat_scary>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdeadbeef,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<somewhat_scary>:
mov    $0xdeadbeef,%eax
movl   $0xa,(%rax)
ret

LLVM IR (-O0):
define void @somewhat_scary() {
%1 = alloca i32*
store i32* inttoptr (i64 3735928559 to i32*), i32** %1
%2 = load i32*, i32** %1
store volatile i32 10, i32* %2
ret void
}

LLVM IR (-O2):
define void @somewhat_scary() {
store volatile i32 10, i32* inttoptr (i64 3735928559 to i32*)
ret void
}
int test_imm_28int16_reg(short val) {
  return ((val) & (0x28 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_28int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 40
%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_28int16_reg(i16 signext %0) {
%2 = and i16 %0, 40
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int f114(int *);
int f115(int *p) { return f114(p); }


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

x86 assembly (clang, -O2):
<f115>:
jmp    1030 <f114@plt>

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

LLVM IR (-O2):
define i32 @f115(i32* %0) {
%2 = tail call i32 @f114(i32* %0)
ret i32 %2
}