xunge/DecIR huggingface dataset:
__typeof__(memcpy(1, 1, "")) test_memcpy_111(void) { return memcpy(1, 1, ""); }


x86 assembly (clang, -O0):
<test_memcpy_111>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
lea    0xee0(%rip),%rdx
mov    %rsi,%rdi
call   1030 <memcpy@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_memcpy_111() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @test_memcpy_111() {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ seq_bubble_sort(int *, int);
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  int thread_count = 1;
  int list[10] = {7, 6, 5, 4, 3, 2, 1, 10, 8, 9};
  if (argc == 2) {
    thread_count = strtol(argv[1], NULL, 10);
  }
  seq_bubble_sort(list, 10);
#pragma omp parallel num_threads(thread_count)
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1185 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0xa,%esi
call   1030 <seq_bubble_sort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
cmp    $0x2,%edi
jne    115c <main+0x3c>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <seq_bubble_sort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.list = [10 x i32] [i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 10, i32 8, i32 9]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%8 = bitcast [10 x i32]* %7 to i8*
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strtol(i8* %14, i32* null, i32 10)
store i32 %15, i32* %6
br label %16
16: ; preds = %11, %2
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 0
%18 = call i32 @seq_bubble_sort(i32* %17, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.list = [10 x i32] [i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 10, i32 8, i32 9]
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strtol(i8* nocapture %8, i32* null, i32 10)
br label %10
10: ; preds = %6, %2
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%12 = call i32 @seq_bubble_sort(i32* %11, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rd_byte(char const **, char);
int write_rel();
int rd_wrt_jr(const char **p, char delimiter) {
  if (!rd_byte(p, delimiter))
    return 0;
  return write_rel();
}


x86 assembly (clang, -O0):
<rd_wrt_jr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <rd_byte@plt>
cmp    $0x0,%eax
jne    1154 <rd_wrt_jr+0x34>
movl   $0x0,-0x4(%rbp)
jmp    115e <rd_wrt_jr+0x3e>
mov    $0x0,%al
call   1040 <write_rel@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_wrt_jr>:
push   %rax
call   1030 <rd_byte@plt>
test   %eax,%eax
je     1132 <rd_wrt_jr+0x12>
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_rel@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rd_wrt_jr(i8** %0, i8 signext %1) {
%3 = tail call i32 @rd_byte(i8** %0, i8 signext %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @write_rel()
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ twoDsim_dumpWorld();
void dump_world(void) { twoDsim_dumpWorld(); }


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

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

LLVM IR (-O0):
define void @dump_world() {
%1 = call i32 (...) @twoDsim_dumpWorld()
ret void
}

LLVM IR (-O2):
define void @dump_world() {
%1 = tail call i32 (...) @twoDsim_dumpWorld()
ret void
}
const char *jac_chain_nm4_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<jac_chain_nm4_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <jac_chain_nm4_name_out+0x2b>
jmp    111a <jac_chain_nm4_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <jac_chain_nm4_name_out+0x3b>
jmp    114b <jac_chain_nm4_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm4_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <jac_chain_nm4_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm4_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @jac_chain_nm4_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("What you don't like bbb?\n");
  printf("define CCC to stop me before I print again!! \n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"What you don't like bbb?\0A\00"
@.str.1 = [47 x i8] c"define CCC to stop me before I print again!! \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"What you don't like bbb?\00"
@str.2 = [46 x i8] c"define CCC to stop me before I print again!! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void alloc_shared_posix(void **ptr, const char *handle, const size_t len) {
  int fd;
}


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

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

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

LLVM IR (-O2):
define void @alloc_shared_posix(i8** nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void skip_comments(char *line) {
  char *comment_start = strchr(line, '#');
  if (comment_start)
    *comment_start = '\0';
}


x86 assembly (clang, -O0):
<skip_comments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <skip_comments+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comments>:
push   %rax
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <skip_comments+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @skip_comments(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 35)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @skip_comments(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run();
int main(int argc, char *argv[]) {
  run();
  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 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <run@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 (...) @run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @run()
ret i32 0
}
char **get_environment(void) {
  extern char **environ;
  return environ;
}


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

x86 assembly (clang, -O2):
<get_environment>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@environ = external global i8**
define i8** @get_environment() {
%1 = load i8**, i8*** @environ
ret i8** %1
}

LLVM IR (-O2):
@environ = external global i8**
define i8** @get_environment() {
%1 = load i8**, i8*** @environ
ret i8** %1
}
/* Variables and functions */
int /*<<< orphan*/ do_test(int);
int main(int argc, char *argv[]) {
  do_test(0);
  do_test(8);
  do_test(10);
  do_test(16);
  do_test(36);
  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)
xor    %edi,%edi
call   1030 <do_test@plt>
mov    $0x8,%edi
call   1030 <do_test@plt>
mov    $0xa,%edi
call   1030 <do_test@plt>
mov    $0x10,%edi
call   1030 <do_test@plt>
mov    $0x24,%edi
call   1030 <do_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <do_test@plt>
mov    $0x8,%edi
call   1030 <do_test@plt>
mov    $0xa,%edi
call   1030 <do_test@plt>
mov    $0x10,%edi
call   1030 <do_test@plt>
mov    $0x24,%edi
call   1030 <do_test@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 @do_test(i32 0)
%7 = call i32 @do_test(i32 8)
%8 = call i32 @do_test(i32 10)
%9 = call i32 @do_test(i32 16)
%10 = call i32 @do_test(i32 36)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @do_test(i32 0)
%4 = tail call i32 @do_test(i32 8)
%5 = tail call i32 @do_test(i32 10)
%6 = tail call i32 @do_test(i32 16)
%7 = tail call i32 @do_test(i32 36)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_GetContrast(void *, int);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPRenderingControl_GetContrast(void *upnptoken,
                                      unsigned int InstanceID) {
  printf("Invoke: UPnPRenderingControl_GetContrast(%u);\r\n", InstanceID);
  UPnPResponse_RenderingControl_GetContrast(upnptoken, 250);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_GetContrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1030 <UPnPResponse_RenderingControl_GetContrast@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_GetContrast>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1030 <UPnPResponse_RenderingControl_GetContrast@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Invoke: UPnPRenderingControl_GetContrast(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetContrast(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_RenderingControl_GetContrast(i8* %7, i32 250)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"Invoke: UPnPRenderingControl_GetContrast(%u);\0D\0A\00"
define void @UPnPRenderingControl_GetContrast(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_RenderingControl_GetContrast(i8* %0, i32 250)
ret void
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf(gettext("Hello, world!"));
  printf("\n");
  return 0;
}


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    %rdx,-0x18(%rbp)
lea    0xebf(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <gettext@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i8* @gettext(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i8* @gettext(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glsv_test_sync_app_process(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc != 1) {
    printf("\nWrong Arguments USAGE: <lck_demo> \n");
    return 1;
  }
  glsv_test_sync_app_process(NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <main+0x48>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <glsv_test_sync_app_process@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    1131 <main+0x11>
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <glsv_test_sync_app_process@plt>
jmp    1142 <main+0x22>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0AWrong Arguments USAGE: <lck_demo> \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %12
10: ; preds = %2
%11 = call i32 @glsv_test_sync_app_process(i32* null)
store i32 0, i32* %3
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@str = [36 x i8] c"\0AWrong Arguments USAGE: <lck_demo> \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 @glsv_test_sync_app_process(i32* null)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %9
}
void g_type_from_name() {}


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

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

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

LLVM IR (-O2):
define void @g_type_from_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void reg_error(char *str) {
  fprintf(stderr, "NEdit: Internal error processing regular expression (%s)\n",
          str);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"NEdit: Internal error processing regular expression (%s)\0A\00"
define void @reg_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"NEdit: Internal error processing regular expression (%s)\0A\00"
define void @reg_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void glutInitWindowPosition(int a, int b) {}


x86 assembly (clang, -O0):
<glutInitWindowPosition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glutInitWindowPosition(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @glutInitWindowPosition(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int strlen(char *const);
void eatnewline(char *const s) {
  if (strlen(s) == 0)
    return;
  if (s[strlen(s) - 1] == '\n')
    s[strlen(s) - 1] = '\0';
}


x86 assembly (clang, -O0):
<eatnewline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    1133 <eatnewline+0x23>
jmp    117e <eatnewline+0x6e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    117e <eatnewline+0x6e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatnewline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     113d <eatnewline+0x2d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    113d <eatnewline+0x2d>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @eatnewline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = tail call i32 @strlen(i8* %0)
%13 = add nsw i32 %12, -1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %1, %11, %4
ret void
}
unsigned int no_comments(char *addr, unsigned int i) {
  while (addr[i] == '#') {
    i++;
    while (addr[i] != '\n')
      i++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<no_comments>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
jne    1158 <no_comments+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     114a <no_comments+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <no_comments+0x28>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <no_comments+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_comments>:
mov    %esi,%eax
cmpb   $0x23,(%rdi,%rax,1)
jne    1127 <no_comments+0x27>
nopl   0x0(%rax,%rax,1)
mov    %esi,%eax
lea    0x1(%rax),%esi
cmpb   $0xa,(%rdi,%rsi,1)
jne    1110 <no_comments+0x10>
add    $0x2,%eax
cmpb   $0x23,(%rdi,%rax,1)
mov    %eax,%esi
je     1110 <no_comments+0x10>
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @no_comments(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %27, %2
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 35
br i1 %12, label %13, label %30
13: ; preds = %5
%14 = load i32, i32* %4
%15 = add i32 %14, 1
store i32 %15, i32* %4
br label %16
16: ; preds = %24, %13
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 10
br i1 %23, label %24, label %27
24: ; preds = %16
%25 = load i32, i32* %4
%26 = add i32 %25, 1
store i32 %26, i32* %4
br label %16
27: ; preds = %16
%28 = load i32, i32* %4
%29 = add i32 %28, 1
store i32 %29, i32* %4
br label %5
30: ; preds = %5
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @no_comments(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 35
br i1 %6, label %7, label %22
7: ; preds = %2, %14
%8 = phi i32 [ %15, %14 ], [ %1, %2 ]
%9 = add i32 %8, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 10
br i1 %13, label %16, label %14
14: ; preds = %7, %16
%15 = phi i32 [ %9, %7 ], [ %17, %16 ]
br label %7
16: ; preds = %7
%17 = add i32 %8, 2
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 35
br i1 %21, label %14, label %22
22: ; preds = %16, %2
%23 = phi i32 [ %1, %2 ], [ %17, %16 ]
ret i32 %23
}
void foo(float *x, float value) {
  int i;
  for (i = 0; i < 32; ++i)
    x[i] = value;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jge    113e <foo+0x3e>
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <foo+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
shufps $0x0,%xmm0,%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x70(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(float* nocapture writeonly %0, float %1) {
%3 = insertelement <4 x float> poison, float %1, i64 0
%4 = shufflevector <4 x float> %3, <4 x float> poison, <4 x i32> zeroinitializer
%5 = bitcast float* %0 to <4 x float>*
store <4 x float> %4, <4 x float>* %5
%6 = getelementptr inbounds float, float* %0, i64 4
%7 = bitcast float* %6 to <4 x float>*
store <4 x float> %4, <4 x float>* %7
%8 = getelementptr inbounds float, float* %0, i64 8
%9 = bitcast float* %8 to <4 x float>*
store <4 x float> %4, <4 x float>* %9
%10 = getelementptr inbounds float, float* %0, i64 12
%11 = bitcast float* %10 to <4 x float>*
store <4 x float> %4, <4 x float>* %11
%12 = getelementptr inbounds float, float* %0, i64 16
%13 = bitcast float* %12 to <4 x float>*
store <4 x float> %4, <4 x float>* %13
%14 = getelementptr inbounds float, float* %0, i64 20
%15 = bitcast float* %14 to <4 x float>*
store <4 x float> %4, <4 x float>* %15
%16 = getelementptr inbounds float, float* %0, i64 24
%17 = bitcast float* %16 to <4 x float>*
store <4 x float> %4, <4 x float>* %17
%18 = getelementptr inbounds float, float* %0, i64 28
%19 = bitcast float* %18 to <4 x float>*
store <4 x float> %4, <4 x float>* %19
ret void
}
/* Variables and functions */
scalar_t__ kgetSecond();
int krandom(int max) { return (int)(kgetSecond()) % max; }


x86 assembly (clang, -O0):
<krandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <kgetSecond@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<krandom>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <kgetSecond@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @krandom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @kgetSecond()
%4 = trunc i64 %3 to i32
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @krandom(i32 %0) {
%2 = tail call i64 (...) @kgetSecond()
%3 = trunc i64 %2 to i32
%4 = srem i32 %3, %0
ret i32 %4
}
int topAr(int *list) {
  int i = 0;
  while (list[i] == 0)
    i++;
  if (i == 13)
    return (list[i - 1]);
  else
    return (list[i]);
}


x86 assembly (clang, -O0):
<topAr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    112f <topAr+0x2f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <topAr+0xf>
cmpl   $0xd,-0x14(%rbp)
jne    1151 <topAr+0x51>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <topAr+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<topAr>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi,%rcx,4),%eax
add    $0x1,%rcx
test   %eax,%eax
je     1110 <topAr+0x10>
cmp    $0xe,%ecx
jne    1123 <topAr+0x23>
mov    0x30(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @topAr(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp eq i32 %9, 13
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds i32, i32* %0, i64 12
%13 = load i32, i32* %12
br label %14
14: ; preds = %8, %11
%15 = phi i32 [ %13, %11 ], [ %5, %8 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_bit_false(int /*<<< orphan*/ volatile *,
                                 int /*<<< orphan*/);
void turn_off_led_anode(volatile uint8_t *buffer) { set_bit_false(buffer, 0); }


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

x86 assembly (clang, -O2):
<turn_off_led_anode>:
xor    %esi,%esi
jmp    1030 <set_bit_false@plt>

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

LLVM IR (-O2):
define void @turn_off_led_anode(i32* %0) {
%2 = tail call i32 @set_bit_false(i32* %0, i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t four_bytes(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
  int32_t result = 0;
  result |= (int32_t)((a << 24) | (b << 16) | (c << 8) | d);
  return result;
}


x86 assembly (clang, -O0):
<four_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<four_bytes>:
mov    %edx,%eax
shl    $0x18,%edi
shl    $0x10,%esi
or     %edi,%esi
shl    $0x8,%eax
or     %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @four_bytes(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = shl i32 %10, 24
%12 = load i32, i32* %6
%13 = shl i32 %12, 16
%14 = or i32 %11, %13
%15 = load i32, i32* %7
%16 = shl i32 %15, 8
%17 = or i32 %14, %16
%18 = load i32, i32* %8
%19 = or i32 %17, %18
%20 = load i32, i32* %9
%21 = or i32 %20, %19
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @four_bytes(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 24
%6 = shl i32 %1, 16
%7 = or i32 %6, %5
%8 = shl i32 %2, 8
%9 = or i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
void hlt(void) { __asm__ volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @hlt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int sde_rotator_inc_timeline(struct sde_rot_timeline *tl, int increment) {
  return 0;
}


x86 assembly (clang, -O0):
<sde_rotator_inc_timeline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.sde_rot_timeline = type opaque
define i32 @sde_rotator_inc_timeline(%struct.sde_rot_timeline* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mhandle_out_of_memory(char *);
void *realloc(void *, size_t);
void *__xrealloc(void *ptr, size_t size, char *at) {
  void *new_ptr;
  new_ptr = realloc(ptr, size);
  if (!new_ptr)
    mhandle_out_of_memory(at);
  return new_ptr;
}


x86 assembly (clang, -O0):
<__xrealloc>:
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
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <__xrealloc+0x39>
mov    -0x18(%rbp),%rdi
call   1030 <mhandle_out_of_memory@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <__xrealloc+0x1c>
mov    %r14,%rdi
call   1030 <mhandle_out_of_memory@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @__xrealloc(i8* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @mhandle_out_of_memory(i8* %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
void __asan_report_store4() {}


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

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

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

LLVM IR (-O2):
define void @__asan_report_store4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ unlink(char *);
void termination_handler(int signum) {
  syslog(LOG_NOTICE, "Exiting");
  unlink("/var/run/rhnsd.pid");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<termination_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <syslog@plt>
lea    0xeb1(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<termination_handler>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <syslog@plt>
lea    0xebb(%rip),%rdi
call   1030 <unlink@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [8 x i8] c"Exiting\00"
@.str.1 = [19 x i8] c"/var/run/rhnsd.pid\00"
@EXIT_SUCCESS = global i32 0
define void @termination_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_NOTICE
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @unlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [8 x i8] c"Exiting\00"
@.str.1 = [19 x i8] c"/var/run/rhnsd.pid\00"
@EXIT_SUCCESS = global i32 0
define void @termination_handler(i32 %0) {
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @unlink(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __byte_memset(void *, int, size_t);
void __byt_memset(void *__restrict s, int c, size_t n) {
  __byte_memset(s, c, n);
}


x86 assembly (clang, -O0):
<__byt_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <__byte_memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__byt_memset>:
jmp    1030 <__byte_memset@plt>

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

LLVM IR (-O2):
define void @__byt_memset(i8* noalias %0, i32 %1, i64 %2) {
%4 = tail call i32 @__byte_memset(i8* %0, i32 %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void displayHelloWorld() { printf("Hello World.\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello World.\00"
define void @displayHelloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void caldate_normalize(cd) struct caldate *cd;
{ caldate_frommjd(cd, caldate_mjd(cd), (int *)0, (int *)0); }


x86 assembly (clang, -O0):
<caldate_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <caldate_mjd@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
mov    $0x0,%al
call   1030 <caldate_frommjd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caldate_normalize>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <caldate_mjd@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <caldate_frommjd@plt>

LLVM IR (-O0):
%struct.caldate = type opaque
define void @caldate_normalize(%struct.caldate* %0) {
%2 = alloca %struct.caldate*
store %struct.caldate* %0, %struct.caldate** %2
%3 = load %struct.caldate*, %struct.caldate** %2
%4 = load %struct.caldate*, %struct.caldate** %2
%5 = call i32 (%struct.caldate*, ...) bitcast (i32 (...)* @caldate_mjd to i32 (%struct.caldate*, ...)*)(%struct.caldate* %4)
%6 = call i32 (%struct.caldate*, i32, i32*, i32*, ...) bitcast (i32 (...)* @caldate_frommjd to i32 (%struct.caldate*, i32, i32*, i32*, ...)*)(%struct.caldate* %3, i32 %5, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
%struct.caldate = type opaque
define void @caldate_normalize(%struct.caldate* %0) {
%2 = tail call i32 (%struct.caldate*, ...) bitcast (i32 (...)* @caldate_mjd to i32 (%struct.caldate*, ...)*)(%struct.caldate* %0)
%3 = tail call i32 (%struct.caldate*, i32, i32*, i32*, ...) bitcast (i32 (...)* @caldate_frommjd to i32 (%struct.caldate*, i32, i32*, i32*, ...)*)(%struct.caldate* %0, i32 %2, i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void test_break_while() {
  printf("\n===== test_break_while\n");
  int result = 1;
  while (result < 10) {
    ++result;
    if (result == 5)
      break;
  }
  assert(result == 5);
}


x86 assembly (clang, -O0):
<test_break_while>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1162 <test_break_while+0x42>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jne    115d <test_break_while+0x3d>
jmp    1162 <test_break_while+0x42>
jmp    113b <test_break_while+0x1b>
cmpl   $0x5,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"\0A===== test_break_while\0A\00"
define void @test_break_while() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 5
br i1 %10, label %11, label %12
11: ; preds = %6
br label %13
12: ; preds = %6
br label %3
13: ; preds = %11, %3
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 5
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"\0A===== test_break_while\00"
define void @test_break_while() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
ret void
}
int ether_ntohost(char *hostname, const struct ether_addr *e) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.ether_addr = type opaque
define i32 @ether_ntohost(i8* nocapture readnone %0, %struct.ether_addr* nocapture readnone %1) {
ret i32 -1
}