xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ cursor_invisible;
int /*<<< orphan*/ min_putp(scalar_t__);
int min_hidecur() {
  if (cursor_invisible) {
    min_putp(cursor_invisible);
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<min_hidecur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
cmpq   $0x0,(%rax)
je     1144 <min_hidecur+0x34>
mov    0x2eb0(%rip),%rax
mov    (%rax),%rdi
call   1030 <min_putp@plt>
movl   $0x0,-0x4(%rbp)
jmp    114b <min_hidecur+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_hidecur>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     1129 <min_hidecur+0x19>
call   1030 <min_putp@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@cursor_invisible = global i64 0
define i32 @min_hidecur() {
%1 = alloca i32
%2 = load i64, i64* @cursor_invisible
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i64, i64* @cursor_invisible
%6 = call i32 @min_putp(i64 %5)
store i32 0, i32* %1
br label %8
7: ; preds = %0
store i32 1, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@cursor_invisible = global i64 0
define i32 @min_hidecur() {
%1 = load i64, i64* @cursor_invisible
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @min_putp(i64 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %6
}
int indx(char *s, char c) {
  int i;
  for (i = 0; (s[i] != '\0') && (s[i] != c); ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<indx>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1147 <indx+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1157 <indx+0x57>
jmp    116a <indx+0x6a>
jmp    115c <indx+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <indx+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indx>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%eax
test   %cl,%cl
je     1123 <indx+0x23>
add    $0x1,%rdi
cmp    %sil,%cl
jne    1110 <indx+0x10>
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void mumble_userremove_callback(uint32_t session, int32_t actor, char *reason,
                                int32_t ban, void *user_data) {
  printf("User %d removed\n", actor);
}


x86 assembly (clang, -O0):
<mumble_userremove_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"User %d removed\0A\00"
define void @mumble_userremove_callback(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"User %d removed\0A\00"
define void @mumble_userremove_callback(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void barrier() { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @barrier() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @barrier() {
fence seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncasecmp(char const *, char const *, int /*<<< orphan*/);
bool strcasehasprefix(const char *str, const char *prefix) {
  return (strncasecmp(str, prefix, strlen(prefix)) == 0);
}


x86 assembly (clang, -O0):
<strcasehasprefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasehasprefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strcasehasprefix(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncasecmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @strcasehasprefix(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncasecmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int printUsage(char *execName) {
  printf("VGM OPL2->OPL4 converter"
         "Usage: %s file.vgm\n",
         execName);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"VGM OPL2->OPL4 converterUsage: %s file.vgm\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [44 x i8] c"VGM OPL2->OPL4 converterUsage: %s file.vgm\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_babble2() {
  printf("\nHow many sentences per paragraph do you want to write? ");
  return;
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"\0AHow many sentences per paragraph do you want to write? \00"
define void @msg_babble2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"\0AHow many sentences per paragraph do you want to write? \00"
define void @msg_babble2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strdup(char *);
char *rumStrdup(char *str) { return strdup(str); }


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

x86 assembly (clang, -O2):
<rumStrdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @rumStrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void ip_set_tos(uint8_t *p_ip, uint8_t tos) { p_ip[1] = tos; }


x86 assembly (clang, -O0):
<ip_set_tos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_set_tos>:
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @ip_set_tos(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @ip_set_tos(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void TransformWindowCoordinates(int mode, double coords[4]) {
  if (!CheckRunningInMainThread("TransformWindowCoordinates"))
    return;
}


x86 assembly (clang, -O0):
<TransformWindowCoordinates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1139 <TransformWindowCoordinates+0x29>
jmp    1139 <TransformWindowCoordinates+0x29>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"TransformWindowCoordinates\00"
define void @TransformWindowCoordinates(i32 %0, double* nocapture readnone %1) {
%3 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(char const *, int);
size_t str_last_index(const char *ptr, int val) {
  char *a;
  size_t index;
  a = strrchr(ptr, val);
  if (!a)
    return 0;
  index = (size_t)(a - ptr + 1);
  return index;
}


x86 assembly (clang, -O0):
<str_last_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1147 <str_last_index+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1162 <str_last_index+0x52>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_last_index>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strrchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
add    $0x1,%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @str_last_index(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 1, %6
%8 = add i64 %7, %5
%9 = select i1 %4, i64 0, i64 %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigintHandler(int sig_num) { exit(0); }


x86 assembly (clang, -O0):
<sigintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigintHandler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigintHandler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void mutex_signal(int semid, int sem_num) {
  struct sembuf op;
  op.sem_num = sem_num;
  op.sem_op = 1;
  op.sem_flg = 0;
  semop(semid, &op, 1);
}


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

x86 assembly (clang, -O2):
<mutex_signal>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
movl   $0x1,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define void @mutex_signal(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @mutex_signal(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
unsigned int system_atomics_decrement(volatile long *value_ptr) {
  unsigned int previous_value;
  { previous_value = __sync_fetch_and_sub(value_ptr, 1) - 1; }
  return previous_value;
}


x86 assembly (clang, -O0):
<system_atomics_decrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xffffffffffffffff,%rax
lock xadd %rax,(%rcx)
sub    $0x1,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<system_atomics_decrement>:
mov    $0xffffffffffffffff,%rax
lock xadd %rax,(%rdi)
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @system_atomics_decrement(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = atomicrmw sub i64* %4, i64 1 seq_cst
%6 = sub nsw i64 %5, 1
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @system_atomics_decrement(i64* nocapture %0) {
%2 = atomicrmw sub i64* %0, i64 1 seq_cst
%3 = trunc i64 %2 to i32
%4 = add i32 %3, -1
ret i32 %4
}
int test_imm_F3int64_lowword_reg(long long val) {
  return ((val) & (0xF3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F3int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 243
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test20(int test21(double)) {}


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

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

LLVM IR (-O0):
define void @test20(i32 (double)* %0) {
%2 = alloca i32 (double)*
store i32 (double)* %0, i32 (double)** %2
ret void
}

LLVM IR (-O2):
define void @test20(i32 (double)* nocapture %0) {
ret void
}
/* Variables and functions */
char *read_record(int, char *, int *, int);
char *QMRead(int fno, char *id, int *err) {
  return read_record(fno, id, err, 6);
}


x86 assembly (clang, -O0):
<QMRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x6,%ecx
call   1030 <read_record@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QMRead>:
mov    $0x6,%ecx
jmp    1030 <read_record@plt>

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

LLVM IR (-O2):
define i8* @QMRead(i32 %0, i8* %1, i32* %2) {
%4 = tail call i8* @read_record(i32 %0, i8* %1, i32* %2, i32 6)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ strtok_r(char *, char *, char **);
int main() {
  char *str = NULL, *delim = NULL, *saveptr = NULL;
  strtok_r(str, delim, &saveptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <strtok_r@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <strtok_r@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%3 = call i32 @strtok_r(i8* null, i8* null, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ o5_write();
int /*<<< orphan*/ write_char(int);
void wo5_end() {
  o5_write();
  write_char(0xfe);
}


x86 assembly (clang, -O0):
<wo5_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <o5_write@plt>
mov    $0xfe,%edi
call   1040 <write_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wo5_end>:
push   %rax
xor    %eax,%eax
call   1030 <o5_write@plt>
mov    $0xfe,%edi
pop    %rax
jmp    1040 <write_char@plt>

LLVM IR (-O0):
define void @wo5_end() {
%1 = call i32 (...) @o5_write()
%2 = call i32 @write_char(i32 254)
ret void
}

LLVM IR (-O2):
define void @wo5_end() {
%1 = tail call i32 (...) @o5_write()
%2 = tail call i32 @write_char(i32 254)
ret void
}
int swap(int *x, int *y) {
  int z;
  z = *x;
  *x = *y;
  *y = z;
  return 1;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ piece_delete_quote_comma(char *, char *, int);
char *piece_insert_quote_comma(char *, char *, char *, int);
char *piece_replace_quote_comma(char *destination, char *source, char *new_data,
                                int piece_offset) {
  char tmp[1024];
  char *results;
  piece_delete_quote_comma(tmp, source, piece_offset);
  *destination = '\0';
  results = piece_insert_quote_comma(destination, tmp, new_data, piece_offset);
  return results;
}


x86 assembly (clang, -O0):
<piece_replace_quote_comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <piece_delete_quote_comma@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <piece_insert_quote_comma@plt>
mov    %rax,-0x428(%rbp)
mov    -0x428(%rbp),%rax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_replace_quote_comma>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %ecx,%ebp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %ecx,%edx
call   1030 <piece_delete_quote_comma@plt>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1040 <piece_insert_quote_comma@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @piece_replace_quote_comma(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [1024 x i8]
%10 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%12 = load i8*, i8** %6
%13 = load i32, i32* %8
%14 = call i32 @piece_delete_quote_comma(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %5
store i8 0, i8* %15
%16 = load i8*, i8** %5
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i8* @piece_insert_quote_comma(i8* %16, i8* %17, i8* %18, i32 %19)
store i8* %20, i8** %10
%21 = load i8*, i8** %10
ret i8* %21
}

LLVM IR (-O2):
define i8* @piece_replace_quote_comma(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [1024 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = call i32 @piece_delete_quote_comma(i8* %6, i8* %1, i32 %3)
store i8 0, i8* %0
%8 = call i8* @piece_insert_quote_comma(i8* %0, i8* %6, i8* %2, i32 %3)
ret i8* %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long message_type;
};
typedef TYPE_1__ XClientMessageEvent;

/* Variables and functions */
void set_XClientMessageEvent_message_type(void *_p, unsigned long _v) {
  ((XClientMessageEvent *)_p)->message_type = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XClientMessageEvent_message_type>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XClientMessageEvent_message_type(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_40(int /*<<< orphan*/);
int gen_40(void) {
  handle_40(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_40>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_40@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_40() {
%1 = call i32 @handle_40(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_40() {
%1 = tail call i32 @handle_40(i32 0)
ret i32 0
}
long double TestLD(long double x) { return x * x; }


x86 assembly (clang, -O0):
<TestLD>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fmul   %st,%st(0)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestLD>:
fldt   0x8(%rsp)
fmul   %st,%st(0)
ret

LLVM IR (-O0):
define x86_fp80 @TestLD(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fmul x86_fp80 %3, %4
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @TestLD(x86_fp80 %0) {
%2 = fmul x86_fp80 %0, %0
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ GL_LESS;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glDepthFunc(int /*<<< orphan*/);
int /*<<< orphan*/ glDepthRange(double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void myinit(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glDepthFunc(GL_LESS);
  glEnable(GL_DEPTH_TEST);
  glShadeModel(GL_FLAT);
  glDepthRange(0.0, 1.0);
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1040 <glDepthFunc@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1060 <glShadeModel@plt>
xorps  %xmm0,%xmm0
movsd  0xe66(%rip),%xmm1
call   1070 <glDepthRange@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1040 <glDepthFunc@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1060 <glShadeModel@plt>
movsd  0xe6c(%rip),%xmm1
xorps  %xmm0,%xmm0
pop    %rax
jmp    1070 <glDepthRange@plt>

LLVM IR (-O0):
@GL_LESS = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_FLAT = global i32 0
define void @myinit() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_LESS
%3 = call i32 @glDepthFunc(i32 %2)
%4 = load i32, i32* @GL_DEPTH_TEST
%5 = call i32 @glEnable(i32 %4)
%6 = load i32, i32* @GL_FLAT
%7 = call i32 @glShadeModel(i32 %6)
%8 = call i32 @glDepthRange(double 0.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_LESS = global i32 0
@GL_DEPTH_TEST = global i32 0
@GL_FLAT = global i32 0
define void @myinit() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_LESS
%3 = tail call i32 @glDepthFunc(i32 %2)
%4 = load i32, i32* @GL_DEPTH_TEST
%5 = tail call i32 @glEnable(i32 %4)
%6 = load i32, i32* @GL_FLAT
%7 = tail call i32 @glShadeModel(i32 %6)
%8 = tail call i32 @glDepthRange(double 0.000000e+00, double 1.000000e+00)
ret void
}
int foo(int n) {
  int baz(int);
  return baz(n);
}


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <baz@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @baz(i32 %0)
ret i32 %2
}
unsigned xrop3_187_0_1(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;
  stk2 = ~S;
  stk1 = D | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_187_0_1>:
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    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_187_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %eax
mov    %eax,%edx
or     $0xff,%edx
not    %ecx
and    %edx,%ecx
and    %esi,%eax
or     %edi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_187_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -1
%8 = or i32 %7, 255
%9 = xor i32 %6, -1
%10 = and i32 %8, %9
%11 = and i32 %7, %5
%12 = or i32 %11, %3
%13 = or i32 %12, %10
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void get_lit_icf_code(uint32_t lit, uint32_t *code) {
  assert(lit <= 256);
  *code = lit;
}


x86 assembly (clang, -O0):
<get_lit_icf_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x100,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lit_icf_code>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x101,%ebp
setl   %dil
call   1030 <assert@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @get_lit_icf_code(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 256
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @get_lit_icf_code(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 257
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
store i32 %0, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void arg_error() {
  fprintf(stderr,
          "Options: [-display DISPLAY] [-delay N] [-maxtry N | -wait] [-v]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<arg_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<arg_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Options: [-display DISPLAY] [-delay N] [-maxtry N | -wait] [-v]\0A\00"
define void @arg_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Options: [-display DISPLAY] [-delay N] [-maxtry N | -wait] [-v]\0A\00"
define void @arg_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
char *strcbrk(char *str, char c) {
  char *p;
  for (p = str; *p && *p != c; p++)
    ;
  return p;
}


x86 assembly (clang, -O0):
<strcbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113e <strcbrk+0x3e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114e <strcbrk+0x4e>
jmp    1164 <strcbrk+0x64>
jmp    1153 <strcbrk+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <strcbrk+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcbrk>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <strcbrk+0x21>
cmp    %sil,%cl
jne    1110 <strcbrk+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcbrk(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %4
}
int test_imm_7Bint64_highword_reg(long long val) {
  return ((val >> 32) & (0x7B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Bint64_highword_reg>:
movabs $0x7b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Bint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 123
%6 = icmp ne i64 %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_7Bint64_highword_reg(i64 %0) {
%2 = and i64 %0, 528280977408
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int *pd_log_glevel() {
  static int glevel = 2;
  return &glevel;
}


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

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

LLVM IR (-O0):
@pd_log_glevel.glevel = internal global i32 2
define i32* @pd_log_glevel() {
ret i32* @pd_log_glevel.glevel
}

LLVM IR (-O2):
@pd_log_glevel.glevel = internal global i32 2
define i32* @pd_log_glevel() {
ret i32* @pd_log_glevel.glevel
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitMenu(void) {
  printf("Have a nice day!\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Have a nice day!\0A\00"
define void @exitMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [17 x i8] c"Have a nice day!\00"
define void @exitMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ hot_sys_Panic(char *);
void *malloc(int);
void *pt_malloc(int size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    hot_sys_Panic("Out of memory, exiting");
  return ptr;
}


x86 assembly (clang, -O0):
<pt_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <pt_malloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <hot_sys_Panic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <pt_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <hot_sys_Panic@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Out of memory, exiting\00"
define i8* @pt_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @hot_sys_Panic(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"Out of memory, exiting\00"
define noalias i8* @pt_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @hot_sys_Panic(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int strlen(const unsigned char *str) {
  const unsigned char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
struct mini {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mini *);
void mn_free(struct mini *fsa) { free(fsa); }


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

x86 assembly (clang, -O2):
<mn_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.mini = type { i32 }
define void @mn_free(%struct.mini* nocapture %0) {
%2 = tail call i32 @free(%struct.mini* %0)
ret void
}
/* Variables and functions */
int INISaveString(char const *, char const *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
int INISaveUInt(const char *file, const char *section, const char *keyword,
                unsigned int value) {
  char numvalue[255 + 1];
  sprintf(numvalue, "%u", value);
  return (INISaveString(file, section, keyword, numvalue));
}


x86 assembly (clang, -O0):
<INISaveUInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x120(%rbp),%rcx
call   1030 <INISaveString@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INISaveUInt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec2(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %ecx,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1030 <INISaveString@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @INISaveUInt(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %8
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = call i32 @INISaveString(i8* %13, i8* %14, i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @INISaveUInt(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = call i32 @INISaveString(i8* %0, i8* %1, i8* %2, i8* %6)
ret i32 %8
}