xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "Usage: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\n"
                  "       i2cdetect -F I2CBUS\n"
                  "       i2cdetect -l\n"
                  "  I2CBUS is an integer or an I2C bus name\n"
                  "  If provided, FIRST and LAST limit the probing range.\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [200 x i8] c"Usage: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\0A i2cdetect -F I2CBUS\0A i2cdetect -l\0A I2CBUS is an integer or an I2C bus name\0A If provided, FIRST and LAST limit the probing range.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [200 x i8] c"Usage: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\0A i2cdetect -F I2CBUS\0A i2cdetect -l\0A I2CBUS is an integer or an I2C bus name\0A If provided, FIRST and LAST limit the probing range.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo536() {}


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

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

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

LLVM IR (-O2):
define void @foo536() {
ret void
}
int libreiserfs_version() { return 1; }


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

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

LLVM IR (-O0):
define i32 @libreiserfs_version() {
ret i32 1
}

LLVM IR (-O2):
define i32 @libreiserfs_version() {
ret i32 1
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(size_t count, size_t size) {
  void *buf;
  buf = calloc(count, size);
  if (buf == NULL) {
    fprintf(stderr, "It is not enough memory\n");
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <xcalloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"It is not enough memory\0A\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ setsoundt2();
int /*<<< orphan*/ stopint8();
int /*<<< orphan*/ timer2(int);
void s0killsound(void) {
  setsoundt2();
  timer2(40);
  stopint8();
}


x86 assembly (clang, -O0):
<s0killsound>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <setsoundt2@plt>
mov    $0x28,%edi
call   1030 <timer2@plt>
mov    $0x0,%al
call   1050 <stopint8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<s0killsound>:
push   %rax
xor    %eax,%eax
call   1040 <setsoundt2@plt>
mov    $0x28,%edi
call   1030 <timer2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <stopint8@plt>

LLVM IR (-O0):
define void @s0killsound() {
%1 = call i32 (...) @setsoundt2()
%2 = call i32 @timer2(i32 40)
%3 = call i32 (...) @stopint8()
ret void
}

LLVM IR (-O2):
define void @s0killsound() {
%1 = tail call i32 (...) @setsoundt2()
%2 = tail call i32 @timer2(i32 40)
%3 = tail call i32 (...) @stopint8()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fibnacci(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world\n");
  fibnacci(10);
  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 <printf@plt>
mov    $0xa,%edi
call   1040 <fibnacci@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>
mov    $0xa,%edi
call   1040 <fibnacci@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fibnacci(i32 10)
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @fibnacci(i32 10)
ret i32 0
}
int string_empty(const char *string) { return !string || !string[0]; }


x86 assembly (clang, -O0):
<string_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1127 <string_empty+0x27>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_empty>:
test   %rdi,%rdi
je     110e <string_empty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @string_empty(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 %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ true, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @string_empty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
int num_lextypes(void) { return 25; }


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

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

LLVM IR (-O0):
define i32 @num_lextypes() {
ret i32 25
}

LLVM IR (-O2):
define i32 @num_lextypes() {
ret i32 25
}
void EC_KEY_new(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_new() {
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
int fp_hasprefix(const char *path, const char *prefix) {
  return strlen(path) >= strlen(prefix) &&
         memcmp(path, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<fp_hasprefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x11(%rbp)
jl     118e <fp_hasprefix+0x6e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_hasprefix>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rbx
jl     115b <fp_hasprefix+0x3b>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @fp_hasprefix(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 = call i64 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = icmp sge i64 %6, %8
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = call i64 @memcmp(i8* %11, i8* %12, i64 %14)
%16 = icmp eq i64 %15, 0
br label %17
17: ; preds = %10, %2
%18 = phi i1 [ false, %2 ], [ %16, %10 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @fp_hasprefix(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp slt i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @memcmp(i8* %0, i8* %1, i64 %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
void rop3_74_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | *D;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_74_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_74_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
and    %dl,%cl
xor    %al,%cl
xor    %cl,%al
and    %sil,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_74_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = and i8 %5, %2
%7 = xor i8 %6, %4
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %4, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ psignal(int, char *);
void sighandler(int sig) { psignal(sig, "sig caught"); }


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <psignal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
lea    0xee9(%rip),%rsi
jmp    1030 <psignal@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"sig caught\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @psignal(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"sig caught\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @psignal(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DeleteTempFolder();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ system(char *);
void PauseExit(void) {
  putchar('\n');
  system("pause");
  DeleteTempFolder();
  exit(1);
}


x86 assembly (clang, -O0):
<PauseExit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeab(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <DeleteTempFolder@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<PauseExit>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeae(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
call   1040 <DeleteTempFolder@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define void @PauseExit() {
%1 = call i32 @putchar(i8 signext 10)
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @DeleteTempFolder()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define void @PauseExit() {
%1 = tail call i32 @putchar(i8 signext 10)
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @DeleteTempFolder()
%4 = tail call i32 @exit(i32 1)
unreachable
}
int qsort_cmp_short(const void *x, const void *y) {
  if (*((short *)x) < *((short *)y))
    return (-1);
  else
    return (*((short *)x) > *((short *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
mov    -0x18(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jge    112e <qsort_cmp_short+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <qsort_cmp_short+0x49>
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
mov    -0x18(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_short>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%ax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qsort_cmp_short(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i16*
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i16*
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
%14 = icmp slt i32 %9, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %27
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i16*
%19 = load i16, i16* %18
%20 = sext i16 %19 to i32
%21 = load i8*, i8** %5
%22 = bitcast i8* %21 to i16*
%23 = load i16, i16* %22
%24 = sext i16 %23 to i32
%25 = icmp sgt i32 %20, %24
%26 = zext i1 %25 to i32
store i32 %26, i32* %3
br label %27
27: ; preds = %16, %15
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @qsort_cmp_short(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp slt i16 %4, %6
%8 = icmp sgt i16 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void bound_uint32(uint32_t *number, uint32_t max, uint32_t min) {
  if (*number > max)
    *number = max;
  else if (*number < min)
    *number = min;
}


x86 assembly (clang, -O0):
<bound_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jle    1131 <bound_uint32+0x31>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1152 <bound_uint32+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jge    114d <bound_uint32+0x4d>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1152 <bound_uint32+0x52>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound_uint32>:
mov    (%rdi),%rax
cmp    %rsi,%rax
jg     1110 <bound_uint32+0x10>
mov    %rdx,%rsi
cmp    %rdx,%rax
jge    1113 <bound_uint32+0x13>
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @bound_uint32(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = load i64, i64* %5
%10 = icmp sgt i64 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i64, i64* %5
%13 = load i64*, i64** %4
store i64 %12, i64* %13
br label %23
14: ; preds = %3
%15 = load i64*, i64** %4
%16 = load i64, i64* %15
%17 = load i64, i64* %6
%18 = icmp slt i64 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i64, i64* %6
%21 = load i64*, i64** %4
store i64 %20, i64* %21
br label %22
22: ; preds = %19, %14
br label %23
23: ; preds = %22, %11
ret void
}

LLVM IR (-O2):
define void @bound_uint32(i64* nocapture %0, i64 %1, i64 %2) {
%4 = load i64, i64* %0
%5 = icmp sgt i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = icmp slt i64 %4, %2
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi i64 [ %1, %3 ], [ %2, %6 ]
store i64 %9, i64* %0
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int CHAR_BIT;
void set_bit(int nr, void *addr) {
  unsigned long mask = (1UL << ((nr) % (sizeof(long) * CHAR_BIT)));
  unsigned long *p =
      ((unsigned long *)addr) + ((nr) / (sizeof(long) * CHAR_BIT));
  *p |= mask;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
mov    0x2eca(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movslq -0x4(%rbp),%rax
mov    0x2e9c(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
movslq %edi,%rax
mov    0x2ed6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1127 <set_bit+0x27>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rcx
jmp    112f <set_bit+0x2f>
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
or     %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define void @set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = urem i64 %8, %11
%13 = shl i64 1, %12
store i64 %13, i64* %5
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i64*
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = load i32, i32* @CHAR_BIT
%19 = sext i32 %18 to i64
%20 = mul i64 8, %19
%21 = udiv i64 %17, %20
%22 = getelementptr inbounds i64, i64* %15, i64 %21
store i64* %22, i64** %6
%23 = load i64, i64* %5
%24 = load i64*, i64** %6
%25 = load i64, i64* %24
%26 = or i64 %25, %23
store i64 %26, i64* %24
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define void @set_bit(i32 %0, i8* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = load i32, i32* @CHAR_BIT
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 3
%7 = urem i64 %3, %6
%8 = shl nuw i64 1, %7
%9 = bitcast i8* %1 to i64*
%10 = udiv i64 %3, %6
%11 = getelementptr inbounds i64, i64* %9, i64 %10
%12 = load i64, i64* %11
%13 = or i64 %12, %8
store i64 %13, i64* %11
ret void
}
/* Variables and functions */
char b_mod(char *, char *);
signed char intr_wrap_383(signed char p1, signed char p2) {
  return b_mod(&p1, &p2);
}


x86 assembly (clang, -O0):
<intr_wrap_383>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
call   1030 <b_mod@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_383>:
push   %rax
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1030 <b_mod@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_383(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @b_mod(i8* %3, i8* %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @intr_wrap_383(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @b_mod(i8* %3, i8* %4)
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void ctry_abort_default() { abort(); }


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

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

LLVM IR (-O0):
define void @ctry_abort_default() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @ctry_abort_default() {
%1 = tail call i32 (...) @abort()
unreachable
}
void __console_tx_string(char *str) {}


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

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

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

LLVM IR (-O2):
define void @__console_tx_string(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int ft_strlen(char *);
int ft_starting_size(char *tetrimino) {
  int x;
  int area;
  int square;
  x = 0;
  square = 0;
  area = ((ft_strlen(tetrimino) + 1) / 21) * 4;
  while ((x++ * square++) < area)
    ;
  return (x - 1);
}


x86 assembly (clang, -O0):
<ft_starting_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_strlen@plt>
add    $0x1,%eax
mov    $0x15,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
imul   %ecx,%eax
cmp    -0x10(%rbp),%eax
jge    116b <ft_starting_size+0x5b>
jmp    1144 <ft_starting_size+0x34>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_starting_size>:
push   %rax
call   1030 <ft_strlen@plt>
add    $0x1,%eax
cltq
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x22,%rcx
add    %eax,%ecx
shl    $0x2,%ecx
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %eax,%edx
imul   %eax,%edx
cmp    %ecx,%edx
jl     1140 <ft_starting_size+0x30>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ft_starting_size(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sdiv i32 %3, 21
%5 = shl nsw i32 %4, 2
br label %6
6: ; preds = %6, %1
%7 = phi i32 [ 0, %1 ], [ %8, %6 ]
%8 = add nuw nsw i32 %7, 1
%9 = mul nsw i32 %7, %7
%10 = icmp slt i32 %9, %5
br i1 %10, label %6, label %11
11: ; preds = %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_CMPEQDP(int s1, int s2, int dst) {
  C67_asm("CMPEQDP.S1", s1, s2, dst);
}


x86 assembly (clang, -O0):
<C67_CMPEQDP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_CMPEQDP>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMPEQDP.S1\00"
define void @C67_CMPEQDP(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @C67_asm(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMPEQDP.S1\00"
define void @C67_CMPEQDP(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @C67_asm(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
int test_imm_B6uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xB6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B6uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11927552
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void Imprimindo_Valores_Array(int *Ptr, int Dim) {
  int i = 0;
  for (; i < Dim; i++)
    printf("\n [%d] = %d ", i, *(Ptr + i));
}


x86 assembly (clang, -O0):
<Imprimindo_Valores_Array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <Imprimindo_Valores_Array+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Imprimindo_Valores_Array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Imprimindo_Valores_Array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <Imprimindo_Valores_Array+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <Imprimindo_Valores_Array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"\0A [%d] = %d \00"
define void @Imprimindo_Valores_Array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
int ___ip_switch(int ip) {
  int ip_switch;
  char *p1 = (char *)&ip;
  char *p2 = (char *)&ip_switch;
  p2[0] = p1[3];
  p2[1] = p1[2];
  p2[2] = p1[1];
  p2[3] = p1[0];
  return ip_switch;
}


x86 assembly (clang, -O0):
<___ip_switch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<___ip_switch>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @___ip_switch(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %2
%6 = bitcast i32* %2 to i8*
store i8* %6, i8** %4
%7 = bitcast i32* %3 to i8*
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 3
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = load i8*, i8** %5
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @___ip_switch(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef double uint64_t;

/* Variables and functions */
double oz_seconds(uint64_t t) { return t / 1000000.0; }


x86 assembly (clang, -O0):
<oz_seconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<oz_seconds>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @oz_seconds(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @oz_seconds(double %0) {
%2 = fdiv double %0, 1.000000e+06
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ ffi_dlclose(int /*<<< orphan*/);
int /*<<< orphan*/ untag_dll(int /*<<< orphan*/);
void primitive_dlclose(void) { ffi_dlclose(untag_dll(dpop())); }


x86 assembly (clang, -O0):
<primitive_dlclose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_dll@plt>
mov    %eax,%edi
call   1030 <ffi_dlclose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_dlclose>:
push   %rax
xor    %eax,%eax
call   1040 <dpop@plt>
mov    %eax,%edi
call   1050 <untag_dll@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ffi_dlclose@plt>

LLVM IR (-O0):
define void @primitive_dlclose() {
%1 = call i32 (...) @dpop()
%2 = call i32 @untag_dll(i32 %1)
%3 = call i32 @ffi_dlclose(i32 %2)
ret void
}

LLVM IR (-O2):
define void @primitive_dlclose() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @untag_dll(i32 %1)
%3 = tail call i32 @ffi_dlclose(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_unpackhi_epi8(__m128i A, __m128i B) {
  return _mm_unpackhi_epi8(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_unpackhi_epi8>:
jmp    1030 <_mm_unpackhi_epi8@plt>

LLVM IR (-O0):
define i32 @test_mm_unpackhi_epi8(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 = load i32, i32* %4
%7 = call i32 @_mm_unpackhi_epi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_unpackhi_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpackhi_epi8(i32 %0, i32 %1)
ret i32 %3
}
int my_strlen(const char *s) {
  const char *p = s;
  while (*s)
    s++;
  return s - p;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <my_strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @my_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
}
/* Variables and functions */
int /*<<< orphan*/ DesMem(void *, int, int);
void DesWriteBlock(void *buf, int size) { DesMem(buf, size & 0xFFFFFFF0, 1); }


x86 assembly (clang, -O0):
<DesWriteBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xfffffff0,%esi
mov    $0x1,%edx
call   1030 <DesMem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DesWriteBlock>:
and    $0xfffffff0,%esi
mov    $0x1,%edx
jmp    1030 <DesMem@plt>

LLVM IR (-O0):
define void @DesWriteBlock(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, -16
%8 = call i32 @DesMem(i8* %5, i32 %7, i32 1)
ret void
}

LLVM IR (-O2):
define void @DesWriteBlock(i8* %0, i32 %1) {
%3 = and i32 %1, -16
%4 = tail call i32 @DesMem(i8* %0, i32 %3, i32 1)
ret void
}
int dec2bcd(int v) { return (v % 10) + 16 * (v / 10); }


x86 assembly (clang, -O0):
<dec2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x4,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec2bcd>:
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
shl    $0x4,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dec2bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
%7 = mul nsw i32 16, %6
%8 = add nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @dec2bcd(i32 %0) {
%2 = srem i32 %0, 10
%3 = sdiv i32 %0, 10
%4 = shl nsw i32 %3, 4
%5 = add nsw i32 %4, %2
ret i32 %5
}
int test_imm_2Bint64_midword_reg(long long val) {
  return ((val >> 16) & (0x2B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Bint64_midword_reg>:
test   $0x2b0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Bint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 43
%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_2Bint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2818048
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
int test_case(int expected, const char *test, int result) {
  if (result != expected) {
    fprintf(stderr, "# FATAL: %s != %d\n", test, expected);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1156 <test_case+0x46>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%ecx
lea    0xebb(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    115d <test_case+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case>:
mov    $0x1,%eax
cmp    %edi,%edx
je     113d <test_case+0x2d>
push   %rax
mov    %rsi,%r8
mov    %edi,%ecx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
mov    %r8,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"# FATAL: %s != %d\0A\00"
define i32 @test_case(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
store i32 0, i32* %4
br label %17
16: ; preds = %3
store i32 1, i32* %4
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"# FATAL: %s != %d\0A\00"
define i32 @test_case(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, %0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ 0, %5 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int rand();
int get_randint(int min, int max) { return min + rand() % (max - min + 1); }


x86 assembly (clang, -O0):
<get_randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_randint(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void quit_command(void) { printf("quit_command\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"quit_command\00"
define void @quit_command() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zc_error(char *, char const *);
void yyerror(const char *message) { zc_error("%s", message); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <zc_error@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @zc_error(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void f_int(int b) { f_int(0); }


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

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

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

LLVM IR (-O2):
define void @f_int(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void __attribute__((stdcall)) mismatched_stdcall(int x) {}


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

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

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

LLVM IR (-O2):
define void @mismatched_stdcall(i32 %0) {
ret void
}
/* Variables and functions */
int syscall(int, char const *);
int chdir(const char *path) { return syscall(12, path); }


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

x86 assembly (clang, -O2):
<chdir>:
mov    %rdi,%rsi
mov    $0xc,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @chdir(i8* %0) {
%2 = tail call i32 @syscall(i32 12, i8* %0)
ret i32 %2
}