xunge/DecIR huggingface dataset:
unsigned long hash_krm(const char *chave, int tamanho) {
  unsigned long result = 7;
  char *iter = (char *)chave;
  while (*iter) {
    result += *iter;
    ++iter;
  }
  return result % tamanho;
}


x86 assembly (clang, -O0):
<hash_krm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x7,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <hash_krm+0x49>
mov    -0x20(%rbp),%rax
movsbq (%rax),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111b <hash_krm+0x1b>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_krm>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hash_krm+0x24>
add    $0x1,%rdi
mov    $0x7,%eax
nop
movsbq %cl,%rcx
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_krm+0x10>
jmp    1129 <hash_krm+0x29>
mov    $0x7,%eax
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1141 <hash_krm+0x41>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_krm(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ %0, %2 ]
%8 = phi i64 [ %10, %5 ], [ 7, %2 ]
%9 = sext i8 %6 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i64 [ 7, %2 ], [ %10, %5 ]
%16 = sext i32 %1 to i64
%17 = urem i64 %15, %16
ret i64 %17
}
int fun368() { return 368; }


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

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

LLVM IR (-O0):
define i32 @fun368() {
ret i32 368
}

LLVM IR (-O2):
define i32 @fun368() {
ret i32 368
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern int shmem_num_pes(void) { printf("\nOpenSHMEM Analyzer\n"); }


x86 assembly (clang, -O0):
<shmem_num_pes>:
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):
<shmem_num_pes>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i32 @shmem_num_pes() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]...\n\nOptions:\n    -h, --help\t\tdisplay this "
         "help\n    -V, --version\tdisplay version information\n\nReport bugs "
         "to <bulliver@gmail.com>\n",
         "");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0xf77(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"Usage: %s [OPTION]...\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [150 x i8] c"Usage: %s [OPTION]...\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ process_request(int, struct sockaddr_in);
void listen_loop(int sockfd) {
  struct sockaddr_in in_sa;
  int conn, len;
  while (1) {
    conn = accept(sockfd, (struct sockaddr *)&in_sa, &len);
    process_request(conn, in_sa);
  }
}


x86 assembly (clang, -O0):
<listen_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <process_request@plt>
jmp    112b <listen_loop+0xb>

x86 assembly (clang, -O2):
<listen_loop>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%r14
lea    0xc(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <accept@plt>
mov    0x8(%rsp),%esi
mov    %eax,%edi
call   1030 <process_request@plt>
jmp    1140 <listen_loop+0x20>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define void @listen_loop(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
br label %6
6: ; preds = %1, %6
%7 = load i32, i32* %2
%8 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%9 = call i32 @accept(i32 %7, %struct.sockaddr* %8, i32* %5)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @process_request(i32 %10, i32 %12)
br label %6
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define void @listen_loop(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
br label %8
8: ; preds = %8, %1
%9 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%10 = load i32, i32* %7
%11 = call i32 @process_request(i32 %9, i32 %10)
br label %8
}
int n2(int a, int b, int c) { return b >> c; }


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

x86 assembly (clang, -O2):
<n2>:
mov    %edx,%ecx
mov    %esi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @n2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = ashr i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @n2(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, %2
ret i32 %4
}
/* Type definitions */
struct ic_token {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ic_token *);
int /*<<< orphan*/ puts(char *);
unsigned int ic_token_destroy(struct ic_token *token, unsigned int free_token) {
  if (!token) {
    puts("ic_token_destroy: token was null");
    return 0;
  }
  if (free_token) {
    free(token);
  }
  return 1;
}


x86 assembly (clang, -O0):
<ic_token_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <ic_token_destroy+0x32>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <ic_token_destroy+0x4c>
cmpl   $0x0,-0x14(%rbp)
je     1165 <ic_token_destroy+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_token_destroy>:
push   %rbx
test   %rdi,%rdi
je     1136 <ic_token_destroy+0x16>
mov    $0x1,%ebx
test   %esi,%esi
je     1144 <ic_token_destroy+0x24>
call   1030 <free@plt>
jmp    1144 <ic_token_destroy+0x24>
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ic_token = type { i32 }
@.str = [33 x i8] c"ic_token_destroy: token was null\00"
define i32 @ic_token_destroy(%struct.ic_token* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.ic_token*
%5 = alloca i32
store %struct.ic_token* %0, %struct.ic_token** %4
store i32 %1, i32* %5
%6 = load %struct.ic_token*, %struct.ic_token** %4
%7 = icmp ne %struct.ic_token* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load %struct.ic_token*, %struct.ic_token** %4
%15 = call i32 @free(%struct.ic_token* %14)
br label %16
16: ; preds = %13, %10
store i32 1, i32* %3
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.ic_token = type { i32 }
@.str = [33 x i8] c"ic_token_destroy: token was null\00"
define i32 @ic_token_destroy(%struct.ic_token* %0, i32 %1) {
%3 = icmp eq %struct.ic_token* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @free(%struct.ic_token* %0)
br label %10
10: ; preds = %6, %8, %4
%11 = phi i32 [ 0, %4 ], [ 1, %8 ], [ 1, %6 ]
ret i32 %11
}
int c018(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c018() {
ret i32 0
}
void ff_hevc_put_hevc_uni_qpel_hv12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv12_12_sse4() {
ret void
}
void kputs(const char *s) {
  char *vRAM = (char *)0xB8000;
  while (*s != 0) {
    *vRAM++ = *s++;
    *vRAM++ = 0x0F;
  }
}


x86 assembly (clang, -O0):
<kputs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <kputs+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0xf,(%rax)
jmp    1111 <kputs+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kputs>:
mov    (%rdi),%al
test   %al,%al
je     112c <kputs+0x2c>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,0xb8000(%rcx,%rcx,1)
movb   $0xf,0xb8001(%rcx,%rcx,1)
0f
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <kputs+0x10>
ret

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

LLVM IR (-O2):
define void @kputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ inttoptr (i64 753664 to i8*), %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %5, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 2
store i8 15, i8* %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
int isLeapYearXTREME(int year) {
  return (year % 4 == 0) && ((year % 400 == 0) || (year % 100 != 0));
}


x86 assembly (clang, -O0):
<isLeapYearXTREME>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <isLeapYearXTREME+0x53>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
je     114d <isLeapYearXTREME+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYearXTREME>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isLeapYearXTREME+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     1130 <isLeapYearXTREME+0x30>
ror    $0x2,%ecx
xor    %eax,%eax
cmp    $0x28f5c29,%ecx
setae  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isLeapYearXTREME(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = srem i32 %0, 100
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int __htonl(int);
uint64_t __htonq(uint64_t v) {
  return ((uint64_t)__htonl(v) << 32) | __htonl(v >> 32);
}


x86 assembly (clang, -O0):
<__htonq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__htonl@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <__htonl@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__htonq>:
push   %rax
call   1030 <__htonl@plt>
pop    %rax
jmp    1030 <__htonl@plt>

LLVM IR (-O0):
define i32 @__htonq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__htonl(i32 %3)
%5 = shl i32 %4, 32
%6 = load i32, i32* %2
%7 = ashr i32 %6, 32
%8 = call i32 @__htonl(i32 %7)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__htonq(i32 %0) {
%2 = tail call i32 @__htonl(i32 %0)
%3 = tail call i32 @__htonl(i32 poison)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(size_t *, char *, int);
size_t vec_mem(void const *v) {
  size_t ret;
  memcpy(&ret, (char *)v - sizeof ret * 2, sizeof ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<vec_mem>:
push   %rax
lea    -0x10(%rdi),%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @vec_mem(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -16
%6 = call i32 @memcpy(i64* %3, i8* %5, i32 8)
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @vec_mem(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 -16
%5 = call i32 @memcpy(i64* %2, i8* %4, i32 8)
%6 = load i64, i64* %2
ret i64 %6
}
/* Variables and functions */
double GetSatVapPres(double);
double GetSatHumRatio(double TDryBulb, double Pressure) {
  double SatVaporPres, SatHumRatio;
  SatVaporPres = GetSatVapPres(TDryBulb);
  SatHumRatio = 0.621945 * SatVaporPres / (Pressure - SatVaporPres);
  return (((SatHumRatio) > (1e-7)) ? (SatHumRatio) : (1e-7));
}


x86 assembly (clang, -O0):
<GetSatHumRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <GetSatVapPres@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xecf(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1177 <GetSatHumRatio+0x67>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1189 <GetSatHumRatio+0x79>
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1189 <GetSatHumRatio+0x79>
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetSatHumRatio>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <GetSatVapPres@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xed4(%rip),%xmm0
divsd  %xmm1,%xmm0
maxsd  0xed0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @GetSatHumRatio(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = call double @GetSatVapPres(double %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = fmul double 0x3FE3E6F9335D249E, %9
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fsub double %11, %12
%14 = fdiv double %10, %13
store double %14, double* %6
%15 = load double, double* %6
%16 = fcmp ogt double %15, 0x3E7AD7F29ABCAF48
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = load double, double* %6
br label %20
19: ; preds = %2
br label %20
20: ; preds = %19, %17
%21 = phi double [ %18, %17 ], [ 0x3E7AD7F29ABCAF48, %19 ]
ret double %21
}

LLVM IR (-O2):
define double @GetSatHumRatio(double %0, double %1) {
%3 = tail call double @GetSatVapPres(double %0)
%4 = fmul double %3, 0x3FE3E6F9335D249E
%5 = fsub double %1, %3
%6 = fdiv double %4, %5
%7 = fcmp ogt double %6, 0x3E7AD7F29ABCAF48
%8 = select i1 %7, double %6, double 0x3E7AD7F29ABCAF48
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr,
          "usage: %s"
          "[-f] file\n",
          __progname);
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s[-f] file\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s[-f] file\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char byteClip(int v) {
  v = (v < 0) ? 0 : v;
  v = (v > 255) ? 255 : v;
  return v;
}


x86 assembly (clang, -O0):
<byteClip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <byteClip+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <byteClip+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1141 <byteClip+0x41>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <byteClip+0x47>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteClip>:
xor    %ecx,%ecx
test   %edi,%edi
cmovns %edi,%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @byteClip(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 0, %5 ], [ %7, %6 ]
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 255
br i1 %11, label %12, label %13
12: ; preds = %8
br label %15
13: ; preds = %8
%14 = load i32, i32* %2
br label %15
15: ; preds = %13, %12
%16 = phi i32 [ 255, %12 ], [ %14, %13 ]
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @byteClip(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = icmp ult i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ PR16705a();
int /*<<< orphan*/ PR16705b();
int /*<<< orphan*/ PR16705c();
void PR16705f(int a) {
  switch (a) {
  case 1:
#pragma weak PR16705a
    PR16705a();
  default:
#pragma weak PR16705b
    PR16705b();
  }
label:
#pragma weak PR16705c
  PR16705c();
}


x86 assembly (clang, -O0):
<PR16705f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    1153 <PR16705f+0x23>
jmp    114c <PR16705f+0x1c>
mov    $0x0,%al
call   1050 <PR16705a@plt>
mov    $0x0,%al
call   1030 <PR16705b@plt>
jmp    115f <PR16705f+0x2f>
mov    $0x0,%al
call   1040 <PR16705c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR16705f>:
push   %rax
cmp    $0x1,%edi
jne    113d <PR16705f+0xd>
xor    %eax,%eax
call   1050 <PR16705a@plt>
xor    %eax,%eax
call   1030 <PR16705b@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <PR16705c@plt>

LLVM IR (-O0):
define void @PR16705f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 1, label %4
]
4: ; preds = %1
%5 = call i32 (...) @PR16705a()
br label %6
6: ; preds = %1, %4
%7 = call i32 (...) @PR16705b()
br label %8
8: ; preds = %6
br label %9
9: ; preds = %8
%10 = call i32 (...) @PR16705c()
ret void
}

LLVM IR (-O2):
define void @PR16705f(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @PR16705a()
br label %5
5: ; preds = %1, %3
%6 = tail call i32 (...) @PR16705b()
%7 = tail call i32 (...) @PR16705c()
ret void
}
char *on_or_off(int boolean) {
  if (boolean)
    return "on";
  else
    return "off";
}


x86 assembly (clang, -O0):
<on_or_off>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <on_or_off+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <on_or_off+0x2c>
lea    0xedb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_or_off>:
test   %edi,%edi
lea    0xefa(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"off\00"
define i8* @on_or_off(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ func5(int, int);
int main() {
  int z = 32;
  int y = 44;
  const char *foo1 = "Test";
  func5(3, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0x2c,-0xc(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <func5@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <func5@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func5(i32 3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, int, int);
void t1(void) { f1(1, 2, 3); }


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <f1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <f1@plt>

LLVM IR (-O0):
define void @t1() {
%1 = call i32 @f1(i32 1, i32 2, i32 3)
ret void
}

LLVM IR (-O2):
define void @t1() {
%1 = tail call i32 @f1(i32 1, i32 2, i32 3)
ret void
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct mutex {
  int dummy;
};

/* Variables and functions */
struct task_struct *__mutex_owner(struct mutex *);
struct task_struct *__ww_mutex_owner(struct mutex *lock) {
  return __mutex_owner(lock);
}


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

x86 assembly (clang, -O2):
<__ww_mutex_owner>:
jmp    1030 <__mutex_owner@plt>

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

LLVM IR (-O2):
%struct.task_struct = type { i32 }
%struct.mutex = type { i32 }
define %struct.task_struct* @__ww_mutex_owner(%struct.mutex* %0) {
%2 = tail call %struct.task_struct* @__mutex_owner(%struct.mutex* %0)
ret %struct.task_struct* %2
}
/* Variables and functions */
int /*<<< orphan*/ SMARTCARD1_DriverIRQHandler();
__attribute__((weak)) void SMARTCARD1_IRQHandler(void) {
  SMARTCARD1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @SMARTCARD1_IRQHandler() {
%1 = call i32 (...) @SMARTCARD1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SMARTCARD1_IRQHandler() {
%1 = tail call i32 (...) @SMARTCARD1_DriverIRQHandler()
ret void
}
int stmnand_examine_bbts(struct mtd_info *mtd, int bch_remap) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mtd_info = type opaque
define i32 @stmnand_examine_bbts(%struct.mtd_info* nocapture readnone %0, i32 %1) {
ret i32 0
}
void pathconN_nm2_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm2_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello ajit");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"hello ajit\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"hello ajit\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, int);
void func3() {
  int i = 11, j = 999;
  printf("\t\t\t[in func3] i @ %p = %d\n", (void *)&i, i);
  printf("\t\t\t[in func3] j @ %p = %d\n", (void *)&j, j);
}


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xb,-0x4(%rbp)
movl   $0x3e7,-0x8(%rbp)
lea    -0x4(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3>:
push   %rax
movl   $0xb,0x4(%rsp)
movl   $0x3e7,(%rsp)
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    $0xb,%edx
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    %rsp,%rsi
mov    $0x3e7,%edx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\09\09\09[in func3] i @ %p = %d\0A\00"
@.str.1 = [27 x i8] c"\09\09\09[in func3] j @ %p = %d\0A\00"
define void @func3() {
%1 = alloca i32
%2 = alloca i32
store i32 11, i32* %1
store i32 999, i32* %2
%3 = bitcast i32* %1 to i8*
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
%6 = bitcast i32* %2 to i8*
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\09\09\09[in func3] i @ %p = %d\0A\00"
@.str.1 = [27 x i8] c"\09\09\09[in func3] j @ %p = %d\0A\00"
define void @func3() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 11, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 999, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3, i32 11)
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 999)
ret void
}
void pac7311_stop0(struct usb_spca50x *spca50x) {}


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

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

LLVM IR (-O0):
%struct.usb_spca50x = type opaque
define void @pac7311_stop0(%struct.usb_spca50x* %0) {
%2 = alloca %struct.usb_spca50x*
store %struct.usb_spca50x* %0, %struct.usb_spca50x** %2
ret void
}

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @pac7311_stop0(%struct.usb_spca50x* nocapture %0) {
ret void
}
int test_imm_B2int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xB2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B2int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 764504178688
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ font_set;
};
typedef TYPE_1__ XwcTextItem;

/* Variables and functions */
void *get_XwcTextItem_font_set(void *_p) {
  return (void *)((XwcTextItem *)_p)->font_set;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XwcTextItem_font_set(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void test_bcopy(void) {}


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

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

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

LLVM IR (-O2):
define void @test_bcopy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; i++)
    printf(argv[i]);
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1152 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGE_SIZE;
size_t sysconf(int /*<<< orphan*/);
size_t page_align(size_t size) {
  size_t page_size = sysconf(_SC_PAGE_SIZE);
  return (size + page_size - 1) & ~(page_size - 1);
}


x86 assembly (clang, -O0):
<page_align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_align>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
lea    (%rbx,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
neg    %rax
and    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGE_SIZE = global i32 0
define i64 @page_align(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i32, i32* @_SC_PAGE_SIZE
%5 = call i64 @sysconf(i32 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = add i64 %6, %7
%9 = sub i64 %8, 1
%10 = load i64, i64* %3
%11 = sub i64 %10, 1
%12 = xor i64 %11, -1
%13 = and i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
@_SC_PAGE_SIZE = global i32 0
define i64 @page_align(i64 %0) {
%2 = load i32, i32* @_SC_PAGE_SIZE
%3 = tail call i64 @sysconf(i32 %2)
%4 = add i64 %0, -1
%5 = add i64 %4, %3
%6 = sub i64 0, %3
%7 = and i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ fail_test(int);
scalar_t__ run(char *);
void test_union() {
  do {
    if (run("test/progs/"
            "union_basic.b"))
      fail_test(110);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "union_types_err.b"))
      fail_test(111);
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<test_union>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_union+0x9>
lea    0xed0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1149 <test_union+0x29>
mov    $0x6e,%edi
call   1030 <fail_test@plt>
jmp    114e <test_union+0x2e>
jmp    1153 <test_union+0x33>
lea    0xebf(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1173 <test_union+0x53>
mov    $0x6f,%edi
call   1030 <fail_test@plt>
jmp    1178 <test_union+0x58>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_union>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     113c <test_union+0x1c>
mov    $0x6e,%edi
call   1030 <fail_test@plt>
lea    0xed6(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     114f <test_union+0x2f>
pop    %rax
ret
mov    $0x6f,%edi
pop    %rax
jmp    1030 <fail_test@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"test/progs/union_basic.b\00"
@.str.1 = [29 x i8] c"test/progs/union_types_err.b\00"
define void @test_union() {
br label %1
1: ; preds = %0
%2 = call i64 @run(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @fail_test(i32 110)
br label %6
6: ; preds = %4, %1
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = call i64 @run(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @fail_test(i32 111)
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"test/progs/union_basic.b\00"
@.str.1 = [29 x i8] c"test/progs/union_types_err.b\00"
define void @test_union() {
%1 = tail call i64 @run(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fail_test(i32 110)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @run(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @fail_test(i32 111)
br label %10
10: ; preds = %5, %8
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int initialize_quaddobl_sampler(int dim) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(662, &dim, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_quaddobl_sampler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x296,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_quaddobl_sampler>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x296,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @initialize_quaddobl_sampler(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 662, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @initialize_quaddobl_sampler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 662, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ en_CA_islower(int);
int en_CA_toupper(int c) {
  { return en_CA_islower(c) ? (c - 'a' + 'A') : c; }
}


x86 assembly (clang, -O0):
<en_CA_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <en_CA_islower@plt>
cmp    $0x0,%rax
je     113e <en_CA_toupper+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <en_CA_toupper+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<en_CA_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <en_CA_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @en_CA_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @en_CA_islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 97
%9 = add nsw i32 %8, 65
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @en_CA_toupper(i32 %0) {
%2 = tail call i64 @en_CA_islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
unsigned xrop3_104_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = D | S;
  stk4 = ~stk4;
  stk3 = T | stk4;
  stk2 = S ^ stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_104_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_104_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
xor    $0xffffff00,%eax
or     %edx,%eax
xor    %ecx,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_104_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %11
%28 = xor i32 %27, -1
store i32 %28, i32* %11
%29 = load i32, i32* %7
%30 = load i32, i32* %11
%31 = or i32 %29, %30
store i32 %31, i32* %10
%32 = load i32, i32* %6
%33 = load i32, i32* %10
%34 = xor i32 %32, %33
store i32 %34, i32* %9
%35 = load i32, i32* %5
%36 = load i32, i32* %9
%37 = xor i32 %35, %36
store i32 %37, i32* %8
%38 = load i32, i32* %8
%39 = xor i32 %38, -1
store i32 %39, i32* %8
%40 = load i32, i32* %8
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_104_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = xor i32 %4, -256
%9 = or i32 %7, %8
%10 = xor i32 %5, %9
%11 = xor i32 %10, -256
ret i32 %11
}