xunge/DecIR huggingface dataset:
/* Type definitions */
struct test {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ t_assert_msg(struct test *, int /*<<< orphan*/,
                                char const *);
void t_fail(struct test *t, const char *msg) { t_assert_msg(t, 0, msg); }


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

x86 assembly (clang, -O2):
<t_fail>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <t_assert_msg@plt>

LLVM IR (-O0):
%struct.test = type { i32 }
define void @t_fail(%struct.test* %0, i8* %1) {
%3 = alloca %struct.test*
%4 = alloca i8*
store %struct.test* %0, %struct.test** %3
store i8* %1, i8** %4
%5 = load %struct.test*, %struct.test** %3
%6 = load i8*, i8** %4
%7 = call i32 @t_assert_msg(%struct.test* %5, i32 0, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.test = type { i32 }
define void @t_fail(%struct.test* %0, i8* %1) {
%3 = tail call i32 @t_assert_msg(%struct.test* %0, i32 0, i8* %1)
ret void
}
/* Variables and functions */
int date_get_day();
int is_day_of_sun(void) { return date_get_day() % 2 == 0; }


x86 assembly (clang, -O0):
<is_day_of_sun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <date_get_day@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_day_of_sun>:
push   %rax
xor    %eax,%eax
call   1030 <date_get_day@plt>
not    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_day_of_sun() {
%1 = call i32 (...) @date_get_day()
%2 = srem i32 %1, 2
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_day_of_sun() {
%1 = tail call i32 (...) @date_get_day()
%2 = and i32 %1, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void resx_help(void) {
  fputs("usage: unrez resx [<options>] <file>\n"
        "Extract resources from a file's resource fork.\n",
        stdout);
}


x86 assembly (clang, -O0):
<resx_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resx_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [85 x i8] c"usage: unrez resx [<options>] <file>\0AExtract resources from a file's resource fork.\0A\00"
@stdout = global i32 0
define void @resx_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [85 x i8] c"usage: unrez resx [<options>] <file>\0AExtract resources from a file's resource fork.\0A\00"
@stdout = global i32 0
define void @resx_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int i3(int *base) { return base[-00000001]; }


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

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

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

LLVM IR (-O2):
define i32 @i3(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: 2048c [OPTION] [VALUE]\n");
  printf("\t-h\t\tDisplay this usage list\n");
  printf("\t-c [x] [y]\tCreate a custom game of x by y\n");
  printf("\t[N/A]\t\tStart a default game of 4 by 4\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: 2048c [OPTION] [VALUE]\0A\00"
@.str.1 = [30 x i8] c"\09-h\09\09Display this usage list\0A\00"
@.str.2 = [44 x i8] c"\09-c [x] [y]\09Create a custom game of x by y\0A\00"
@.str.3 = [40 x i8] c"\09[N/A]\09\09Start a default game of 4 by 4\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Usage: 2048c [OPTION] [VALUE]\00"
@str.4 = [29 x i8] c"\09-h\09\09Display this usage list\00"
@str.5 = [43 x i8] c"\09-c [x] [y]\09Create a custom game of x by y\00"
@str.6 = [39 x i8] c"\09[N/A]\09\09Start a default game of 4 by 4\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *str_trim_left(char *str) {
  while (isspace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<str_trim_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <str_trim_left+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_trim_left+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_trim_left>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <str_trim_left+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @str_trim_left(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @str_trim_left(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
dhcp_server() {}


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

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

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

LLVM IR (-O2):
define i32 @dhcp_server() {
ret i32 undef
}
void InterruptHandler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @InterruptHandler(i32 %0) {
ret void
}
int test_imm_68uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x68 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_68uint64_highword_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, 32
%6 = and i64 %5, 104
%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_68uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 446676598784
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int cb_dev_sched_default() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cb_dev_sched_default() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char const *const,
                           char const *const);
void usage(FILE *fp, const char *const name) {
  const char *const ufmt = "Usage: %s [OPTION]... COMMAND\n"
                           "OPTION:\n"
                           "\t--help     display this message\n"
                           "\t--start    start the service\n"
                           "\t--stop     stop the service\n";
  fprintf(fp, ufmt, name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [131 x i8] c"Usage: %s [OPTION]... COMMAND\0AOPTION:\0A\09--help display this message\0A\09--start start the service\0A\09--stop stop the service\0A\00"
define void @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i32*, i32** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i32 0, i32 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [131 x i8] c"Usage: %s [OPTION]... COMMAND\0AOPTION:\0A\09--help display this message\0A\09--start start the service\0A\09--stop stop the service\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int _strlen(char *s) {
  int i = 0;
  while (s[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <_strlen+0xf>
mov    -0xc(%rbp),%eax
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 i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

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

/* Variables and functions */
int /*<<< orphan*/ _increase_write_index(struct ac_buffer *, int);
void buffer_increase_write_index(struct ac_buffer *buffer, int size) {
  _increase_write_index(buffer, size);
}


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

x86 assembly (clang, -O2):
<buffer_increase_write_index>:
jmp    1030 <_increase_write_index@plt>

LLVM IR (-O0):
%struct.ac_buffer = type { i32 }
define void @buffer_increase_write_index(%struct.ac_buffer* %0, i32 %1) {
%3 = alloca %struct.ac_buffer*
%4 = alloca i32
store %struct.ac_buffer* %0, %struct.ac_buffer** %3
store i32 %1, i32* %4
%5 = load %struct.ac_buffer*, %struct.ac_buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @_increase_write_index(%struct.ac_buffer* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.ac_buffer = type { i32 }
define void @buffer_increase_write_index(%struct.ac_buffer* %0, i32 %1) {
%3 = tail call i32 @_increase_write_index(%struct.ac_buffer* %0, i32 %1)
ret void
}
int do_894() { return 894; }


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

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

LLVM IR (-O0):
define i32 @do_894() {
ret i32 894
}

LLVM IR (-O2):
define i32 @do_894() {
ret i32 894
}
/* Type definitions */
typedef int /*<<< orphan*/ u;
typedef int /*<<< orphan*/ t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *t[10];
  int(*u)[10];
  printf("%d", sizeof(t) != sizeof(u));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ supprimerNomSauvegarde(char const *);
int /*<<< orphan*/ viderDossierSauvegarde(char const *);
void supprimerSauvegardePartie(const char *nomPartie) {
  viderDossierSauvegarde(nomPartie);
  supprimerNomSauvegarde(nomPartie);
}


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

x86 assembly (clang, -O2):
<supprimerSauvegardePartie>:
push   %rbx
mov    %rdi,%rbx
call   1040 <viderDossierSauvegarde@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <supprimerNomSauvegarde@plt>

LLVM IR (-O0):
define void @supprimerSauvegardePartie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @viderDossierSauvegarde(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @supprimerNomSauvegarde(i8* %5)
ret void
}

LLVM IR (-O2):
define void @supprimerSauvegardePartie(i8* %0) {
%2 = tail call i32 @viderDossierSauvegarde(i8* %0)
%3 = tail call i32 @supprimerNomSauvegarde(i8* %0)
ret void
}
int hash_string(char *s) {
  unsigned int v = 0;
  for (; *s; s++) {
    v *= 33;
    v += *s;
  }
  return v % 256;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash_string+0x41>
imul   $0x21,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash_string+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%al
test   %al,%al
je     112b <hash_string+0x2b>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
shl    $0x5,%edx
add    %ecx,%edx
movzbl %al,%ecx
add    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_string+0x10>
movzbl %cl,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %10, 255
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int *return_depends_on_rshift(int x, int *p) {
  if (x < (4 >> 2))
    return 0;
  else
    return p;
}


x86 assembly (clang, -O0):
<return_depends_on_rshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1122 <return_depends_on_rshift+0x22>
movq   $0x0,-0x8(%rbp)
jmp    112a <return_depends_on_rshift+0x2a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_depends_on_rshift>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i32* @return_depends_on_rshift(i32 %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
store i32* null, i32** %3
br label %11
9: ; preds = %2
%10 = load i32*, i32** %5
store i32* %10, i32** %3
br label %11
11: ; preds = %9, %8
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @return_depends_on_rshift(i32 %0, i32* readnone %1) {
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32* null, i32* %1
ret i32* %4
}
float erff(float x) { return 0.0; }


x86 assembly (clang, -O0):
<erff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<erff>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @erff(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @erff(float %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int _ceil_power2(int);
scalar_t__ _power2p(int);
int _floor_power2(int value) {
  if (_power2p(value))
    return value;
  return _ceil_power2(value) / 2;
}


x86 assembly (clang, -O0):
<_floor_power2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_power2p@plt>
cmp    $0x0,%rax
je     1148 <_floor_power2+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <_floor_power2+0x3b>
mov    -0x8(%rbp),%edi
call   1030 <_ceil_power2@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_floor_power2>:
push   %rbx
mov    %edi,%ebx
call   1040 <_power2p@plt>
test   %rax,%rax
jne    113d <_floor_power2+0x1d>
mov    %ebx,%edi
call   1030 <_ceil_power2@plt>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_floor_power2(i32 %0) {
%2 = tail call i64 @_power2p(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @_ceil_power2(i32 %0)
%6 = sdiv i32 %5, 2
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ %0, %1 ]
ret i32 %8
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
int lowercase(char *s) {
  int i, nchar;
  nchar = strlen(s);
  for (i = 0; i < nchar; i++) {
    s[i] = tolower(s[i]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1177 <lowercase+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <lowercase+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <lowercase+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <lowercase+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @lowercase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @tolower(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret i32 0
}
void SSIIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) |= ulIntFlags;
}


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

x86 assembly (clang, -O2):
<SSIIntEnable>:
or     %rsi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @SSIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 20
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SSIIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 20
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
unsigned char *name_only(unsigned char *nam) {
  unsigned char *p;
  p = nam;
  while (*nam)
    if (*nam++ == '/')
      p = nam;
  return (p);
}


x86 assembly (clang, -O0):
<name_only>:
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     1145 <name_only+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <name_only+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <name_only+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_only>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <name_only+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <name_only+0x10>
ret

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

LLVM IR (-O2):
define i8* @name_only(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
char *trim_left(char *cp) {
  while (cp) {
    if (*cp != ' ' && *cp != '\t') {
      break;
    }
    cp++;
  }
  return cp;
}


x86 assembly (clang, -O0):
<trim_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <trim_left+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1138 <trim_left+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1138 <trim_left+0x38>
jmp    1149 <trim_left+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trim_left+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_left>:
test   %rdi,%rdi
je     1122 <trim_left+0x22>
mov    %rdi,%rax
jmp    1114 <trim_left+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <trim_left+0x10>
cmp    $0x9,%cl
je     1110 <trim_left+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @trim_left(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int gateSocket(void) {
  int sd;
  if ((sd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    exit(1);
  return sd;
}


x86 assembly (clang, -O0):
<gateSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1157 <gateSocket+0x37>
mov    $0x1,%edi
call   1030 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gateSocket>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
test   %eax,%eax
js     1140 <gateSocket+0x20>
pop    %rcx
ret
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @gateSocket() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @gateSocket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ datum;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int *, int);
void put_int(char *where, int datum) { memcpy(where, &datum, sizeof(datum)); }


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

x86 assembly (clang, -O2):
<put_int>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @put_int(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 = call i32 @memcpy(i8* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @put_int(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t n_rectangles(int32_t h, int32_t v) {
  return (h * v * (h + 1) * (v + 1)) >> 2;
}


x86 assembly (clang, -O0):
<n_rectangles>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_rectangles>:
lea    0x1(%rsi),%eax
mov    %esi,%ecx
imul   %edi,%ecx
lea    0x1(%rdi),%edx
imul   %edx,%eax
imul   %ecx,%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @n_rectangles(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 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = mul nsw i32 %10, %12
%14 = ashr i32 %13, 2
ret i32 %14
}

LLVM IR (-O2):
define i32 @n_rectangles(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %0, 1
%5 = mul nsw i32 %3, %4
%6 = add nsw i32 %1, 1
%7 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 2
ret i32 %8
}
int firstMissingPositive(int *nums, int numsSize) {
  int res = 1;
  for (int i = 0; i < numsSize; i++) {
  }
  return res;
}


x86 assembly (clang, -O0):
<firstMissingPositive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <firstMissingPositive+0x38>
jmp    112a <firstMissingPositive+0x2a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <firstMissingPositive+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @firstMissingPositive(i32* nocapture readnone %0, i32 %1) {
ret i32 1
}
void do_undefined_instruction(struct pt_regs *pt_regs) { return; }


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @do_undefined_instruction(%struct.pt_regs* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr3Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
void GenLocalAlloc(int size) {
  GenPrintInstr3Operands(0x12, 0, 0x1D, 0, 0x1D, 0, 0x80, size);
}


x86 assembly (clang, -O0):
<GenLocalAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x12,%edi
xor    %r9d,%r9d
mov    $0x1d,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
movl   $0x80,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <GenPrintInstr3Operands@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenLocalAlloc>:
push   %rax
mov    %edi,%eax
mov    $0x12,%edi
xor    %esi,%esi
mov    $0x1d,%edx
xor    %ecx,%ecx
mov    $0x1d,%r8d
xor    %r9d,%r9d
push   %rax
push   $0x80
call   1030 <GenPrintInstr3Operands@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @GenLocalAlloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @GenPrintInstr3Operands(i32 18, i32 0, i32 29, i32 0, i32 29, i32 0, i32 128, i32 %3)
ret void
}

LLVM IR (-O2):
define void @GenLocalAlloc(i32 %0) {
%2 = tail call i32 @GenPrintInstr3Operands(i32 18, i32 0, i32 29, i32 0, i32 29, i32 0, i32 128, i32 %0)
ret void
}
void func_many_args(int a, int b, long c, double d, char e, int f, float g,
                    char h, int i, double j, int k, double l, char m, int n,
                    short o, int p, char q, float r, float s, double t, long u,
                    float v, float w, float x, float y) {}


x86 assembly (clang, -O0):
<func_many_args>:
push   %rbp
mov    %rsp,%rbp
mov    %r9b,%al
movss  0x60(%rbp),%xmm8
movss  0x58(%rbp),%xmm8
movss  0x50(%rbp),%xmm8
mov    0x48(%rbp),%r9
mov    0x40(%rbp),%r9b
mov    0x38(%rbp),%r9d
mov    0x30(%rbp),%r9w
mov    0x28(%rbp),%r9d
mov    0x20(%rbp),%r9b
mov    0x18(%rbp),%r9d
mov    0x10(%rbp),%r9d
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %cl,-0x19(%rbp)
mov    %r8d,-0x20(%rbp)
movss  %xmm1,-0x24(%rbp)
mov    %al,-0x25(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  %xmm3,-0x38(%rbp)
movss  %xmm4,-0x3c(%rbp)
movss  %xmm5,-0x40(%rbp)
movsd  %xmm6,-0x48(%rbp)
movss  %xmm7,-0x4c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func_many_args(i32 %0, i32 %1, i64 %2, double %3, i8 signext %4, i32 %5, float %6, i8 signext %7, i32 %8, double %9, i32 %10, double %11, i8 signext %12, i32 %13, i16 signext %14, i32 %15, i8 signext %16, float %17, float %18, double %19, i64 %20, float %21, float %22, float %23, float %24) {
%26 = alloca i32
%27 = alloca i32
%28 = alloca i64
%29 = alloca double
%30 = alloca i8
%31 = alloca i32
%32 = alloca float
%33 = alloca i8
%34 = alloca i32
%35 = alloca double
%36 = alloca i32
%37 = alloca double
%38 = alloca i8
%39 = alloca i32
%40 = alloca i16
%41 = alloca i32
%42 = alloca i8
%43 = alloca float
%44 = alloca float
%45 = alloca double
%46 = alloca i64
%47 = alloca float
%48 = alloca float
%49 = alloca float
%50 = alloca float
store i32 %0, i32* %26
store i32 %1, i32* %27
store i64 %2, i64* %28
store double %3, double* %29
store i8 %4, i8* %30
store i32 %5, i32* %31
store float %6, float* %32
store i8 %7, i8* %33
store i32 %8, i32* %34
store double %9, double* %35
store i32 %10, i32* %36
store double %11, double* %37
store i8 %12, i8* %38
store i32 %13, i32* %39
store i16 %14, i16* %40
store i32 %15, i32* %41
store i8 %16, i8* %42
store float %17, float* %43
store float %18, float* %44
store double %19, double* %45
store i64 %20, i64* %46
store float %21, float* %47
store float %22, float* %48
store float %23, float* %49
store float %24, float* %50
ret void
}

LLVM IR (-O2):
define void @func_many_args(i32 %0, i32 %1, i64 %2, double %3, i8 signext %4, i32 %5, float %6, i8 signext %7, i32 %8, double %9, i32 %10, double %11, i8 signext %12, i32 %13, i16 signext %14, i32 %15, i8 signext %16, float %17, float %18, double %19, i64 %20, float %21, float %22, float %23, float %24) {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t uDMAIntStatus(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000504))));
}


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

x86 assembly (clang, -O2):
<uDMAIntStatus>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x504(%rax),%rax
ret

LLVM IR (-O0):
define i64 @uDMAIntStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 1284
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @uDMAIntStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 1284
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ logErrorMsg(char *);
int /*<<< orphan*/ remove(char *);
void destroyIPC(int sockfd) {
  if (sockfd > 0) {
    close(sockfd);
    if (!remove("/run/xonard.sock")) {
      logErrorMsg("Unable to delete FIFO");
      exit(1);
    }
  }
}


x86 assembly (clang, -O0):
<destroyIPC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    118d <destroyIPC+0x4d>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
lea    0xe9c(%rip),%rdi
call   1030 <remove@plt>
cmp    $0x0,%eax
jne    1188 <destroyIPC+0x48>
lea    0xe98(%rip),%rdi
call   1050 <logErrorMsg@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
jmp    118d <destroyIPC+0x4d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyIPC>:
push   %rax
test   %edi,%edi
jle    115a <destroyIPC+0x1a>
call   1040 <close@plt>
lea    0xeaf(%rip),%rdi
call   1030 <remove@plt>
test   %eax,%eax
je     115c <destroyIPC+0x1c>
pop    %rax
ret
lea    0xeae(%rip),%rdi
call   1050 <logErrorMsg@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/run/xonard.sock\00"
@.str.1 = [22 x i8] c"Unable to delete FIFO\00"
define void @destroyIPC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
%8 = call i32 @remove(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = call i32 @logErrorMsg(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %5
br label %14
14: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/run/xonard.sock\00"
@.str.1 = [22 x i8] c"Unable to delete FIFO\00"
define void @destroyIPC(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
%5 = tail call i32 @remove(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @logErrorMsg(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3, %1
ret void
}
int cmp(int x, int y) { return (x > y) - (x < y); }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %al
setl   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmp(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
%5 = icmp slt i32 %0, %1
%6 = sext i1 %5 to i32
%7 = add nsw i32 %6, %4
ret i32 %7
}
int test_imm_A8uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xA8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A8uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 168
%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_A8uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 721554505728
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pw(char *, int);
void pl(char *s, int o) {
  pw(s, 2 + o);
  pw(s, o);
}


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

x86 assembly (clang, -O2):
<pl>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x2(%r14),%esi
call   1030 <pw@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pw@plt>

LLVM IR (-O0):
define void @pl(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 = add nsw i32 2, %6
%8 = call i32 @pw(i8* %5, i32 %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @pw(i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @pl(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 2
%4 = tail call i32 @pw(i8* %0, i32 %3)
%5 = tail call i32 @pw(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundcets_feof(FILE *stream) {
  return feof(stream);
}


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

x86 assembly (clang, -O2):
<softboundcets_feof>:
jmp    1030 <feof@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_feof(i32* %0) {
%2 = tail call i32 @feof(i32* %0)
ret i32 %2
}