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

/* Variables and functions */
__attribute__((always_)) int32_t cvtInt32FromZigZag(const uint32_t value) {
  return (int32_t)((value >> 1) ^ (~(value & 1) + 1));
}


x86 assembly (clang, -O0):
<cvtInt32FromZigZag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvtInt32FromZigZag>:
mov    %edi,%eax
sar    %eax
and    $0x1,%edi
neg    %edi
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cvtInt32FromZigZag(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %0, 1
%4 = sub nsw i32 0, %3
%5 = xor i32 %2, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char const *);
void println(const char *chars) {
  print(chars);
  print("\n\r");
}


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

x86 assembly (clang, -O2):
<println>:
push   %rax
call   1030 <print@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0A\0D\00"
define void @println(i8* %0) {
%2 = tail call i32 @print(i8* %0)
%3 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int socket(int, int, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int Socket(int domain, int type, int protocol) {
  int s = socket(domain, type, protocol);
  if (s == -1) {
    syslog(LOG_ERR, "socket: %s", strerror(errno));
  }
  return s;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1187 <Socket+0x57>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe7e(%rip),%rsi
call   1030 <syslog@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbp
push   %rbx
push   %rax
call   1050 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1166 <Socket+0x36>
mov    0x2e8a(%rip),%rax
mov    (%rax),%ebp
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xea3(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
call   1030 <syslog@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [11 x i8] c"socket: %s\00"
@errno = global i32 0
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32, i32* @LOG_ERR
%16 = load i32, i32* @errno
%17 = call i32 @strerror(i32 %16)
%18 = call i32 @syslog(i32 %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %14, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [11 x i8] c"socket: %s\00"
@errno = global i32 0
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @LOG_ERR
%8 = load i32, i32* @errno
%9 = tail call i32 @strerror(i32 %8)
%10 = tail call i32 @syslog(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int omp_get_thread_num();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int shared_variable = 35;
  int private_variable = 60;
  omp_set_num_threads(4);
#pragma omp parallel
  {
    int thread_id = omp_get_thread_num();
    private_variable = private_variable + thread_id;
    printf("Hi i'm thread %d, my private_variable value is %d, the "
           "shared_variable value is %d\n",
           thread_id, private_variable, shared_variable);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x23,-0x8(%rbp)
movl   $0x3c,-0xc(%rbp)
mov    $0x4,%edi
call   1050 <omp_set_num_threads@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1050 <omp_set_num_threads@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0x3c(%rax),%edx
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
mov    $0x23,%ecx
call   1040 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [84 x i8] c"Hi i'm thread %d, my private_variable value is %d, the shared_variable value is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 35, i32* %2
store i32 60, i32* %3
%5 = call i32 @omp_set_num_threads(i32 4)
%6 = call i32 (...) @omp_get_thread_num()
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@.str = [84 x i8] c"Hi i'm thread %d, my private_variable value is %d, the shared_variable value is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @omp_set_num_threads(i32 4)
%2 = tail call i32 (...) @omp_get_thread_num()
%3 = add nsw i32 %2, 60
%4 = tail call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 35)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int vsnprintf(char *, int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vsprintf(char *str, const char *fmt, va_list args) {
  return vsnprintf(str, INT_MAX, fmt, args);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @INT_MAX
%5 = tail call i32 @vsnprintf(i8* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}
unsigned char *llib_led_edit_next_group(unsigned char *group) {
  while (*group && *group != '=' && *group != ':')
    ++group;
  if (*group == '=')
    ++group;
  return group;
}


x86 assembly (clang, -O0):
<llib_led_edit_next_group>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <llib_led_edit_next_group+0x42>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x9(%rbp)
je     1142 <llib_led_edit_next_group+0x42>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x3a,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <llib_led_edit_next_group+0x52>
jmp    1163 <llib_led_edit_next_group+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <llib_led_edit_next_group+0x8>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x3d,%eax
jne    117f <llib_led_edit_next_group+0x7f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llib_led_edit_next_group>:
mov    %rdi,%rax
movabs $0x2400000000000001,%rcx
jmp    1114 <llib_led_edit_next_group+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x3d,%rdx
ja     1110 <llib_led_edit_next_group+0x10>
bt     %rdx,%rcx
jae    1110 <llib_led_edit_next_group+0x10>
xor    %ecx,%ecx
cmp    $0x3d,%dl
sete   %cl
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @llib_led_edit_next_group(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 61, label %7
i8 58, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
%8 = icmp eq i8 %4, 61
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %3, i64 %9
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ bufout;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ vsnprintf(char *, int, char *, int /*<<< orphan*/);
void socket_send_message(FILE *stream, char *format, va_list args) {
  char bufout[512];
  vsnprintf(bufout, sizeof(bufout), format, args);
  fprintf(stream, "%s\r\n", bufout);
  ;
}


x86 assembly (clang, -O0):
<socket_send_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x200,%esi
call   1030 <vsnprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x220(%rbp),%rdx
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_send_message>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x200,%esi
call   1030 <vsnprintf@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @socket_send_message(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [512 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i8* %8, i32 512, i8* %9, i32 %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%14 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @socket_send_message(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @vsnprintf(i8* %5, i32 512, i8* %1, i32 %2)
%7 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_escaped(char *, int);
int /*<<< orphan*/ printf(char *);
void print_category(char *category) {
  if (category != NULL) {
    printf("\t\t<category term=\"");
    print_escaped(category, true);
    printf("\"></category>\n");
  }
}


x86 assembly (clang, -O0):
<print_category>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115d <print_category+0x3d>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <print_escaped@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_category>:
test   %rdi,%rdi
je     115f <print_category+0x2f>
push   %rbx
mov    %rdi,%rbx
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <print_escaped@plt>
lea    0xeba(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\09\09<category term=\22\00"
@.str.1 = [15 x i8] c"\22></category>\0A\00"
define void @print_category(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @print_escaped(i8* %7, i32 1)
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\09\09<category term=\22\00"
@str = [14 x i8] c"\22></category>\00"
define void @print_category(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @print_escaped(i8* %0, i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %3, %1
ret void
}
const char *bar2_short() { return "abcdef"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"abcdef\00"
define i8* @bar2_short() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
unsigned long hash(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = (*str++)))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
main() {
  int i;
  if (i > 2)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    111a <main+0x1a>
jmp    111a <main+0x1a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *my_tempnam(char const *, char const *);
char *os_tempnam(char const *dir, char const *pfx) {
  return my_tempnam(dir, pfx);
}


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

x86 assembly (clang, -O2):
<os_tempnam>:
jmp    1030 <my_tempnam@plt>

LLVM IR (-O0):
define i8* @os_tempnam(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @my_tempnam(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @os_tempnam(i8* %0, i8* %1) {
%3 = tail call i8* @my_tempnam(i8* %0, i8* %1)
ret i8* %3
}
void dtls_hmac_storage_init() {}


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

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

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

LLVM IR (-O2):
define void @dtls_hmac_storage_init() {
ret void
}
void scsi_bus_log(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @scsi_bus_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello World! \b");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello World! \08\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello World! \08\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int returnValue(char *v) {
  int val = atoi(v);
  if (val == 0 && v[0] == '*')
    return -1;
  return val;
}


x86 assembly (clang, -O0):
<returnValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114e <returnValue+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    114e <returnValue+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <returnValue+0x44>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnValue>:
push   %rbx
mov    %rdi,%rbx
call   1030 <atoi@plt>
test   %eax,%eax
jne    1127 <returnValue+0x17>
mov    $0xffffffff,%ecx
cmpb   $0x2a,(%rbx)
je     1129 <returnValue+0x19>
mov    %eax,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @returnValue(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 42
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ %2, %7 ], [ -1, %4 ]
ret i32 %9
}
void gtk_toolbar_set_show_arrow() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_set_show_arrow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Func0();
int main() {
  Func0();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Func0()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Func0()
ret i32 0
}
/* Variables and functions */
char const *strong_l1();
const char *sibcall_strong_l1(void) { return strong_l1(); }


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

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

LLVM IR (-O0):
define i8* @sibcall_strong_l1() {
%1 = call i8* (...) @strong_l1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_strong_l1() {
%1 = tail call i8* (...) @strong_l1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ con_printf(char *, int, char const *);
void print_received_msg(int from, const char *msg) {
  con_printf("(MSG from %d): %s\n", from, msg);
}


x86 assembly (clang, -O0):
<print_received_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <con_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_received_msg>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <con_printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"(MSG from %d): %s\0A\00"
define void @print_received_msg(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @con_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"(MSG from %d): %s\0A\00"
define void @print_received_msg(i32 %0, i8* %1) {
%3 = tail call i32 @con_printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t const);
int /*<<< orphan*/ stderr;
void *xmalloc(const size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "out of memory\n");
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <xmalloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
double log(int);
double double2db(double value) {
  if (value < 0)
    value = -value;
  return 6.0 * log(value / 32767) / log(2);
}


x86 assembly (clang, -O0):
<double2db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114c <double2db+0x3c>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double2db>:
push   %rax
movapd 0xee7(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
divsd  0xed2(%rip),%xmm3
cvttsd2si %xmm3,%edi
call   1030 <log@plt>
mulsd  0xec9(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @double2db(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = fdiv double %9, 3.276700e+04
%11 = fptosi double %10 to i32
%12 = call double @log(i32 %11)
%13 = fmul double 6.000000e+00, %12
%14 = call double @log(i32 2)
%15 = fdiv double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @double2db(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fdiv double %4, 3.276700e+04
%6 = fptosi double %5 to i32
%7 = tail call double @log(i32 %6)
%8 = fmul double %7, 6.000000e+00
%9 = tail call double @log(i32 2)
%10 = fdiv double %8, %9
ret double %10
}
void g_option_group_set_error_hook() {}


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

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

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

LLVM IR (-O2):
define void @g_option_group_set_error_hook() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *fake_aligned_alloc(size_t alignment, size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<fake_aligned_alloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @fake_aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @fake_aligned_alloc(i64 %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
void ARGBToUVJRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToUVJRow_Any_NEON() {
ret void
}
int checkMmxAvailablity() {
  int mmxAvailable = 0;
  int kniAvailable = 0;
  int nRetMask = 0;
  if (mmxAvailable)
    nRetMask |= (1 << 0);
  if (kniAvailable)
    nRetMask |= (1 << 1);
  return nRetMask;
}


x86 assembly (clang, -O0):
<checkMmxAvailablity>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112c <checkMmxAvailablity+0x2c>
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <checkMmxAvailablity+0x3f>
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @checkMmxAvailablity() {
ret i32 0
}
int test_imm_3Fuint32_mem(unsigned int *val) {
  return ((*val) & (0x3F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Fuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 63
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
sthello() {}


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

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

LLVM IR (-O0):
define i32 @sthello() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @sthello() {
ret i32 undef
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int read_dobldobl_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(233, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_dobldobl_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xe9,%edi
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):
<read_dobldobl_start_system>:
mov    $0xe9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @read_dobldobl_start_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 233, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void ebur128_get_version(int *major, int *minor, int *patch) {
  *major = 1;
  *minor = 2;
  *patch = 0;
}


x86 assembly (clang, -O0):
<ebur128_get_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebur128_get_version>:
movl   $0x1,(%rdi)
movl   $0x2,(%rsi)
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @ebur128_get_version(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** %4
store i32 1, i32* %7
%8 = load i32*, i32** %5
store i32 2, i32* %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @ebur128_get_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 1, i32* %0
store i32 2, i32* %1
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int main(int argc, char **argv) {
  initscr();
  return 1;
}


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 <initscr@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int y = 20;
  fun(y);
  printf("%d", y);
  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   $0x14,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <fun@plt>
mov    -0x14(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <fun@plt>
lea    0xece(%rip),%rdi
mov    $0x14,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fun(i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int tcsetattr(int filedes, int optional_actions,
              const struct termios *termios_p) {
  (void)filedes;
  (void)optional_actions;
  (void)termios_p;
  puts("tcgetattr: not implemented");
  return -1;
}


x86 assembly (clang, -O0):
<tcsetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.termios = type { i32 }
@.str = [27 x i8] c"tcgetattr: not implemented\00"
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.termios*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.termios* %2, %struct.termios** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.termios*, %struct.termios** %6
%10 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@.str = [27 x i8] c"tcgetattr: not implemented\00"
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef void pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_MUTEX_RECURSIVE;
void *calloc(int, int);
int /*<<< orphan*/ pthread_mutex_init(void *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_settype(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
void *kl_pthread_mutex_new(void *data) {
  pthread_mutex_t *Mutex = calloc(1, sizeof(pthread_mutex_t));
  ;
  pthread_mutexattr_t Attr;
  pthread_mutexattr_init(&Attr);
  pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_RECURSIVE);
  pthread_mutex_init(Mutex, &Attr);
  return Mutex;
}


x86 assembly (clang, -O0):
<kl_pthread_mutex_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <pthread_mutexattr_init@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <pthread_mutex_init@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kl_pthread_mutex_new>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <pthread_mutexattr_init@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <pthread_mutex_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define i8* @kl_pthread_mutex_new(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i8* @calloc(i32 1, i32 1)
store i8* %5, i8** %3
%6 = call i32 @pthread_mutexattr_init(i32* %4)
%7 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
%8 = call i32 @pthread_mutexattr_settype(i32* %4, i32 %7)
%9 = load i8*, i8** %3
%10 = call i32 @pthread_mutex_init(i8* %9, i32* %4)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@PTHREAD_MUTEX_RECURSIVE = global i32 0
define i8* @kl_pthread_mutex_new(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = tail call dereferenceable_or_null(1) i8* @calloc(i32 1, i32 1)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @pthread_mutexattr_init(i32* %2)
%6 = load i32, i32* @PTHREAD_MUTEX_RECURSIVE
%7 = call i32 @pthread_mutexattr_settype(i32* %2, i32 %6)
%8 = call i32 @pthread_mutex_init(i8* %3, i32* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationSettingsBank3Handle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void StabilizationSettingsBank3RequestUpdate() {
  UAVObjRequestUpdate(StabilizationSettingsBank3Handle());
}


x86 assembly (clang, -O0):
<StabilizationSettingsBank3RequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <StabilizationSettingsBank3Handle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationSettingsBank3RequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <StabilizationSettingsBank3Handle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @StabilizationSettingsBank3RequestUpdate() {
%1 = call i32 (...) @StabilizationSettingsBank3Handle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationSettingsBank3RequestUpdate() {
%1 = tail call i32 (...) @StabilizationSettingsBank3Handle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ has_kbd_backlight();
int /*<<< orphan*/ kbd_auto_cleanup();
void kbd_backlight_cleanup(void) {
  if (has_kbd_backlight())
    kbd_auto_cleanup();
}


x86 assembly (clang, -O0):
<kbd_backlight_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <has_kbd_backlight@plt>
cmp    $0x0,%rax
je     113c <kbd_backlight_cleanup+0x1c>
mov    $0x0,%al
call   1040 <kbd_auto_cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kbd_backlight_cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <has_kbd_backlight@plt>
test   %rax,%rax
je     1135 <kbd_backlight_cleanup+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <kbd_auto_cleanup@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @kbd_backlight_cleanup() {
%1 = call i64 (...) @has_kbd_backlight()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @kbd_auto_cleanup()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @kbd_backlight_cleanup() {
%1 = tail call i64 (...) @has_kbd_backlight()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @kbd_auto_cleanup()
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct undostack {
  int dummy;
};

/* Variables and functions */
scalar_t__ pushmem(struct undostack *, int, int);
scalar_t__ uputcmd(struct undostack *, int, int, char);
int move_to_undo(struct undostack *u, int start, int lump) {
  return pushmem(u, start, lump) && uputcmd(u, lump, start, 'M');
}


x86 assembly (clang, -O0):
<move_to_undo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <pushmem@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1171 <move_to_undo+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x4d,%ecx
call   1040 <uputcmd@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_to_undo>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <pushmem@plt>
test   %rax,%rax
je     1155 <move_to_undo+0x35>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x4d,%ecx
call   1040 <uputcmd@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1157 <move_to_undo+0x37>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.undostack = type { i32 }
define i32 @move_to_undo(%struct.undostack* %0, i32 %1, i32 %2) {
%4 = alloca %struct.undostack*
%5 = alloca i32
%6 = alloca i32
store %struct.undostack* %0, %struct.undostack** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.undostack*, %struct.undostack** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @pushmem(%struct.undostack* %7, i32 %8, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load %struct.undostack*, %struct.undostack** %4
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = call i64 @uputcmd(%struct.undostack* %13, i32 %14, i32 %15, i8 signext 77)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %12, %3
%19 = phi i1 [ false, %3 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
%struct.undostack = type { i32 }
define i32 @move_to_undo(%struct.undostack* %0, i32 %1, i32 %2) {
%4 = tail call i64 @pushmem(%struct.undostack* %0, i32 %1, i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @uputcmd(%struct.undostack* %0, i32 %2, i32 %1, i8 signext 77)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}