xunge/DecIR huggingface dataset:
/* Variables and functions */
int O_NDELAY;
int O_NOCTTY;
int O_NONBLOCK;
int O_RDWR;
int /*<<< orphan*/ close(int);
int open(char const *, int);
int ser_port_is_ready(const char *sername) {
  int fd;
  if ((fd = open(sername, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1) {
    return 0;
  } else {
    close(fd);
    return 1;
  }
}


x86 assembly (clang, -O0):
<ser_port_is_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
or     (%rax),%esi
mov    0x2e7f(%rip),%rax
or     (%rax),%esi
mov    0x2e8e(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1171 <ser_port_is_ready+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ser_port_is_ready+0x60>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ser_port_is_ready>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e8e(%rip),%rax
or     (%rax),%esi
mov    0x2e9d(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     115d <ser_port_is_ready+0x3d>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @ser_port_is_ready(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_NOCTTY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_NDELAY
%10 = or i32 %8, %9
%11 = load i32, i32* @O_NONBLOCK
%12 = or i32 %10, %11
%13 = call i32 @open(i8* %5, i32 %12)
store i32 %13, i32* %4
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 0, i32* %2
br label %19
16: ; preds = %1
%17 = load i32, i32* %4
%18 = call i32 @close(i32 %17)
store i32 1, i32* %2
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @ser_port_is_ready(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %6, %7
%9 = tail call i32 @open(i8* %0, i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %13, label %11
11: ; preds = %1
%12 = tail call i32 @close(i32 %9)
br label %13
13: ; preds = %1, %11
%14 = phi i32 [ 1, %11 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ config_GPIO();
scalar_t__ getPin(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void set_GPIO_receive() {
  char pin[3];
  if (getPin(pin))
    return;
  config_GPIO();
  char cmd[50];
  sprintf(cmd, "echo \"0\" > /sys/class/gpio/gpio%s/value", pin);
  system(cmd);
}


x86 assembly (clang, -O0):
<set_GPIO_receive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x3(%rbp),%rdi
call   1050 <getPin@plt>
cmp    $0x0,%rax
je     1160 <set_GPIO_receive+0x20>
jmp    1184 <set_GPIO_receive+0x44>
mov    $0x0,%al
call   1040 <config_GPIO@plt>
lea    -0x40(%rbp),%rdi
lea    -0x3(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_GPIO_receive>:
push   %rbx
sub    $0x50,%rsp
lea    0xd(%rsp),%rdi
call   1050 <getPin@plt>
test   %rax,%rax
jne    117c <set_GPIO_receive+0x3c>
xor    %eax,%eax
call   1040 <config_GPIO@plt>
lea    0xe9e(%rip),%rsi
lea    0x10(%rsp),%rbx
lea    0xd(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"echo \220\22 > /sys/class/gpio/gpio%s/value\00"
define void @set_GPIO_receive() {
%1 = alloca [3 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i64 @getPin(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
br label %14
7: ; preds = %0
%8 = call i32 (...) @config_GPIO()
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%13 = call i32 @system(i8* %12)
br label %14
14: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"echo \220\22 > /sys/class/gpio/gpio%s/value\00"
define void @set_GPIO_receive() {
%1 = alloca [3 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i64 @getPin(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = call i32 (...) @config_GPIO()
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
%10 = call i32 @system(i8* %8)
br label %11
11: ; preds = %0, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
const char *name_to_config(const char *name, char *buf, int blen) {
  if (name[0] == '.' || name[0] == '/')
    return name;
  snprintf(buf, blen,
           "/etc/mosaic.d"
           "/%s.mos",
           name);
  return buf;
}


x86 assembly (clang, -O0):
<name_to_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1143 <name_to_config+0x33>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1150 <name_to_config+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <name_to_config+0x5f>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xe9e(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_to_config>:
push   %rbx
mov    %rdi,%rcx
mov    (%rdi),%al
and    $0xfe,%al
cmp    $0x2e,%al
jne    1121 <name_to_config+0x11>
mov    %rcx,%rbx
jmp    1138 <name_to_config+0x28>
mov    %rsi,%rbx
lea    0xed5(%rip),%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"/etc/mosaic.d/%s.mos\00"
define i8* @name_to_config(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 46
br i1 %12, label %19, label %13
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
br i1 %18, label %19, label %21
19: ; preds = %13, %3
%20 = load i8*, i8** %5
store i8* %20, i8** %4
br label %27
21: ; preds = %13
%22 = load i8*, i8** %6
%23 = load i32, i32* %7
%24 = load i8*, i8** %5
%25 = call i32 @snprintf(i8* %22, i32 %23, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** %6
store i8* %26, i8** %4
br label %27
27: ; preds = %21, %19
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
@.str = [21 x i8] c"/etc/mosaic.d/%s.mos\00"
define i8* @name_to_config(i8* %0, i8* %1, i32 %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, -2
%6 = icmp eq i8 %5, 46
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %3, %7
%10 = phi i8* [ %1, %7 ], [ %0, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
void *hola(void *nro) {
  sleep(2);
  printf("Hola, soy el hilo %d\n", *(int *)nro);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<hola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hola>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    (%rbx),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Hola, soy el hilo %d\0A\00"
define i8* @hola(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @sleep(i32 2)
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hola, soy el hilo %d\0A\00"
define noalias i8* @hola(i8* nocapture %0) {
%2 = tail call i32 @sleep(i32 2)
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help_notify(void) {
  printf("\nOptions:\n -h, --help\n      Print detailed help screen.\n -V, "
         "--version\n      Print version information.\n -v, --verbose\n      "
         "Show details for command-line debugging.\n -t, --timeout=INTEGER\n   "
         "   Seconds before the check return with a timeout alert.\n     "
         "--eopt=[section][@file]\n      Read additional opts from section in "
         "ini-File.\n -F, --file=[filename]\n      Read notification template "
         "from file.\n -m, --message=[Message Template]\n      Use string as "
         "message template.\n");
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"\0AOptions:\0A -h, --help\0A Print detailed help screen.\0A -V, --version\0A Print version information.\0A -v, --verbose\0A Show details for command-line debugging.\0A -t, --timeout=INTEGER\0A Seconds before the check return with a timeout alert.\0A --eopt=[section][@file]\0A Read additional opts from section in ini-File.\0A -F, --file=[filename]\0A Read notification template from file.\0A -m, --message=[Message Template]\0A Use string as message template.\0A\00"
define void @print_help_notify() {
%1 = call i32 @printf(i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [470 x i8] c"\0AOptions:\0A -h, --help\0A Print detailed help screen.\0A -V, --version\0A Print version information.\0A -v, --verbose\0A Show details for command-line debugging.\0A -t, --timeout=INTEGER\0A Seconds before the check return with a timeout alert.\0A --eopt=[section][@file]\0A Read additional opts from section in ini-File.\0A -F, --file=[filename]\0A Read notification template from file.\0A -m, --message=[Message Template]\0A Use string as message template.\00"
define void @print_help_notify() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([470 x i8], [470 x i8]* @str, i64 0, i64 0))
ret void
}
void eglSwapBuffers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglSwapBuffers() {
ret void
}
int XGetSizeHints() {}


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

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

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

LLVM IR (-O2):
define i32 @XGetSizeHints() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void clear() { putchar(1); }


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
mov    $0x1,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @clear() {
%1 = call i32 @putchar(i32 1)
ret void
}

LLVM IR (-O2):
define void @clear() {
%1 = tail call i32 @putchar(i32 1)
ret void
}
/* Variables and functions */
int stress_cache_set_flag(int);
int stress_cache_set_flush(const char *opt) {
  (void)opt;
  return stress_cache_set_flag((0x02));
}


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

x86 assembly (clang, -O2):
<stress_cache_set_flush>:
mov    $0x2,%edi
jmp    1030 <stress_cache_set_flag@plt>

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

LLVM IR (-O2):
define i32 @stress_cache_set_flush(i8* nocapture readnone %0) {
%2 = tail call i32 @stress_cache_set_flag(i32 2)
ret i32 %2
}
/* Variables and functions */
int foo(int, int, int, int, int, int);
int bar() {
  int q, w, e, r, t, y;
  return foo((int)&q, q, w, e, q, (int)&w);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%r8d
lea    -0x8(%rbp),%rax
mov    %eax,%r9d
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%r9
call   1030 <foo@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = ptrtoint i32* %1 to i32
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %1
%12 = ptrtoint i32* %2 to i32
%13 = call i32 @foo(i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @bar() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = ptrtoint i32* %1 to i64
%6 = trunc i64 %5 to i32
%7 = ptrtoint i32* %2 to i64
%8 = trunc i64 %7 to i32
%9 = call i32 @foo(i32 %6, i32 undef, i32 undef, i32 undef, i32 undef, i32 %8)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpord_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpord_sd(__m128d __a, __m128d __b) {
  return _mm_cmpord_sd(__a, __b);
}


x86 assembly (clang, -O0):
<test_mm_cmpord_sd>:
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_cmpord_sd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_cmpord_sd>:
jmp    1030 <_mm_cmpord_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_cmpord_sd(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_cmpord_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_cmpord_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpord_sd(i32 %0, i32 %1)
ret i32 %3
}
void read_temp(struct stats_pwr_temp *st_pwr_temp, int nbr) {}


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

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

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

LLVM IR (-O2):
%struct.stats_pwr_temp = type opaque
define void @read_temp(%struct.stats_pwr_temp* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int quit(const char *message) {
  printf("%s\n", message);
  printf("Press enter to exit...\n");
  getchar();
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [24 x i8] c"Press enter to exit...\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @getchar()
%7 = load i32, i32* @EXIT_FAILURE
ret i32 %7
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [23 x i8] c"Press enter to exit...\00"
define i32 @quit(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
%5 = load i32, i32* @EXIT_FAILURE
ret i32 %5
}
int main(void) {
  int *p;
  {
    int x = 5;
    p = &x;
  }
  int y = *p;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void dummy_line(long x1, long y1, long x2, long y2, int isclipped) {
  x1 = x1;
  y1 = y1;
  x2 = x2;
  y2 = y2;
  isclipped = isclipped;
}


x86 assembly (clang, -O0):
<dummy_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_line(i64 %0, i64 %1, i64 %2, i64 %3, i32 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i64, i64* %6
store i64 %11, i64* %6
%12 = load i64, i64* %7
store i64 %12, i64* %7
%13 = load i64, i64* %8
store i64 %13, i64* %8
%14 = load i64, i64* %9
store i64 %14, i64* %9
%15 = load i32, i32* %10
store i32 %15, i32* %10
ret void
}

LLVM IR (-O2):
define void @dummy_line(i64 %0, i64 %1, i64 %2, i64 %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *getenv(char *);
scalar_t__ strcmp(int /*<<< orphan*/ *, char *);
int is_query_p() {
  return getenv("SERF_EVENT") != NULL &&
         strcmp(getenv("SERF_EVENT"), "query") == 0;
}


x86 assembly (clang, -O0):
<is_query_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     116b <is_query_p+0x4b>
lea    0xeb3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
lea    0xeaf(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_query_p>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     114e <is_query_p+0x2e>
lea    0xed2(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"SERF_EVENT\00"
@.str.1 = [6 x i8] c"query\00"
define i32 @is_query_p() {
%1 = call i32* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i64 @strcmp(i32* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ false, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"SERF_EVENT\00"
@.str.1 = [6 x i8] c"query\00"
define i32 @is_query_p() {
%1 = tail call i32* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
void b_system_misc(unsigned long function, void *var1, void *var2) {
  asm volatile("call *0x001000b8" : : "d"(function), "a"(var1), "c"(var2));
}


x86 assembly (clang, -O0):
<b_system_misc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
call   *0x1000b8
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_system_misc>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %rdi,%rdx
call   *0x1000b8
ret

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

LLVM IR (-O2):
define void @b_system_misc(i64 %0, i8* %1, i8* %2) {
tail call void asm sideeffect "call *0x001000b8", "{dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i8* %1, i8* %2)
ret void
}
unsigned blendop(unsigned color_blending_mode,
                 unsigned color_blending_src_factor,
                 unsigned color_blending_dst_factor,
                 unsigned alpha_blending_mode,
                 unsigned alpha_blending_src_factor,
                 unsigned alpha_blending_dst_factor) {
  return (color_blending_mode << 24) | (color_blending_src_factor << 20) |
         (color_blending_dst_factor << 16) | (alpha_blending_mode << 8) |
         (alpha_blending_src_factor << 4) | (alpha_blending_dst_factor << 0);
}


x86 assembly (clang, -O0):
<blendop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x14,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendop>:
mov    %r8d,%eax
shl    $0x18,%edi
shl    $0x14,%esi
or     %edi,%esi
shl    $0x10,%edx
shl    $0x8,%ecx
or     %edx,%ecx
or     %esi,%ecx
shl    $0x4,%eax
or     %r9d,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @blendop(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = shl i32 %0, 24
%8 = shl i32 %1, 20
%9 = or i32 %8, %7
%10 = shl i32 %2, 16
%11 = or i32 %9, %10
%12 = shl i32 %3, 8
%13 = or i32 %11, %12
%14 = shl i32 %4, 4
%15 = or i32 %13, %14
%16 = or i32 %15, %5
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mb_free(void *);
int _ls_free_extra(void *data, void *extra) {
  int result = -1;
  ((void)(data));
  do {
    ((void)(extra));
    assert(extra);
  } while (0);
  do {
    if (extra) {
      mb_free(extra);
      extra = 0;
    } else {
      do {
        ((void)(0 && "Memory already released."));
        assert(0 && "Memory already released.");
      } while (0);
    }
  } while (0);
  return result;
}


x86 assembly (clang, -O0):
<_ls_free_extra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <assert@plt>
jmp    1147 <_ls_free_extra+0x27>
cmpq   $0x0,-0x10(%rbp)
je     1168 <_ls_free_extra+0x48>
mov    -0x10(%rbp),%rdi
call   1040 <mb_free@plt>
movq   $0x0,-0x10(%rbp)
jmp    1179 <_ls_free_extra+0x59>
jmp    116d <_ls_free_extra+0x4d>
xor    %edi,%edi
call   1030 <assert@plt>
jmp    1179 <_ls_free_extra+0x59>
jmp    117e <_ls_free_extra+0x5e>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ls_free_extra>:
push   %rbx
mov    %rsi,%rbx
mov    %ebx,%edi
call   1030 <assert@plt>
test   %rbx,%rbx
je     113a <_ls_free_extra+0x1a>
mov    %rbx,%rdi
call   1040 <mb_free@plt>
jmp    1141 <_ls_free_extra+0x21>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_ls_free_extra(i8* nocapture readnone %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i8* %1, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @mb_free(i8* %1)
br label %11
9: ; preds = %2
%10 = tail call i32 @assert(i32 0)
br label %11
11: ; preds = %9, %7
ret i32 -1
}
int test_05(int a, int b, int c, int d) { return a - b - c - 1; }


x86 assembly (clang, -O0):
<test_05>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_05>:
lea    (%rsi,%rdx,1),%eax
not    %eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @test_05(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = sub nsw i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_05(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %2, %1
%6 = xor i32 %5, -1
%7 = add i32 %6, %0
ret i32 %7
}
unsigned int get_InitHHMn(unsigned char *pds) {
  return (pds[16] + 100 * pds[15]);
}


x86 assembly (clang, -O0):
<get_InitHHMn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x10(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0xf(%rcx),%ecx
imul   $0x64,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_InitHHMn>:
movzbl 0x10(%rdi),%ecx
movzbl 0xf(%rdi),%eax
imul   $0x64,%eax,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_InitHHMn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 16
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 15
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = mul nsw i32 100, %10
%12 = add nsw i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_InitHHMn(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 16
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 15
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = mul nuw nsw i32 %7, 100
%9 = add nuw nsw i32 %8, %4
ret i32 %9
}
/* Variables and functions */
int gprc_associative_instruction_set(int *);
int gprcm_associative_instruction_set(int *instruction_set) {
  return gprc_associative_instruction_set(instruction_set);
}


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

x86 assembly (clang, -O2):
<gprcm_associative_instruction_set>:
jmp    1030 <gprc_associative_instruction_set@plt>

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

LLVM IR (-O2):
define i32 @gprcm_associative_instruction_set(i32* %0) {
%2 = tail call i32 @gprc_associative_instruction_set(i32* %0)
ret i32 %2
}
int clock12ToDeg(int clockVal) {
  if (clockVal >= 12)
    clockVal = clockVal - 12;
  return 90 - (30 * clockVal);
}


x86 assembly (clang, -O0):
<clock12ToDeg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jl     111a <clock12ToDeg+0x1a>
mov    -0x4(%rbp),%eax
sub    $0xc,%eax
mov    %eax,-0x4(%rbp)
imul   $0x1e,-0x4(%rbp),%ecx
mov    $0x5a,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock12ToDeg>:
lea    -0xc(%rdi),%eax
cmp    $0xc,%edi
cmovl  %edi,%eax
imul   $0xffffffe2,%eax,%eax
add    $0x5a,%eax
ret

LLVM IR (-O0):
define i32 @clock12ToDeg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 12
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 12
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = mul nsw i32 30, %9
%11 = sub nsw i32 90, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @clock12ToDeg(i32 %0) {
%2 = icmp sgt i32 %0, 11
%3 = add nsw i32 %0, -12
%4 = select i1 %2, i32 %3, i32 %0
%5 = mul i32 %4, -30
%6 = add i32 %5, 90
ret i32 %6
}
void print_rtm_newdel(struct nlmsghdr *h) { ; }


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

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

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

LLVM IR (-O2):
%struct.nlmsghdr = type opaque
define void @print_rtm_newdel(%struct.nlmsghdr* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t Limit16(int a) {
  if ((a + 0x8000) & ~0xFFFF)
    return (a >> 31) ^ 0x7FFF;
  else
    return a;
}


x86 assembly (clang, -O0):
<Limit16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8000,%eax
and    $0xffff0000,%eax
cmp    $0x0,%eax
je     1130 <Limit16+0x30>
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
xor    $0x7fff,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <Limit16+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Limit16>:
cmp    $0xffff8001,%edi
mov    $0xffff8000,%ecx
cmovge %edi,%ecx
cmp    $0x7fff,%ecx
mov    $0x7fff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Limit16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 32768
%6 = and i32 %5, -65536
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 31
%11 = xor i32 %10, 32767
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @Limit16(i32 %0) {
%2 = icmp sgt i32 %0, -32768
%3 = select i1 %2, i32 %0, i32 -32768
%4 = icmp slt i32 %3, 32767
%5 = select i1 %4, i32 %3, i32 32767
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f2() {
  static int i = 0;
  i++;
  printf("%d\n", i);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f09(%rip)
mov    0x2f03(%rip),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    0x2f16(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f0d(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@f2.i = internal global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @f2() {
%1 = load i32, i32* @f2.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f2.i
%3 = load i32, i32* @f2.i
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@f2.i = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @f2() {
%1 = load i32, i32* @f2.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f2.i
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
int issep(int c) { return isspace(c) || c == ',' || c == ';'; }


x86 assembly (clang, -O0):
<issep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    114e <issep+0x3e>
mov    $0x1,%al
cmpl   $0x2c,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114e <issep+0x3e>
cmpl   $0x3b,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issep>:
push   %rbx
mov    %edi,%ebx
call   1030 <isspace@plt>
test   %rax,%rax
setne  %al
cmp    $0x2c,%ebx
sete   %cl
cmp    $0x3b,%ebx
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @issep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isspace(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 44
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 59
br label %12
12: ; preds = %9, %6, %1
%13 = phi i1 [ true, %6 ], [ true, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @issep(i32 %0) {
%2 = tail call i64 @isspace(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 44
%5 = or i1 %4, %3
%6 = icmp eq i32 %0, 59
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
extern int isonum_721(p)
unsigned char *p;
{ return *p | ((char)p[1] << 8); }


x86 assembly (clang, -O0):
<isonum_721>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_721>:
movzbl (%rdi),%ecx
movsbl 0x1(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isonum_721(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = or i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @isonum_721(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t abs_32(int32_t i) { return ((i ^ (i >> 31)) - (i >> 31)); }


x86 assembly (clang, -O0):
<abs_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_32>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs_32(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void ble_rsp_gap_end_procedure(
    const struct ble_msg_gap_end_procedure_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_gap_end_procedure_rsp_t = type opaque
define void @ble_rsp_gap_end_procedure(%struct.ble_msg_gap_end_procedure_rsp_t* nocapture %0) {
ret void
}
int mt_lbprof_disable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mt_lbprof_disable() {
ret i32 0
}
int test_imm_EEuint32_reg(unsigned int val) {
  return ((val) & (0xEE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EEuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xee,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EEuint32_reg(i32 %0) {
%2 = and i32 %0, 238
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bytes_to_uint32_le(const unsigned char *p) {
  return (((uint32_t)p[0]) | (((uint32_t)p[1]) << 8) |
          (((uint32_t)p[2]) << 16) | (((uint32_t)p[3]) << 24));
}


x86 assembly (clang, -O0):
<bytes_to_uint32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bytes_to_uint32_le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void copy(int *b, int *a) {
  int i;
  for (i = 0; i < 2; i++) {
    b[i] = a[i];
  }
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1141 <copy+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @copy(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 = %19, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @copy(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disp_perfect_num();
int /*<<< orphan*/ getch();
int main() {
  disp_perfect_num();
  getch();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @disp_perfect_num()
%2 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inb(int);
void delay(void) {
  inb(0x84);
  inb(0x84);
  inb(0x84);
  inb(0x84);
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x84,%edi
call   1030 <inb@plt>
mov    $0x84,%edi
call   1030 <inb@plt>
mov    $0x84,%edi
call   1030 <inb@plt>
mov    $0x84,%edi
call   1030 <inb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rax
mov    $0x84,%edi
call   1030 <inb@plt>
mov    $0x84,%edi
call   1030 <inb@plt>
mov    $0x84,%edi
call   1030 <inb@plt>
mov    $0x84,%edi
pop    %rax
jmp    1030 <inb@plt>

LLVM IR (-O0):
define void @delay() {
%1 = call i32 @inb(i32 132)
%2 = call i32 @inb(i32 132)
%3 = call i32 @inb(i32 132)
%4 = call i32 @inb(i32 132)
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = tail call i32 @inb(i32 132)
%2 = tail call i32 @inb(i32 132)
%3 = tail call i32 @inb(i32 132)
%4 = tail call i32 @inb(i32 132)
ret void
}