xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char UART0_GetChar();
unsigned char getc(void) { return UART0_GetChar(); }


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

x86 assembly (clang, -O2):
<getc>:
xor    %eax,%eax
jmp    1030 <UART0_GetChar@plt>

LLVM IR (-O0):
define zeroext i8 @getc() {
%1 = call zeroext i8 (...) @UART0_GetChar()
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @getc() {
%1 = tail call zeroext i8 (...) @UART0_GetChar()
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Out(int, int, char *);
void LCD_sum_reset() { Lcd_Out(3, 6, "     "); }


x86 assembly (clang, -O0):
<LCD_sum_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x6,%esi
lea    0xedb(%rip),%rdx
call   1030 <Lcd_Out@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_sum_reset>:
lea    0xee9(%rip),%rdx
mov    $0x3,%edi
mov    $0x6,%esi
jmp    1030 <Lcd_Out@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c" \00"
define void @LCD_sum_reset() {
%1 = tail call i32 @Lcd_Out(i32 3, i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
struct modemchannel {
  int dummy;
};

/* Variables and functions */
void p3dreceive(struct modemchannel *chan, const unsigned char *pkt,
                u_int16_t crc) {}


x86 assembly (clang, -O0):
<p3dreceive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.modemchannel = type { i32 }
define void @p3dreceive(%struct.modemchannel* %0, i8* %1, i32 %2) {
%4 = alloca %struct.modemchannel*
%5 = alloca i8*
%6 = alloca i32
store %struct.modemchannel* %0, %struct.modemchannel** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.modemchannel = type { i32 }
define void @p3dreceive(%struct.modemchannel* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
unsigned dot_matrix_3x_generic_output_fmts(unsigned input_fmts) {
  return input_fmts;
}


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

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

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

LLVM IR (-O2):
define i32 @dot_matrix_3x_generic_output_fmts(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int INTERNAL_SSL_INIT();
int SSLAvailable() { return (INTERNAL_SSL_INIT()); }


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

x86 assembly (clang, -O2):
<SSLAvailable>:
xor    %eax,%eax
jmp    1030 <INTERNAL_SSL_INIT@plt>

LLVM IR (-O0):
define i32 @SSLAvailable() {
%1 = call i32 (...) @INTERNAL_SSL_INIT()
ret i32 %1
}

LLVM IR (-O2):
define i32 @SSLAvailable() {
%1 = tail call i32 (...) @INTERNAL_SSL_INIT()
ret i32 %1
}
/* Variables and functions */
char *getenv(char const *);
char *fossil_getenv(const char *zName) {
  char *zValue = getenv(zName);
  return zValue;
}


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

x86 assembly (clang, -O2):
<fossil_getenv>:
jmp    1030 <getenv@plt>

LLVM IR (-O0):
define i8* @fossil_getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @fossil_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void mov_reg16_m16(int reg16, unsigned short *m16) {
  put8(0x66);
  put8(0x8B);
  put8((reg16 << 3) | 5);
  put32((unsigned long)(m16));
}


x86 assembly (clang, -O0):
<mov_reg16_m16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg16_m16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg16_m16(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i16*
store i32 %0, i32* %3
store i16* %1, i16** %4
%5 = call i32 @put8(i32 102)
%6 = call i32 @put8(i32 139)
%7 = load i32, i32* %3
%8 = shl i32 %7, 3
%9 = or i32 %8, 5
%10 = call i32 @put8(i32 %9)
%11 = load i16*, i16** %4
%12 = ptrtoint i16* %11 to i64
%13 = call i32 @put32(i64 %12)
ret void
}

LLVM IR (-O2):
define void @mov_reg16_m16(i32 %0, i16* %1) {
%3 = tail call i32 @put8(i32 102)
%4 = tail call i32 @put8(i32 139)
%5 = shl i32 %0, 3
%6 = or i32 %5, 5
%7 = tail call i32 @put8(i32 %6)
%8 = ptrtoint i16* %1 to i64
%9 = tail call i32 @put32(i64 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_message(char *, unsigned int);
void cmprintf_group_start_standard(const size_t num_tests) {
  print_message("[==========] Running %u test(s).\n", (unsigned)num_tests);
}


x86 assembly (clang, -O0):
<cmprintf_group_start_standard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xed7(%rip),%rdi
call   1030 <print_message@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"[==========] Running %u test(s).\0A\00"
define void @cmprintf_group_start_standard(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @print_message(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"[==========] Running %u test(s).\0A\00"
define void @cmprintf_group_start_standard(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @print_message(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void vtk_libport_dummy_function() { return; }


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

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

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

LLVM IR (-O2):
define void @vtk_libport_dummy_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int wait3(int *, int /*<<< orphan*/, int /*<<< orphan*/ *);
void sig_chld(int signal_type) {
  int pid;
  int status;
  while ((pid = wait3(&status, WNOHANG, NULL)) > 0)
    ;
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <wait3@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1142 <sig_chld+0x32>
jmp    111b <sig_chld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    (%r14),%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <wait3@plt>
test   %eax,%eax
jg     1120 <sig_chld+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @wait3(i32* %4, i32 %6, i32* null)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i32 @wait3(i32* %2, i32 %5, i32* null)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Variables and functions */
scalar_t__ pgm_read_byte(char const *);
int /*<<< orphan*/ sendbyte(scalar_t__);
void printROMStr(const char *str) {
  while (pgm_read_byte(str)) {
    sendbyte(pgm_read_byte(str));
    str++;
  }
}


x86 assembly (clang, -O0):
<printROMStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pgm_read_byte@plt>
cmp    $0x0,%rax
je     1161 <printROMStr+0x41>
mov    -0x8(%rbp),%rdi
call   1030 <pgm_read_byte@plt>
mov    %rax,%rdi
call   1040 <sendbyte@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <printROMStr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printROMStr>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <pgm_read_byte@plt>
test   %rax,%rax
je     1153 <printROMStr+0x33>
mov    %rbx,%rdi
call   1030 <pgm_read_byte@plt>
mov    %rax,%rdi
call   1040 <sendbyte@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
jmp    1130 <printROMStr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printROMStr(i8* %0) {
%2 = tail call i64 @pgm_read_byte(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %0, %1 ]
%6 = tail call i64 @pgm_read_byte(i8* %5)
%7 = tail call i32 @sendbyte(i64 %6)
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = tail call i64 @pgm_read_byte(i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct vector *);
int /*<<< orphan*/ vector_destroy(struct vector *);
void vector_delete(struct vector *__restrict vec) {
  vector_destroy(vec);
  free(vec);
}


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

x86 assembly (clang, -O2):
<vector_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <vector_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.vector = type { i32 }
define void @vector_delete(%struct.vector* noalias %0) {
%2 = alloca %struct.vector*
store %struct.vector* %0, %struct.vector** %2
%3 = load %struct.vector*, %struct.vector** %2
%4 = call i32 @vector_destroy(%struct.vector* %3)
%5 = load %struct.vector*, %struct.vector** %2
%6 = call i32 @free(%struct.vector* %5)
ret void
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define void @vector_delete(%struct.vector* noalias %0) {
%2 = tail call i32 @vector_destroy(%struct.vector* %0)
%3 = tail call i32 @free(%struct.vector* %0)
ret void
}
/* Type definitions */
struct virtqueue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_used(struct virtqueue *, unsigned int, int);
int /*<<< orphan*/ trigger_irq(struct virtqueue *);
void add_used_and_trigger(struct virtqueue *vq, unsigned head, int len) {
  add_used(vq, head, len);
  trigger_irq(vq);
}


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

x86 assembly (clang, -O2):
<add_used_and_trigger>:
push   %rbx
mov    %rdi,%rbx
call   1040 <add_used@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <trigger_irq@plt>

LLVM IR (-O0):
%struct.virtqueue = type { i32 }
define void @add_used_and_trigger(%struct.virtqueue* %0, i32 %1, i32 %2) {
%4 = alloca %struct.virtqueue*
%5 = alloca i32
%6 = alloca i32
store %struct.virtqueue* %0, %struct.virtqueue** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.virtqueue*, %struct.virtqueue** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @add_used(%struct.virtqueue* %7, i32 %8, i32 %9)
%11 = load %struct.virtqueue*, %struct.virtqueue** %4
%12 = call i32 @trigger_irq(%struct.virtqueue* %11)
ret void
}

LLVM IR (-O2):
%struct.virtqueue = type { i32 }
define void @add_used_and_trigger(%struct.virtqueue* %0, i32 %1, i32 %2) {
%4 = tail call i32 @add_used(%struct.virtqueue* %0, i32 %1, i32 %2)
%5 = tail call i32 @trigger_irq(%struct.virtqueue* %0)
ret void
}
/* Type definitions */
struct cminisock {
  int dummy;
};

/* Variables and functions */
int AckTCPCwnd(unsigned int, struct cminisock const *, void *);
int AckTCPCwndScalar(unsigned seq, const struct cminisock *cont) {
  return AckTCPCwnd(seq, cont, ((void *)0));
}


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

x86 assembly (clang, -O2):
<AckTCPCwndScalar>:
xor    %edx,%edx
jmp    1030 <AckTCPCwnd@plt>

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

LLVM IR (-O2):
%struct.cminisock = type { i32 }
define i32 @AckTCPCwndScalar(i32 %0, %struct.cminisock* %1) {
%3 = tail call i32 @AckTCPCwnd(i32 %0, %struct.cminisock* %1, i8* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
__attribute__((no)) void kunmap(void *addr) { printf("kunmap: %p\n", addr); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"kunmap: %p\0A\00"
define void @kunmap(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int yahoo_init_with_attributes(char const *, char const *,
                               int /*<<< orphan*/ *);
int yahoo_init(const char *username, const char *password) {
  return yahoo_init_with_attributes(username, password, NULL);
}


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

x86 assembly (clang, -O2):
<yahoo_init>:
xor    %edx,%edx
jmp    1030 <yahoo_init_with_attributes@plt>

LLVM IR (-O0):
define i32 @yahoo_init(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @yahoo_init_with_attributes(i8* %5, i8* %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @yahoo_init(i8* %0, i8* %1) {
%3 = tail call i32 @yahoo_init_with_attributes(i8* %0, i8* %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void xinit() { printf("constructor\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"constructor\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @xinit, i8* null }]
define void @xinit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @xinit, i8* null }]
@str = [12 x i8] c"constructor\00"
define void @xinit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int inputint(char *c) {
  int num;
  printf("%s\n", c);
  scanf("%d", &num);
  return num;
}


x86 assembly (clang, -O0):
<inputint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputint>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputint(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int shmdt(const void *shmaddr) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<shmdt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmdt>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @shmdt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @shmdt(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
void __attribute__((weak)) EXTI1_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI1_Callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a[5] = {5, 1, 15, 20, 25};
  int i, j, m;
  i = ++a[1];
  j = a[1]++;
  m = a[i++];
  printf("%d, %d, %d", i, j, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x24(%rbp)
cltq
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d, %d, %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3, i32 2, i32 15)
ret i32 0
}
/* Variables and functions */
int tolower(int /*<<< orphan*/);
int hashStr(const char *p) {
  int result = 0;
  while (*p != '\0') {
    result = (result * 17) + tolower(*p++);
  }
  return result;
}


x86 assembly (clang, -O0):
<hashStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <hashStr+0x50>
imul   $0x11,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hashStr+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashStr>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     114e <hashStr+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %cl,%edi
mov    %eax,%ebp
shl    $0x4,%ebp
add    %eax,%ebp
call   1030 <tolower@plt>
add    %ebp,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hashStr+0x20>
jmp    1150 <hashStr+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hashStr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %6, 17
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = tail call i32 @tolower(i32 %8)
%12 = add nsw i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int xstat(char *file, struct stat *sts) {
  if (stat(file, sts) == -1) {
    fprintf(stderr, "Error in stat function.\n");
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<xstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    1167 <xstat+0x47>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <xstat+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstat>:
push   %rax
call   1040 <stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <xstat+0x11>
pop    %rcx
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [25 x i8] c"Error in stat function.\0A\00"
define i32 @xstat(i8* %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.stat*
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i8*, i8** %4
%7 = load %struct.stat*, %struct.stat** %5
%8 = call i32 @stat(i8* %6, %struct.stat* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [25 x i8] c"Error in stat function.\0A\00"
define i32 @xstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %9
}
int test_imm_40int64_lowword_mem(long long *val) {
  return ((*val) & (0x40 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_40int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 64
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int SockAPI_PollEx(int, int, int *);
int SockAPI_Poll(int sd, int timeout_ms) {
  int haserror = 0;
  return SockAPI_PollEx(sd, timeout_ms, &haserror);
}


x86 assembly (clang, -O0):
<SockAPI_Poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdx
call   1030 <SockAPI_PollEx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SockAPI_Poll>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <SockAPI_PollEx@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @SockAPI_Poll(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @SockAPI_PollEx(i32 %0, i32 %1, i32* %3)
ret i32 %5
}
int fun1146() { return 1146; }


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

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

LLVM IR (-O0):
define i32 @fun1146() {
ret i32 1146
}

LLVM IR (-O2):
define i32 @fun1146() {
ret i32 1146
}
/* Variables and functions */
char *stpcpy(char *, char *);
size_t strlen(char *);
void stpcpy_effect(char *x, char *y) {
  char a = x[0];
  if (stpcpy(x, y) != &x[strlen(y)])
    (void)*(char *)0;
  if (strlen(x) != strlen(y))
    (void)*(char *)0;
  if (a != x[0])
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<stpcpy_effect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <stpcpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rcx
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
add    %rdx,%rcx
cmp    %rcx,%rax
je     1172 <stpcpy_effect+0x52>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
je     1198 <stpcpy_effect+0x78>
movsbl -0x11(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11ab <stpcpy_effect+0x8b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy_effect>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @stpcpy_effect(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i8* @stpcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = icmp ne i8* %11, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = load i8, i8* null
br label %19
19: ; preds = %17, %2
%20 = load i8*, i8** %3
%21 = call i64 @strlen(i8* %20)
%22 = load i8*, i8** %4
%23 = call i64 @strlen(i8* %22)
%24 = icmp ne i64 %21, %23
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = load i8, i8* null
br label %27
27: ; preds = %25, %19
%28 = load i8, i8* %5
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp ne i32 %29, %33
br i1 %34, label %35, label %37
35: ; preds = %27
%36 = load i8, i8* null
br label %37
37: ; preds = %35, %27
ret void
}

LLVM IR (-O2):
define void @stpcpy_effect(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_get_stack_value(unsigned int);
int /*<<< orphan*/ cpu_set_stack_value(unsigned int, unsigned int);
int /*<<< orphan*/ debug_break_for_watch(unsigned int, unsigned int,
                                         int /*<<< orphan*/);
void write_5200_stack_watch(unsigned int addr, unsigned int value) {
  debug_break_for_watch(addr, value, cpu_get_stack_value(addr & 0xff));
  cpu_set_stack_value(addr & 0xff, value);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <cpu_get_stack_value@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1050 <debug_break_for_watch@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%esi
call   1040 <cpu_set_stack_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
movzbl %bpl,%ebx
mov    %ebx,%edi
call   1030 <cpu_get_stack_value@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %eax,%edx
call   1050 <debug_break_for_watch@plt>
mov    %ebx,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cpu_set_stack_value@plt>

LLVM IR (-O0):
define void @write_5200_stack_watch(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 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = call i32 @cpu_get_stack_value(i32 %8)
%10 = call i32 @debug_break_for_watch(i32 %5, i32 %6, i32 %9)
%11 = load i32, i32* %3
%12 = and i32 %11, 255
%13 = load i32, i32* %4
%14 = call i32 @cpu_set_stack_value(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @write_5200_stack_watch(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @cpu_get_stack_value(i32 %3)
%5 = tail call i32 @debug_break_for_watch(i32 %0, i32 %1, i32 %4)
%6 = tail call i32 @cpu_set_stack_value(i32 %3, i32 %1)
ret void
}
void gint_error(s, n, o) int s;
char *n;
char *o;
{
  if (s == 1) {
    printf("Error: [%s] Value for %s was missing\n", o, n);
  } else if (s > 1) {
    printf("Error: [%s] Value for %s was NOT an integer\n", o, n);
  }
  return;
}


x86 assembly (clang, -O0):
<gint_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1148 <gint_error+0x38>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116d <gint_error+0x5d>
cmpl   $0x1,-0x4(%rbp)
jle    1168 <gint_error+0x58>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116d <gint_error+0x5d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gint_error>:
mov    %rsi,%rax
cmp    $0x1,%edi
jne    1121 <gint_error+0x11>
lea    0xee1(%rip),%rdi
jmp    112a <gint_error+0x1a>
jle    1137 <gint_error+0x27>
lea    0xefc(%rip),%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Error: [%s] Value for %s was missing\0A\00"
@.str.1 = [45 x i8] c"Error: [%s] Value for %s was NOT an integer\0A\00"
define void @gint_error(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
br label %21
13: ; preds = %3
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i8*, i8** %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %18)
br label %20
20: ; preds = %16, %13
br label %21
21: ; preds = %20, %9
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Error: [%s] Value for %s was missing\0A\00"
@.str.1 = [45 x i8] c"Error: [%s] Value for %s was NOT an integer\0A\00"
define void @gint_error(i32 %0, i8* %1, i8* %2) {
%4 = icmp eq i32 %0, 1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %10
7: ; preds = %5, %3
%8 = phi i8* [ getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), %5 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %8, i8* %2, i8* %1)
br label %10
10: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_ssumkbn2(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_ssumkbn2(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_ssumkbn2@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_ssumkbn2@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_ssumkbn2(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_ssumkbn2(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Type definitions */
struct mloop_idle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__idle_list_remove(struct mloop_idle *);
int /*<<< orphan*/ mloop__object_list_remove(struct mloop_idle *);
int mloop__idle_stop(struct mloop_idle *self) {
  mloop__idle_list_remove(self);
  mloop__object_list_remove(self);
  return 0;
}


x86 assembly (clang, -O0):
<mloop__idle_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mloop__idle_list_remove@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mloop__object_list_remove@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mloop__idle_stop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mloop__idle_list_remove@plt>
mov    %rbx,%rdi
call   1040 <mloop__object_list_remove@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mloop_idle = type { i32 }
define i32 @mloop__idle_stop(%struct.mloop_idle* %0) {
%2 = alloca %struct.mloop_idle*
store %struct.mloop_idle* %0, %struct.mloop_idle** %2
%3 = load %struct.mloop_idle*, %struct.mloop_idle** %2
%4 = call i32 @mloop__idle_list_remove(%struct.mloop_idle* %3)
%5 = load %struct.mloop_idle*, %struct.mloop_idle** %2
%6 = call i32 @mloop__object_list_remove(%struct.mloop_idle* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.mloop_idle = type { i32 }
define i32 @mloop__idle_stop(%struct.mloop_idle* %0) {
%2 = tail call i32 @mloop__idle_list_remove(%struct.mloop_idle* %0)
%3 = tail call i32 @mloop__object_list_remove(%struct.mloop_idle* %0)
ret i32 0
}
void bar_duang(void) {}


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

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

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

LLVM IR (-O2):
define void @bar_duang() {
ret void
}
jan1(yr) {
  register y, d;
  y = yr;
  d = 4 + y + (y + 3) / 4;
  if (y > 1800) {
    d = -(y - 1701) / 100;
    d = +(y - 1601) / 400;
  }
  if (y > 1752)
    d = +3;
  return (d % 7);
}


x86 assembly (clang, -O0):
<jan1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x708,-0x8(%rbp)
jle    1166 <jan1+0x66>
mov    -0x8(%rbp),%ecx
sub    $0x6a5,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x641,%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x6d8,-0x8(%rbp)
jle    117a <jan1+0x7a>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jan1>:
lea    0x3(%rdi),%ecx
lea    0x6(%rdi),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
cmp    $0x709,%edi
jl     1126 <jan1+0x26>
lea    -0x641(%rdi),%eax
imul   $0x51eb851f,%rax,%rcx
shr    $0x27,%rcx
jmp    112f <jan1+0x2f>
sar    $0x2,%eax
lea    (%rdi,%rax,1),%ecx
add    $0x4,%ecx
mov    $0x3,%eax
cmp    $0x6d8,%edi
jg     1161 <jan1+0x61>
movslq %ecx,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @jan1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 4, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 3
%10 = sdiv i32 %9, 4
%11 = add nsw i32 %7, %10
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 1800
br i1 %13, label %14, label %22
14: ; preds = %1
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1701
%17 = sub nsw i32 0, %16
%18 = sdiv i32 %17, 100
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 1601
%21 = sdiv i32 %20, 400
store i32 %21, i32* %4
br label %22
22: ; preds = %14, %1
%23 = load i32, i32* %3
%24 = icmp sgt i32 %23, 1752
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 3, i32* %4
br label %26
26: ; preds = %25, %22
%27 = load i32, i32* %4
%28 = srem i32 %27, 7
ret i32 %28
}

LLVM IR (-O2):
define i32 @jan1(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = add nsw i32 %0, 3
%4 = sdiv i32 %3, 4
%5 = add nsw i32 %2, %4
%6 = icmp sgt i32 %0, 1800
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = add nsw i32 %0, -1601
%9 = udiv i32 %8, 400
br label %10
10: ; preds = %7, %1
%11 = phi i32 [ %9, %7 ], [ %5, %1 ]
%12 = icmp sgt i32 %0, 1752
%13 = srem i32 %11, 7
%14 = select i1 %12, i32 3, i32 %13
ret i32 %14
}
/* Variables and functions */
scalar_t__ NextToken(char *);
int /*<<< orphan*/ SkipPair(char, char);
void SearchScopeForward() {
  if (NextToken("{")) {
    SkipPair('{', '}');
  }
}


x86 assembly (clang, -O0):
<SearchScopeForward>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <NextToken@plt>
cmp    $0x0,%rax
je     1149 <SearchScopeForward+0x29>
mov    $0x7b,%edi
mov    $0x7d,%esi
call   1030 <SkipPair@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SearchScopeForward>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <NextToken@plt>
test   %rax,%rax
je     1142 <SearchScopeForward+0x22>
mov    $0x7b,%edi
mov    $0x7d,%esi
pop    %rax
jmp    1030 <SkipPair@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
define void @SearchScopeForward() {
%1 = call i64 @NextToken(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @SkipPair(i8 signext 123, i8 signext 125)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"{\00"
define void @SearchScopeForward() {
%1 = tail call i64 @NextToken(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @SkipPair(i8 signext 123, i8 signext 125)
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct ln_equ_posn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ln_get_equ_pm_epoch(struct ln_equ_posn *,
                                       struct ln_equ_posn *, double, double,
                                       struct ln_equ_posn *);
void ln_get_equ_pm(struct ln_equ_posn *mean_position,
                   struct ln_equ_posn *proper_motion, double JD,
                   struct ln_equ_posn *position) {
  ln_get_equ_pm_epoch(mean_position, proper_motion, JD, 2451545.0, position);
}


x86 assembly (clang, -O0):
<ln_get_equ_pm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdx
movsd  0xebe(%rip),%xmm1
call   1030 <ln_get_equ_pm_epoch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_equ_pm>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <ln_get_equ_pm_epoch@plt>

LLVM IR (-O0):
%struct.ln_equ_posn = type { i32 }
define void @ln_get_equ_pm(%struct.ln_equ_posn* %0, %struct.ln_equ_posn* %1, double %2, %struct.ln_equ_posn* %3) {
%5 = alloca %struct.ln_equ_posn*
%6 = alloca %struct.ln_equ_posn*
%7 = alloca double
%8 = alloca %struct.ln_equ_posn*
store %struct.ln_equ_posn* %0, %struct.ln_equ_posn** %5
store %struct.ln_equ_posn* %1, %struct.ln_equ_posn** %6
store double %2, double* %7
store %struct.ln_equ_posn* %3, %struct.ln_equ_posn** %8
%9 = load %struct.ln_equ_posn*, %struct.ln_equ_posn** %5
%10 = load %struct.ln_equ_posn*, %struct.ln_equ_posn** %6
%11 = load double, double* %7
%12 = load %struct.ln_equ_posn*, %struct.ln_equ_posn** %8
%13 = call i32 @ln_get_equ_pm_epoch(%struct.ln_equ_posn* %9, %struct.ln_equ_posn* %10, double %11, double 0x4142B42C80000000, %struct.ln_equ_posn* %12)
ret void
}

LLVM IR (-O2):
%struct.ln_equ_posn = type { i32 }
define void @ln_get_equ_pm(%struct.ln_equ_posn* %0, %struct.ln_equ_posn* %1, double %2, %struct.ln_equ_posn* %3) {
%5 = tail call i32 @ln_get_equ_pm_epoch(%struct.ln_equ_posn* %0, %struct.ln_equ_posn* %1, double %2, double 0x4142B42C80000000, %struct.ln_equ_posn* %3)
ret void
}