xunge/DecIR huggingface dataset:
/* Variables and functions */
char *dlerror();
void *dlsym(void *, char const *);
int /*<<< orphan*/ fatal(char const *);
void stub1();
void invoke(void *handle, const char *fname) {
  const char *err;
  void (*funcp)(void);
  (void)dlerror();
  *(void **)(&funcp) = dlsym(handle, fname);
  err = dlerror();
  if (err != NULL)
    fatal(err);
  (*funcp)();
}


x86 assembly (clang, -O0):
<invoke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <dlsym@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <invoke+0x47>
mov    -0x18(%rbp),%rdi
call   1050 <fatal@plt>
call   *-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invoke>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <dlsym@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <dlerror@plt>
test   %rax,%rax
je     1163 <invoke+0x33>
mov    %rax,%rdi
call   1050 <fatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

LLVM IR (-O0):
define void @invoke(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca void ()*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i8* (...) @dlerror()
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i8* @dlsym(i8* %8, i8* %9)
%11 = bitcast void ()** %6 to i8**
store i8* %10, i8** %11
%12 = call i8* (...) @dlerror()
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = call i32 @fatal(i8* %16)
br label %18
18: ; preds = %15, %2
%19 = load void ()*, void ()** %6
ret void
}

LLVM IR (-O2):
define void @invoke(i8* %0, i8* %1) {
%3 = tail call i8* (...) @dlerror()
%4 = tail call i8* @dlsym(i8* %0, i8* %1)
%5 = tail call i8* (...) @dlerror()
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @fatal(i8* %5)
br label %9
9: ; preds = %7, %2
%10 = bitcast i8* %4 to void ()*
tail call void %10()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_send_mqtt_short_command(struct mg_connection *, int,
                                              int /*<<< orphan*/);
void mg_mqtt_pubrec(struct mg_connection *nc, uint16_t message_id) {
  mg_send_mqtt_short_command(nc, 5, message_id);
}


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

x86 assembly (clang, -O2):
<mg_mqtt_pubrec>:
mov    %esi,%edx
mov    $0x5,%esi
jmp    1030 <mg_send_mqtt_short_command@plt>

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

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_pubrec(%struct.mg_connection* %0, i32 %1) {
%3 = tail call i32 @mg_send_mqtt_short_command(%struct.mg_connection* %0, i32 5, i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t viaduct_bytes_to_len(uint8_t *buf) {
  return ((uint32_t)(buf[0]) << 16) | ((uint32_t)(buf[1]) << 8) | buf[2];
}


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

x86 assembly (clang, -O2):
<viaduct_bytes_to_len>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @viaduct_bytes_to_len(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = or i32 %7, %9
ret i32 %10
}
/* Type definitions */
typedef int bits;

/* Variables and functions */
scalar_t__ calloc(int, int);
unsigned long *pc_alloc_bitmap(unsigned long bits) {
  return (unsigned long *)calloc(
      ((int)sizeof(unsigned long)),
      (((bits) + (((int)sizeof(unsigned long)) * 8) - 1) /
       (((int)sizeof(unsigned long)) * 8)));
}


x86 assembly (clang, -O0):
<pc_alloc_bitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rax
sub    $0x1,%rax
shr    $0x6,%rax
mov    %eax,%esi
mov    $0x8,%edi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_alloc_bitmap>:
lea    0x3f(%rdi),%rsi
shr    $0x6,%rsi
mov    $0x8,%edi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i64* @pc_alloc_bitmap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 64
%5 = sub i64 %4, 1
%6 = udiv i64 %5, 64
%7 = trunc i64 %6 to i32
%8 = call i64 @calloc(i32 8, i32 %7)
%9 = inttoptr i64 %8 to i64*
ret i64* %9
}

LLVM IR (-O2):
define i64* @pc_alloc_bitmap(i64 %0) {
%2 = add i64 %0, 63
%3 = lshr i64 %2, 6
%4 = trunc i64 %3 to i32
%5 = tail call i64 @calloc(i32 8, i32 %4)
%6 = inttoptr i64 %5 to i64*
ret i64* %6
}
int classify_arg(arg)
char *arg;
{
  if (!strcmp(arg, "-T") || !strcmp(arg, "-o"))
    return 2;
  if (arg[0] == '-')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<classify_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     114e <classify_arg+0x3e>
mov    -0x10(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    115a <classify_arg+0x4a>
movl   $0x2,-0x4(%rbp)
jmp    117d <classify_arg+0x6d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1176 <classify_arg+0x66>
movl   $0x1,-0x4(%rbp)
jmp    117d <classify_arg+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<classify_arg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xee2(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x2,%ebx
test   %eax,%eax
je     1148 <classify_arg+0x38>
lea    0xed0(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1148 <classify_arg+0x38>
xor    %ebx,%ebx
cmpb   $0x2d,(%r14)
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-T\00"
@.str.1 = [3 x i8] c"-o\00"
define i32 @classify_arg(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 45
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %1, %4
%12 = phi i32 [ 2, %4 ], [ 2, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xf6() {
  Assert_real((iscntrl(246) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1235, ("iscntrl should be 0 for 0xf6"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xf6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf6,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4d3,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xf6\00"
define void @t_iscntrl_0xf6() {
%1 = call i64 @iscntrl(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xf6\00"
define void @t_iscntrl_0xf6() {
%1 = tail call i64 @iscntrl(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CheckMask();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void HandleSegv(int sig) {
  printf("Got SEGV\n");
  CheckMask();
  exit(0);
}


x86 assembly (clang, -O0):
<HandleSegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <CheckMask@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<HandleSegv>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <CheckMask@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Got SEGV\0A\00"
define void @HandleSegv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @CheckMask()
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [9 x i8] c"Got SEGV\00"
define void @HandleSegv(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @CheckMask()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ process(char const *);
int main(void) {
  const char *str = "My first thought was. \"Ooops, man!\" (and so on)";
  process(str);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <process@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [48 x i8] c"My first thought was. \22Ooops, man!\22 (and so on)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @process(i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [48 x i8] c"My first thought was. \22Ooops, man!\22 (and so on)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @process(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_trylock(int /*<<< orphan*/ *);
int ya_pthread_mutex_trylock(pthread_mutex_t *mutex, const char *file,
                             int line) {
  int ret;
  ret = pthread_mutex_trylock(mutex);
  return ret;
}


x86 assembly (clang, -O0):
<ya_pthread_mutex_trylock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_trylock@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ya_pthread_mutex_trylock>:
jmp    1030 <pthread_mutex_trylock@plt>

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

LLVM IR (-O2):
define i32 @ya_pthread_mutex_trylock(i32* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @pthread_mutex_trylock(i32* %0)
ret i32 %4
}
void print_lnf_site(int h, double logfh) {}


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

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

LLVM IR (-O0):
define void @print_lnf_site(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @print_lnf_site(i32 %0, double %1) {
ret void
}
int numcmp(const void *a, const void *b) {
  int x = *((int *)a);
  int y = *((int *)b);
  if (x > y)
    return 1;
  if (x < y)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1136 <numcmp+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1155 <numcmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <numcmp+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <numcmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ ascii_numeric_cmp(char const *, char const *);
int num_lt(const char *pat, const char *text) {
  return (ascii_numeric_cmp(text, pat) < 0);
}


x86 assembly (clang, -O0):
<num_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ascii_numeric_cmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_lt>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <ascii_numeric_cmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @num_lt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @ascii_numeric_cmp(i8* %5, i8* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @num_lt(i8* %0, i8* %1) {
%3 = tail call i64 @ascii_numeric_cmp(i8* %1, i8* %0)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
void XkbComputeSectionBounds() {}


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

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

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

LLVM IR (-O2):
define void @XkbComputeSectionBounds() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float num;
  printf("Digite um número real: ");
  scanf("%f", &num);
  printf("Quinta parte: %.2f", num / 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea6(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
divss  0xeb2(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Digite um n\C3\BAmero real: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Quinta parte: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fdiv float %5, 5.000000e+00
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Digite um n\C3\BAmero real: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Quinta parte: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fdiv float %5, 5.000000e+00
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
void print_bool(char *label, int bool) {
  printf("%s:%c  ", label, bool ? '1' : '0');
}


x86 assembly (clang, -O0):
<print_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x30,%edx
mov    $0x31,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bool>:
mov    %rdi,%rax
cmp    $0x1,%esi
mov    $0x31,%edx
sbb    $0x0,%edx
lea    0xedb(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s:%c \00"
define void @print_bool(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 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 49, i32 48
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s:%c \00"
define void @print_bool(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 48, i32 49
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int Print_msg_to_dump(char *msg, FILE *dump_file) {
  fprintf(dump_file, "|||---|||%s|||---|||\n", msg);
  return 0;
}


x86 assembly (clang, -O0):
<Print_msg_to_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print_msg_to_dump>:
push   %rax
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"|||---|||%s|||---|||\0A\00"
define i32 @Print_msg_to_dump(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"|||---|||%s|||---|||\0A\00"
define i32 @Print_msg_to_dump(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
double __ieee754_fmod(double, double);
double jmod(double x, double y) { return __ieee754_fmod(x, y); }


x86 assembly (clang, -O0):
<jmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ieee754_fmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jmod>:
jmp    1030 <__ieee754_fmod@plt>

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

LLVM IR (-O2):
define double @jmod(double %0, double %1) {
%3 = tail call double @__ieee754_fmod(double %0, double %1)
ret double %3
}
void SUPR3HardenedLdrLoad(void) {}


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

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

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

LLVM IR (-O2):
define void @SUPR3HardenedLdrLoad() {
ret void
}
void _data_tlb_miss() { printf("Exception: %s\n", __FUNCTION__); }


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

x86 assembly (clang, -O2):
<_data_tlb_miss>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._data_tlb_miss = [15 x i8] c"_data_tlb_miss\00"
define void @_data_tlb_miss() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__._data_tlb_miss, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ io_printplain(int, int, char *);
int /*<<< orphan*/ turn_off_attributes();
void io_printcolor(int x, int y, int color, char *s) {
  attron(COLOR_PAIR(color));
  io_printplain(x, y, s);
  turn_off_attributes();
}


x86 assembly (clang, -O0):
<io_printcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1060 <io_printplain@plt>
mov    $0x0,%al
call   1030 <turn_off_attributes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_printcolor>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    %edx,%edi
call   1050 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1040 <attron@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1060 <io_printplain@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <turn_off_attributes@plt>

LLVM IR (-O0):
define void @io_printcolor(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = call i32 @COLOR_PAIR(i32 %9)
%11 = call i32 @attron(i32 %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i8*, i8** %8
%15 = call i32 @io_printplain(i32 %12, i32 %13, i8* %14)
%16 = call i32 (...) @turn_off_attributes()
ret void
}

LLVM IR (-O2):
define void @io_printcolor(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @COLOR_PAIR(i32 %2)
%6 = tail call i32 @attron(i32 %5)
%7 = tail call i32 @io_printplain(i32 %0, i32 %1, i8* %3)
%8 = tail call i32 (...) @turn_off_attributes()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stop_sound();
int /*<<< orphan*/ stop_timer();
void pb_stop(void) {
  stop_timer();
  stop_sound();
}


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

x86 assembly (clang, -O2):
<pb_stop>:
push   %rax
xor    %eax,%eax
call   1040 <stop_timer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <stop_sound@plt>

LLVM IR (-O0):
define void @pb_stop() {
%1 = call i32 (...) @stop_timer()
%2 = call i32 (...) @stop_sound()
ret void
}

LLVM IR (-O2):
define void @pb_stop() {
%1 = tail call i32 (...) @stop_timer()
%2 = tail call i32 (...) @stop_sound()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int Xelse(int status, char *label, char *mnemo, char *oper) {
  if (oper)
    error("no operand allowed for ELSE");
  return 0x12;
}


x86 assembly (clang, -O0):
<Xelse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     113e <Xelse+0x2e>
lea    0xec7(%rip),%rdi
call   1030 <error@plt>
mov    $0x12,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xelse>:
test   %rcx,%rcx
je     1126 <Xelse+0x16>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <error@plt>
add    $0x8,%rsp
mov    $0x12,%eax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"no operand allowed for ELSE\00"
define i32 @Xelse(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
ret i32 18
}

LLVM IR (-O2):
@.str = [28 x i8] c"no operand allowed for ELSE\00"
define i32 @Xelse(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* readnone %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int score = 800;
  if (score <= 900) {
    printf("OK!!\n");
  } else {
    printf("NG!!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x320,-0x8(%rbp)
cmpl   $0x384,-0x8(%rbp)
jg     1144 <main+0x34>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x40>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"OK!!\0A\00"
@.str.1 = [6 x i8] c"NG!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 800, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 900
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"OK!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int isspace(int c) { return ('\t' <= c && c <= '\r') || c == ' '; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x9,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <isspace+0x24>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112e <isspace+0x2e>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int main() {
  int pathbuf[2];
  int *bound = pathbuf + sizeof(pathbuf) / sizeof(*pathbuf) - 1;
  int *p = pathbuf;
  while (p <= bound) {
    *p = 1;
    p++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rax
add    $0x8,%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
ja     114c <main+0x4c>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1123 <main+0x23>
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 [2 x i32]
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = getelementptr inbounds i32, i32* %6, i64 -1
store i32* %7, i32** %3
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32* %8, i32** %4
br label %9
9: ; preds = %13, %0
%10 = load i32*, i32** %4
%11 = load i32*, i32** %3
%12 = icmp ule i32* %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32*, i32** %4
store i32 1, i32* %14
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %4
br label %9
17: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ readWriteSector(char *, int, int);
void readSector(char *buffer, int sector) {
  readWriteSector(buffer, sector, 2);
  return;
}


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

x86 assembly (clang, -O2):
<readSector>:
mov    $0x2,%edx
jmp    1030 <readWriteSector@plt>

LLVM IR (-O0):
define void @readSector(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 = call i32 @readWriteSector(i8* %5, i32 %6, i32 2)
ret void
}

LLVM IR (-O2):
define void @readSector(i8* %0, i32 %1) {
%3 = tail call i32 @readWriteSector(i8* %0, i32 %1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aa_endconv_st_be(void *, double *, int);
void aa_endconv_st_be_d(void *dst, double src) {
  aa_endconv_st_be(dst, &src, sizeof(double));
}


x86 assembly (clang, -O0):
<aa_endconv_st_be_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <aa_endconv_st_be@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_endconv_st_be_d>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <aa_endconv_st_be@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @aa_endconv_st_be_d(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = call i32 @aa_endconv_st_be(i8* %5, double* %4, i32 8)
ret void
}

LLVM IR (-O2):
define void @aa_endconv_st_be_d(i8* %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i32 @aa_endconv_st_be(i8* %0, double* %3, i32 8)
ret void
}
int dcompare(const void *p1, const void *p2) {
  double a = *(double *)p1;
  double b = *(double *)p2;
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<dcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1142 <dcompare+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1169 <dcompare+0x69>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <dcompare+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <dcompare+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcompare>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dcompare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @dcompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sw(int);
int /*<<< orphan*/ sw2(int);
int foo(int argc) {
  volatile int a = 0;
  sw(argc + 2);
  sw(argc + 2);
  sw(argc + 2);
  sw2(argc + 1);
  sw2(argc + 1);
  sw2(argc + 1);
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1040 <sw@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1040 <sw@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1040 <sw@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <sw2@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <sw2@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <sw2@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
lea    0x2(%rbx),%ebp
mov    %ebp,%edi
call   1040 <sw@plt>
mov    %ebp,%edi
call   1040 <sw@plt>
mov    %ebp,%edi
call   1040 <sw@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <sw2@plt>
mov    %ebx,%edi
call   1030 <sw2@plt>
mov    %ebx,%edi
call   1030 <sw2@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 2
%6 = call i32 @sw(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 2
%9 = call i32 @sw(i32 %8)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 2
%12 = call i32 @sw(i32 %11)
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
%15 = call i32 @sw2(i32 %14)
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
%18 = call i32 @sw2(i32 %17)
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
%21 = call i32 @sw2(i32 %20)
%22 = load volatile i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = add nsw i32 %0, 2
%5 = tail call i32 @sw(i32 %4)
%6 = tail call i32 @sw(i32 %4)
%7 = tail call i32 @sw(i32 %4)
%8 = add nsw i32 %0, 1
%9 = tail call i32 @sw2(i32 %8)
%10 = tail call i32 @sw2(i32 %8)
%11 = tail call i32 @sw2(i32 %8)
%12 = load volatile i32, i32* %2
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int8_t stdlib_ndarray_set_ptr_int64(uint8_t *idx, const int64_t v) {
  *(int64_t *)idx = v;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @stdlib_ndarray_set_ptr_int64(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 0
}
/* Variables and functions */
size_t size_min(const size_t x, const size_t y) { return (x < y) ? x : y; }


x86 assembly (clang, -O0):
<size_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <size_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <size_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @size_min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @size_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int iwl_tm_gnl_exit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @iwl_tm_gnl_exit() {
ret i32 0
}
void ff_hevc_put_hevc_bi_qpel_hv48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_hv48_8_sse4() {
ret void
}
int foo(int n) { return n * n; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
unsigned read_option(unsigned start, unsigned size, unsigned def) {
  return def;
}


x86 assembly (clang, -O0):
<read_option>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_option>:
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @read_option(i32 %0, i32 %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ api2(int, int, unsigned int);
void fill_surface(int sid, unsigned int color) { api2(1005, sid, color); }


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

x86 assembly (clang, -O2):
<fill_surface>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x3ed,%edi
jmp    1030 <api2@plt>

LLVM IR (-O0):
define void @fill_surface(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 @api2(i32 1005, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @fill_surface(i32 %0, i32 %1) {
%3 = tail call i32 @api2(i32 1005, i32 %0, i32 %1)
ret void
}
void test55_PrintImpl_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test55_PrintImpl_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_MAIL;
int /*<<< orphan*/ LOG_NDELAY;
int /*<<< orphan*/ openlog(char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void LogOpen(const char *agentname) {
  openlog(agentname, LOG_NDELAY, LOG_MAIL);
}


x86 assembly (clang, -O0):
<LogOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
call   1030 <openlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogOpen>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@LOG_NDELAY = global i32 0
@LOG_MAIL = global i32 0
define void @LogOpen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @LOG_NDELAY
%5 = load i32, i32* @LOG_MAIL
%6 = call i32 @openlog(i8* %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@LOG_NDELAY = global i32 0
@LOG_MAIL = global i32 0
define void @LogOpen(i8* %0) {
%2 = load i32, i32* @LOG_NDELAY
%3 = load i32, i32* @LOG_MAIL
%4 = tail call i32 @openlog(i8* %0, i32 %2, i32 %3)
ret void
}