xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ redraw_error_msg(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/);
void redraw_msg_dialog(void) { redraw_error_msg(NULL, NULL, 0); }


x86 assembly (clang, -O0):
<redraw_msg_dialog>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1030 <redraw_error_msg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw_msg_dialog>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <redraw_error_msg@plt>

LLVM IR (-O0):
define void @redraw_msg_dialog() {
%1 = call i32 @redraw_error_msg(i32* null, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @redraw_msg_dialog() {
%1 = tail call i32 @redraw_error_msg(i32* null, i32* null, i32 0)
ret void
}
/* Variables and functions */
int dup(int);
void save_fd(int *fd) {
  fd[0] = dup(0);
  fd[1] = dup(1);
}


x86 assembly (clang, -O0):
<save_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <dup@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%edi
call   1030 <dup@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_fd>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <dup@plt>
mov    %eax,(%rbx)
mov    $0x1,%edi
call   1030 <dup@plt>
mov    %eax,0x4(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @save_fd(i32* nocapture writeonly %0) {
%2 = tail call i32 @dup(i32 0)
store i32 %2, i32* %0
%3 = tail call i32 @dup(i32 1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
ret void
}
void foo234() {}


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

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

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

LLVM IR (-O2):
define void @foo234() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gu_free(void *buf) { free(buf); }


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

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

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

LLVM IR (-O2):
define void @gu_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_ttin(int sig) { printf("TTIN\n"); }


x86 assembly (clang, -O0):
<catch_ttin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"TTIN\0A\00"
define void @catch_ttin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"TTIN\00"
define void @catch_ttin(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ klogctl(int, char *, int);
int main() {
  char buf[1024];
  klogctl(0, NULL, 0);
  klogctl(3, buf, sizeof(buf) - 1);
  klogctl(-1, buf, sizeof(buf) - 1);
  klogctl(0, (char *)-1, 0);
  klogctl(0, NULL, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%esi
mov    %edx,%edi
call   1030 <klogctl@plt>
lea    -0x410(%rbp),%rsi
mov    $0x3,%edi
mov    $0x3ff,%edx
call   1030 <klogctl@plt>
lea    -0x410(%rbp),%rsi
mov    $0xffffffff,%edi
mov    $0x3ff,%edx
call   1030 <klogctl@plt>
xor    %edx,%edx
mov    $0xffffffffffffffff,%rsi
mov    %edx,%edi
call   1030 <klogctl@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xffffffff,%edx
call   1030 <klogctl@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <klogctl@plt>
mov    %rsp,%rbx
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0x3ff,%edx
call   1030 <klogctl@plt>
mov    $0xffffffff,%edi
mov    %rbx,%rsi
mov    $0x3ff,%edx
call   1030 <klogctl@plt>
xor    %edi,%edi
mov    $0xffffffffffffffff,%rsi
xor    %edx,%edx
call   1030 <klogctl@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <klogctl@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = call i32 @klogctl(i32 0, i8* null, i32 0)
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @klogctl(i32 3, i8* %4, i32 1023)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = call i32 @klogctl(i32 -1, i8* %6, i32 1023)
%8 = call i32 @klogctl(i32 0, i8* inttoptr (i64 -1 to i8*), i32 0)
%9 = call i32 @klogctl(i32 0, i8* null, i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @klogctl(i32 0, i8* null, i32 0)
%4 = call i32 @klogctl(i32 3, i8* %2, i32 1023)
%5 = call i32 @klogctl(i32 -1, i8* %2, i32 1023)
%6 = call i32 @klogctl(i32 0, i8* inttoptr (i64 -1 to i8*), i32 0)
%7 = call i32 @klogctl(i32 0, i8* null, i32 -1)
ret i32 0
}
void av_pkt_dump_log2() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @l_geninit() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ inicio();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char sair;
  do {
    inicio();
    printf("\nDeseja continuar? y/n\n");
    scanf("%s", &sair);
  } while (sair != 'n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <inicio@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x6e,%eax
jne    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec3(%rip),%r14
lea    0xeb9(%rip),%r15
lea    0xf(%rsp),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <inicio@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpb   $0x6e,0xf(%rsp)
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0ADeseja continuar? y/n\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @inicio()
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %7
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 110
br i1 %10, label %3, label %11
11: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [23 x i8] c"\0ADeseja continuar? y/n\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @inicio()
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 110
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_initialize_number_of_quaddobl_Laurentials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(563, &length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_quaddobl_Laurentials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x233,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_quaddobl_Laurentials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x233,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_initialize_number_of_quaddobl_Laurentials(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 563, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_quaddobl_Laurentials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 563, i32* %2, i32* undef, double* undef)
ret i32 %3
}
void TossimPacketModelC$GainRadioModel$setPendingTransmission(void) {
  CpmModelC$Model$setPendingTransmission();
}


x86 assembly (clang, -O0):
<TossimPacketModelC$GainRadioModel$setPendingTransmission>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CpmModelC$Model$setPendingTransmission@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TossimPacketModelC$GainRadioModel$setPendingTransmission>:
xor    %eax,%eax
jmp    1030 <CpmModelC$Model$setPendingTransmission@plt>

LLVM IR (-O0):
define void @"TossimPacketModelC$GainRadioModel$setPendingTransmission"() {
%1 = call i32 (...) @"CpmModelC$Model$setPendingTransmission"()
ret void
}

LLVM IR (-O2):
define void @"TossimPacketModelC$GainRadioModel$setPendingTransmission"() {
%1 = tail call i32 (...) @"CpmModelC$Model$setPendingTransmission"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
char __fpeek(FILE *fp) {
  char c = getc(fp);
  ungetc(c, fp);
  return c;
}


x86 assembly (clang, -O0):
<__fpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <ungetc@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fpeek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @__fpeek(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call signext i8 @getc(i32* %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i8 signext %6, i32* %7)
%9 = load i8, i8* %3
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @__fpeek(i32* nocapture %0) {
%2 = tail call signext i8 @getc(i32* %0)
%3 = tail call i32 @ungetc(i8 signext %2, i32* %0)
ret i8 %2
}
/* Variables and functions */
unsigned long get_num_from_fat(unsigned long);
unsigned short get_free_cul(void) {
  unsigned long i, tmpi;
  for (i = 2; i++; i < 0x600) {
    tmpi = get_num_from_fat(i);
    if (tmpi == 0)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_free_cul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1168 <get_free_cul+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <get_num_from_fat@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <get_free_cul+0x4e>
mov    -0x10(%rbp),%rax
mov    %ax,-0x2(%rbp)
jmp    116e <get_free_cul+0x5e>
jmp    1163 <get_free_cul+0x53>
jmp    1120 <get_free_cul+0x10>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_free_cul>:
push   %rbx
mov    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
test   %rbx,%rbx
je     1138 <get_free_cul+0x28>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <get_num_from_fat@plt>
test   %rax,%rax
jne    1120 <get_free_cul+0x10>
jmp    113c <get_free_cul+0x2c>
mov    $0xffff,%bx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @get_free_cul() {
%1 = alloca i16
%2 = alloca i64
%3 = alloca i64
store i64 2, i64* %2
br label %4
4: ; preds = %17, %0
%5 = load i64, i64* %2
%6 = add i64 %5, 1
store i64 %6, i64* %2
%7 = icmp ne i64 %5, 0
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = load i64, i64* %2
%10 = call i64 @get_num_from_fat(i64 %9)
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i64, i64* %2
%15 = trunc i64 %14 to i16
store i16 %15, i16* %1
br label %22
16: ; preds = %8
br label %17
17: ; preds = %16
%18 = load i64, i64* %2
%19 = icmp ult i64 %18, 1536
%20 = zext i1 %19 to i32
br label %4
21: ; preds = %4
store i16 -1, i16* %1
br label %22
22: ; preds = %21, %13
%23 = load i16, i16* %1
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @get_free_cul() {
br label %1
1: ; preds = %5, %0
%2 = phi i64 [ 2, %0 ], [ %3, %5 ]
%3 = add i64 %2, 1
%4 = icmp eq i64 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = tail call i64 @get_num_from_fat(i64 %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %1
8: ; preds = %5
%9 = trunc i64 %3 to i16
br label %10
10: ; preds = %1, %8
%11 = phi i16 [ %9, %8 ], [ -1, %1 ]
ret i16 %11
}
/* Variables and functions */
void *calloc(int, size_t);
void *default_alloc(size_t size, int zero, void *user_data) {
  (void)user_data;
  (void)zero;
  return calloc(1, size);
}


x86 assembly (clang, -O0):
<default_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_alloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @default_alloc(i64 %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
int /*<<< orphan*/ WindVelocityActualHandle();
void WindVelocityActualUpdated() { UAVObjUpdated(WindVelocityActualHandle()); }


x86 assembly (clang, -O0):
<WindVelocityActualUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <WindVelocityActualHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WindVelocityActualUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <WindVelocityActualHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @WindVelocityActualUpdated() {
%1 = call i32 (...) @WindVelocityActualHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @WindVelocityActualUpdated() {
%1 = tail call i32 (...) @WindVelocityActualHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int grade_gpu_simon_domain(int domain, int mv, int temperature) { return 0; }


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

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

LLVM IR (-O0):
define i32 @grade_gpu_simon_domain(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
ret i32 0
}

LLVM IR (-O2):
define i32 @grade_gpu_simon_domain(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void prbits32(u_int32_t u) {
  u_int32_t i = 32;
  for (; i--; putchar(u & 1 << i ? '1' : '0'))
    ;
  printf("\n");
}


x86 assembly (clang, -O0):
<prbits32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1177 <prbits32+0x57>
jmp    114b <prbits32+0x2b>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1132 <prbits32+0x12>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prbits32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1f,%ebp
nopw   0x0(%rax,%rax,1)
bt     %ebp,%ebx
mov    $0x31,%edi
adc    $0xffffffff,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jb     1120 <prbits32+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @prbits32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 32, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = add nsw i32 %5, -1
store i32 %6, i32* %3
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %19
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = shl i32 1, %11
%13 = and i32 %10, %12
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 49, i32 48
%17 = trunc i32 %16 to i8
%18 = call i32 @putchar(i8 signext %17)
br label %4
19: ; preds = %4
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @prbits32(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 31, %1 ], [ %9, %2 ]
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8 48, i8 49
%8 = tail call i32 @putchar(i8 signext %7)
%9 = add nsw i32 %3, -1
%10 = icmp eq i32 %3, 0
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ BubbleSort(int *, int);
int /*<<< orphan*/ println(int *, int);
int main() {
  int array[] = {21, 25, 49, 25, 16, 8};
  int len = sizeof(array) / sizeof(*array);
  println(array, len);
  BubbleSort(array, len);
  println(array, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <println@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <BubbleSort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <println@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <BubbleSort@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [6 x i32] [i32 21, i32 25, i32 49, i32 25, i32 16, i32 8]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
store i32 6, i32* %3
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @println(i32* %5, i32 %6)
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @BubbleSort(i32* %8, i32 %9)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @println(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [6 x i32] [i32 21, i32 25, i32 49, i32 25, i32 16, i32 8]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @println(i32* %3, i32 6)
%5 = call i32 @BubbleSort(i32* %3, i32 6)
%6 = call i32 @println(i32* %3, i32 6)
ret i32 0
}
/* Variables and functions */
unsigned char msg_send(int, unsigned char *, int);
unsigned char ANT_ResetSystem(void) {
  unsigned char filler = 0;
  return msg_send(0x4a, &filler, 1);
}


x86 assembly (clang, -O0):
<ANT_ResetSystem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x4a,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <msg_send@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANT_ResetSystem>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x4a,%edi
mov    $0x1,%edx
call   1030 <msg_send@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @ANT_ResetSystem() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call zeroext i8 @msg_send(i32 74, i8* %1, i32 1)
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @ANT_ResetSystem() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call zeroext i8 @msg_send(i32 74, i8* %1, i32 1)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ mergesort(int /*<<< orphan*/, int);
int /*<<< orphan*/ print();
int main(void) {
  mergesort(0, 8 - 1);
  print();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x7,%esi
call   1040 <mergesort@plt>
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @mergesort(i32 0, i32 7)
%2 = tail call i32 (...) @print()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwscanf(int /*<<< orphan*/ *, int /*<<< orphan*/ *, ...);
void uninitvar_fwscanf(void) {
  FILE *stream;
  wchar_t *format1, *format2;
  int i;
  (void)fwscanf(stream, format1);
  (void)fwscanf(stream, format2, &i);
}


x86 assembly (clang, -O0):
<uninitvar_fwscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <fwscanf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1030 <fwscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fwscanf>:
push   %rax
xor    %eax,%eax
call   1030 <fwscanf@plt>
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <fwscanf@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @uninitvar_fwscanf() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = call i32 (i32*, i32*, ...) @fwscanf(i32* %5, i32* %6)
%8 = load i32*, i32** %1
%9 = load i32*, i32** %3
%10 = call i32 (i32*, i32*, ...) @fwscanf(i32* %8, i32* %9, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fwscanf() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i32*, i32*, ...) @fwscanf(i32* undef, i32* undef)
%4 = call i32 (i32*, i32*, ...) @fwscanf(i32* undef, i32* undef, i32* %1)
ret void
}
long call_with_3_arg(int (*func)(), int argc, char **argv) {
  long ret;
  __asm__ __volatile__("movq %4,%%rdx\n\t"
                       "movq %3,%%rsi\n\t"
                       "movq %2,%%rdi\n\t"
                       "xor %%rax,%%rax\n\t"
                       "call *%1\n\t"
                       "movq %%rax, %0"
                       : "=r"(ret)
                       : "r"(func), "m"(argv[3]), "m"(argv[4]), "m"(argv[5])
                       : "rax", "rcx", "rdx", "rsi", "rdi");
  return ret;
}


x86 assembly (clang, -O0):
<call_with_3_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%r8
mov    -0x18(%rbp),%r9
add    $0x18,%r9
mov    -0x18(%rbp),%r10
add    $0x20,%r10
mov    -0x18(%rbp),%r11
add    $0x28,%r11
mov    (%r11),%rdx
mov    (%r10),%rsi
mov    (%r9),%rdi
xor    %rax,%rax
call   *%r8
mov    %rax,%r8
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_with_3_arg>:
mov    %rdx,%r8
mov    %rdi,%r9
mov    0x28(%r8),%rdx
mov    0x20(%r8),%rsi
mov    0x18(%r8),%rdi
xor    %rax,%rax
call   *%r9
mov    %rax,%r8
mov    %r8,%rax
ret

LLVM IR (-O0):
define i64 @call_with_3_arg(i32 (...)* %0, i32 %1, i8** %2) {
%4 = alloca i32 (...)*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i64
store i32 (...)* %0, i32 (...)** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i32 (...)*, i32 (...)** %4
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 3
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 4
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 5
%15 = call i64 asm sideeffect "movq $4,%rdx\0A\09movq $3,%rsi\0A\09movq $2,%rdi\0A\09xor %rax,%rax\0A\09call *$1\0A\09movq %rax, $0", "=r,r,*m,*m,*m,~{rax},~{rcx},~{rdx},~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"(i32 (...)* %8, i8** elementtype(i8*) %10, i8** elementtype(i8*) %12, i8** elementtype(i8*) %14)
store i64 %15, i64* %7
%16 = load i64, i64* %7
ret i64 %16
}

LLVM IR (-O2):
define i64 @call_with_3_arg(i32 (...)* %0, i32 %1, i8** %2) {
%4 = getelementptr inbounds i8*, i8** %2, i64 3
%5 = getelementptr inbounds i8*, i8** %2, i64 4
%6 = getelementptr inbounds i8*, i8** %2, i64 5
%7 = tail call i64 asm sideeffect "movq $4,%rdx\0A\09movq $3,%rsi\0A\09movq $2,%rdi\0A\09xor %rax,%rax\0A\09call *$1\0A\09movq %rax, $0", "=r,r,*m,*m,*m,~{rax},~{rcx},~{rdx},~{rsi},~{rdi},~{dirflag},~{fpsr},~{flags}"(i32 (...)* %0, i8** elementtype(i8*) %4, i8** elementtype(i8*) %5, i8** elementtype(i8*) %6)
ret i64 %7
}
/* Variables and functions */
int FALSE;
int TRUE;
int can_map_water(int terrain) {
  switch (terrain) {
  case 7:
  case 6:
  case 5:
    return FALSE;
  default:
    return TRUE;
  }
}


x86 assembly (clang, -O0):
<can_map_water>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x2,%eax
ja     112c <can_map_water+0x2c>
jmp    111b <can_map_water+0x1b>
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <can_map_water+0x38>
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_map_water>:
add    $0xfffffffb,%edi
cmp    $0x3,%edi
jae    1112 <can_map_water+0x12>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @can_map_water(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 7, label %5
i32 6, label %5
i32 5, label %5
]
5: ; preds = %1, %1, %1
%6 = load i32, i32* @FALSE
store i32 %6, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* @TRUE
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @can_map_water(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, 3
%4 = load i32, i32* @FALSE
%5 = load i32, i32* @TRUE
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
char charFix(char);
void nameCpy(char *p, char *q) {
  while (*p = charFix(*q))
    ++p, ++q;
}


x86 assembly (clang, -O0):
<nameCpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <charFix@plt>
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1157 <nameCpy+0x47>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <nameCpy+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nameCpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
movsbl (%rsi),%edi
call   1030 <charFix@plt>
mov    %al,(%r15)
test   %al,%al
je     1146 <nameCpy+0x36>
mov    $0x1,%ebx
nop
movsbl (%r14,%rbx,1),%edi
call   1030 <charFix@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
test   %al,%al
jne    1130 <nameCpy+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @nameCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call signext i8 @charFix(i8 signext %3)
store i8 %4, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %10, %6 ], [ %1, %2 ]
%8 = phi i8* [ %9, %6 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = tail call signext i8 @charFix(i8 signext %11)
store i8 %12, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int foo2();
int foo1() {
  int b1 = 2;
  return foo2() + b1;
}


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

x86 assembly (clang, -O2):
<foo1>:
push   %rax
xor    %eax,%eax
call   1030 <foo2@plt>
add    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo1() {
%1 = alloca i32
store i32 2, i32* %1
%2 = call i32 (...) @foo2()
%3 = load i32, i32* %1
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo1() {
%1 = tail call i32 (...) @foo2()
%2 = add nsw i32 %1, 2
ret i32 %2
}
void fd86(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  a : {
    typedef int(*c)[n];
  P012A:
    goto P012A;
    0;
  }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  p01C:
    goto p01C;
    goto a;
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd86>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd86+0x7>

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

LLVM IR (-O0):
define void @fd86(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %10, %7
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %15, %12
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd86(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ Direct(int);
int /*<<< orphan*/ TRB8(int /*<<< orphan*/);
void Op14M1(void) { TRB8(Direct(3)); }


x86 assembly (clang, -O0):
<Op14M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
call   1040 <TRB8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op14M1>:
push   %rax
mov    $0x3,%edi
call   1030 <Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <TRB8@plt>

LLVM IR (-O0):
define void @Op14M1() {
%1 = call i32 @Direct(i32 3)
%2 = call i32 @TRB8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op14M1() {
%1 = tail call i32 @Direct(i32 3)
%2 = tail call i32 @TRB8(i32 %1)
ret void
}
char num2nibble(int num) {
  if (num < 0 || num > 16)
    return ('0');
  if (num < 10)
    return (num + '0');
  return (num - 10 + 'A');
}


x86 assembly (clang, -O0):
<num2nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111b <num2nibble+0x1b>
cmpl   $0x10,-0x8(%rbp)
jle    1124 <num2nibble+0x24>
movb   $0x30,-0x1(%rbp)
jmp    1148 <num2nibble+0x48>
cmpl   $0xa,-0x8(%rbp)
jge    113c <num2nibble+0x3c>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1148 <num2nibble+0x48>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num2nibble>:
mov    $0x30,%al
cmp    $0x10,%edi
ja     1118 <num2nibble+0x18>
cmp    $0x9,%edi
ja     1112 <num2nibble+0x12>
add    $0x30,%dil
jmp    1116 <num2nibble+0x16>
add    $0x37,%dil
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @num2nibble(i32 %0) {
%2 = icmp ugt i32 %0, 16
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 10
%5 = trunc i32 %0 to i8
br i1 %4, label %6, label %8
6: ; preds = %3
%7 = add nuw nsw i8 %5, 48
br label %10
8: ; preds = %3
%9 = add nuw nsw i8 %5, 55
br label %10
10: ; preds = %1, %8, %6
%11 = phi i8 [ %7, %6 ], [ %9, %8 ], [ 48, %1 ]
ret i8 %11
}
void do_nsap(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
}


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

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

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

LLVM IR (-O2):
define void @do_nsap(i32 %0, i8** nocapture %1) {
ret void
}
int multiplicacion(int a, int b) {
  int resultado;
  int i;
  for (i = 1; i <= b; i = i + 1) {
    resultado = resultado + a;
  }
  return resultado;
}


x86 assembly (clang, -O0):
<multiplicacion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1134 <multiplicacion+0x34>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <multiplicacion+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multiplicacion(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int KEY_POWER;
int device_reboot_now(volatile char *key_pressed, int key_code) {
  static int presses = 0;
  if (key_code == KEY_POWER) {
    ++presses;
    return presses == 5;
  } else {
    presses = 0;
    return 0;
  }
}


x86 assembly (clang, -O0):
<device_reboot_now>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ee3(%rip),%rcx
cmp    (%rcx),%eax
jne    1143 <device_reboot_now+0x43>
mov    0x2f01(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef8(%rip)
cmpl   $0x5,0x2ef1(%rip)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <device_reboot_now+0x54>
movl   $0x0,0x2ed7(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_reboot_now>:
mov    0x2ef1(%rip),%rax
cmp    %esi,(%rax)
jne    1123 <device_reboot_now+0x23>
mov    0x2f13(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0a(%rip)
xor    %eax,%eax
cmp    $0x5,%ecx
sete   %al
ret
movl   $0x0,0x2ef7(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@device_reboot_now.presses = internal global i32 0
@KEY_POWER = global i32 0
define i32 @device_reboot_now(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* @KEY_POWER
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @device_reboot_now.presses
%11 = add nsw i32 %10, 1
store i32 %11, i32* @device_reboot_now.presses
%12 = load i32, i32* @device_reboot_now.presses
%13 = icmp eq i32 %12, 5
%14 = zext i1 %13 to i32
store i32 %14, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* @device_reboot_now.presses
store i32 0, i32* %3
br label %16
16: ; preds = %15, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@device_reboot_now.presses = internal unnamed_addr global i32 0
@KEY_POWER = global i32 0
define i32 @device_reboot_now(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @KEY_POWER
%4 = icmp eq i32 %3, %1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @device_reboot_now.presses
%7 = add nsw i32 %6, 1
store i32 %7, i32* @device_reboot_now.presses
%8 = icmp eq i32 %7, 5
%9 = zext i1 %8 to i32
br label %11
10: ; preds = %2
store i32 0, i32* @device_reboot_now.presses
br label %11
11: ; preds = %10, %5
%12 = phi i32 [ %9, %5 ], [ 0, %10 ]
ret i32 %12
}
void modif_rear_ext2modif_rear_unit() {}


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

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

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

LLVM IR (-O2):
define void @modif_rear_ext2modif_rear_unit() {
ret void
}
int test_imm_59uint16_reg(unsigned short val) {
  return ((val) & (0x59 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_59uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x59,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_59uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 89
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void printm(unsigned int address) {
  printf("mem 0x%08x = 0x%08x\n", address, *(unsigned int *)address);
}


x86 assembly (clang, -O0):
<printm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%eax
mov    (%rax),%edx
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printm>:
mov    %edi,%esi
mov    %edi,%eax
mov    (%rax),%edx
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"mem 0x%08x = 0x%08x\0A\00"
define void @printm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"mem 0x%08x = 0x%08x\0A\00"
define void @printm(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(char);
extern void sys_exit(char status) { exit(status); }


x86 assembly (clang, -O0):
<sys_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <exit@plt>

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

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

LLVM IR (-O2):
define void @sys_exit(i8 signext %0) {
%2 = tail call i32 @exit(i8 signext %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ExportA();
int main() { ExportA(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ExportA@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @ExportA()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ExportA()
ret i32 0
}
long double test_logl(long double x) { return __builtin_logl(x); }


x86 assembly (clang, -O0):
<test_logl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logl>:
jmp    1030 <logl@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_logl(x86_fp80 %0) {
%2 = tail call x86_fp80 @logl(x86_fp80 %0)
ret x86_fp80 %2
}
int my_div(int nb1, int nb2) {
  int result;
  result = nb1 / nb2;
  return (result);
}


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

x86 assembly (clang, -O2):
<my_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @my_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int fn3(int a, int b) {
  int tem1 = a & b;
  int tem2 = b ^ a;
  return tem1 ^ tem2;
}


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

x86 assembly (clang, -O2):
<fn3>:
mov    %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}