xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("hello"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ io_hlt();
void task_b_main(void) {
  for (;;) {
    io_hlt();
  }
}


x86 assembly (clang, -O0):
<task_b_main>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <task_b_main+0x9>
mov    $0x0,%al
call   1030 <io_hlt@plt>
jmp    1119 <task_b_main+0x9>

x86 assembly (clang, -O2):
<task_b_main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_hlt@plt>
jmp    1120 <task_b_main+0x10>

LLVM IR (-O0):
define void @task_b_main() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @io_hlt()
br label %1
}

LLVM IR (-O2):
define void @task_b_main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @io_hlt()
br label %1
}
short foos(short x) { return -(x == 0); }


x86 assembly (clang, -O0):
<foos>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<foos>:
cmp    $0x1,%di
sbb    %eax,%eax
ret

LLVM IR (-O0):
define signext i16 @foos(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = sub nsw i32 0, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @foos(i16 signext %0) {
%2 = icmp eq i16 %0, 0
%3 = sext i1 %2 to i16
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpin(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x00));
}


x86 assembly (clang, -O0):
<read_pxpin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpin>:
shl    $0x8,%edi
mov    $0xb0010000,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 0
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpin(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = tail call i32 @readl(i8* %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ GLuint;

/* Variables and functions */
int /*<<< orphan*/ glListBase(int /*<<< orphan*/);
void ListBase(GLuint base) { glListBase(base); }


x86 assembly (clang, -O0):
<ListBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <glListBase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListBase>:
jmp    1030 <glListBase@plt>

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

LLVM IR (-O2):
define void @ListBase(i32 %0) {
%2 = tail call i32 @glListBase(i32 %0)
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int RLIMIT_STACK;
int getrlimit(int, struct rlimit *);
int main() {
  int resource = RLIMIT_STACK;
  struct rlimit *rlim;
  int ret = getrlimit(resource, rlim);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getrlimit@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getrlimit@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.rlimit*
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @RLIMIT_STACK
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = load %struct.rlimit*, %struct.rlimit** %3
%8 = call i32 @getrlimit(i32 %6, %struct.rlimit* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = load i32, i32* @RLIMIT_STACK
%2 = tail call i32 @getrlimit(i32 %1, %struct.rlimit* undef)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void _close_html_file(FILE *file) {
  fputs("\n</body>\n</html>\n", file);
  fclose(file);
}


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

x86 assembly (clang, -O2):
<_close_html_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0A</body>\0A</html>\0A\00"
define void @_close_html_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A</body>\0A</html>\0A\00"
define void @_close_html_file(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 17, i64 1, i32* %0)
%3 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M10_f(char *s) {
  debug("M10_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M10_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M10_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M10_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M10_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M10_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M10_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void early_mach_init(void) {}


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

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

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

LLVM IR (-O2):
define void @early_mach_init() {
ret void
}
int imin(int a, int b) {
  if (a <= b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <imin+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <imin+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *readString();
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int);
int readInteger() {
  char *s = readString();
  uint32_t val = (uint32_t)strtol(s, NULL, 10);
  free(s);
  return val;
}


x86 assembly (clang, -O0):
<readInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <readString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInteger>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <readString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readInteger() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* (...) @readString()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strtol(i8* %4, i32* null, i32 10)
store i32 %5, i32* %2
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @readInteger() {
%1 = tail call i8* (...) @readString()
%2 = tail call i32 @strtol(i8* nocapture %1, i32* null, i32 10)
%3 = tail call i32 @free(i8* %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex16(int, unsigned short);
void print_alert_hex16(unsigned short value) { __console_tx_hex16(1, value); }


x86 assembly (clang, -O0):
<print_alert_hex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1,%edi
movzwl -0x2(%rbp),%esi
call   1030 <__console_tx_hex16@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @print_alert_hex16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @__console_tx_hex16(i32 1, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_alert_hex16(i16 zeroext %0) {
%2 = tail call i32 @__console_tx_hex16(i32 1, i16 zeroext %0)
ret void
}
int get_header_len() { return 6; }


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

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

LLVM IR (-O0):
define i32 @get_header_len() {
ret i32 6
}

LLVM IR (-O2):
define i32 @get_header_len() {
ret i32 6
}
/* Type definitions */
struct evhttp_request {
  int dummy;
};
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evhttp_response_code(struct evhttp_request *, int,
                                        char const *);
int /*<<< orphan*/ evhttp_send(struct evhttp_request *, struct evbuffer *);
void evhttp_send_reply(struct evhttp_request *req, int code, const char *reason,
                       struct evbuffer *databuf) {
  evhttp_response_code(req, code, reason);
  evhttp_send(req, databuf);
}


x86 assembly (clang, -O0):
<evhttp_send_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <evhttp_response_code@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <evhttp_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evhttp_send_reply>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
call   1040 <evhttp_response_code@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <evhttp_send@plt>

LLVM IR (-O0):
%struct.evhttp_request = type { i32 }
%struct.evbuffer = type { i32 }
define void @evhttp_send_reply(%struct.evhttp_request* %0, i32 %1, i8* %2, %struct.evbuffer* %3) {
%5 = alloca %struct.evhttp_request*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca %struct.evbuffer*
store %struct.evhttp_request* %0, %struct.evhttp_request** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store %struct.evbuffer* %3, %struct.evbuffer** %8
%9 = load %struct.evhttp_request*, %struct.evhttp_request** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = call i32 @evhttp_response_code(%struct.evhttp_request* %9, i32 %10, i8* %11)
%13 = load %struct.evhttp_request*, %struct.evhttp_request** %5
%14 = load %struct.evbuffer*, %struct.evbuffer** %8
%15 = call i32 @evhttp_send(%struct.evhttp_request* %13, %struct.evbuffer* %14)
ret void
}

LLVM IR (-O2):
%struct.evhttp_request = type { i32 }
%struct.evbuffer = type { i32 }
define void @evhttp_send_reply(%struct.evhttp_request* %0, i32 %1, i8* %2, %struct.evbuffer* %3) {
%5 = tail call i32 @evhttp_response_code(%struct.evhttp_request* %0, i32 %1, i8* %2)
%6 = tail call i32 @evhttp_send(%struct.evhttp_request* %0, %struct.evbuffer* %3)
ret void
}
/* Type definitions */
struct tm {
  int tm_wday;
};

/* Variables and functions */
int valid_tm_wday(const struct tm *date) {
  if (0 <= date->tm_wday && date->tm_wday <= 6)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<valid_tm_wday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    (%rcx),%eax
jg     112f <valid_tm_wday+0x2f>
mov    -0x10(%rbp),%rax
cmpl   $0x6,(%rax)
jg     112f <valid_tm_wday+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <valid_tm_wday+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_tm_wday>:
xor    %eax,%eax
cmpl   $0x7,(%rdi)
setb   %al
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @valid_tm_wday(%struct.tm* %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %3
%4 = load %struct.tm*, %struct.tm** %3
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp sle i32 0, %6
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load %struct.tm*, %struct.tm** %3
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp sle i32 %11, 6
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %15
14: ; preds = %8, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @valid_tm_wday(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 7
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ code;

/* Variables and functions */
int /*<<< orphan*/ __console_write(char const *, int);
void console_fuscia() {
  static const char code[] = {0x1b, '[', '3', '5', ';', '0', '1', 'm'};
  __console_write(code, sizeof(code));
}


x86 assembly (clang, -O0):
<console_fuscia>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
call   1030 <__console_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_fuscia>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <__console_write@plt>

LLVM IR (-O0):
@console_fuscia.code = internal constant [8 x i8] c"\1B[35;01m"
define void @console_fuscia() {
%1 = call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_fuscia.code, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@console_fuscia.code = internal constant [8 x i8] c"\1B[35;01m"
define void @console_fuscia() {
%1 = tail call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_fuscia.code, i64 0, i64 0), i32 8)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ispow2(uint32_t x) { return (x & (x - 1)) == 0; }


x86 assembly (clang, -O0):
<ispow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispow2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ispow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ispow2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_29uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x29 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_29uint64_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, 41
%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_29uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 41
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void INT_Excep_PERIB_INTB201(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB201() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum_vector(int *, int);
int main() {
  int vec[] = {2, 4, 5, 5};
  printf("Sum = %d", sum_vector(vec, 3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <sum_vector@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1040 <sum_vector@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.vec = [4 x i32] [i32 2, i32 4, i32 5, i32 5]
@.str = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @sum_vector(i32* %3, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int test_imm_3Buint16_mem(unsigned short *val) {
  return ((*val) & (-0x3B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Buint16_mem>:
movzwl (%rdi),%eax
test   $0xffc5,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -59
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ECRYPT_init(void *arg1, void *arg2, void *arg3, void *arg4) { return; }


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

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

LLVM IR (-O0):
define void @ECRYPT_init(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
define void @ECRYPT_init(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
ret void
}
void main(void) { ; }


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void yodel_checksum(uint8_t ch, uint8_t *csap, uint8_t *csbp) {
  *csap += ch;
  *csbp += *csap;
}


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

x86 assembly (clang, -O2):
<yodel_checksum>:
add    (%rsi),%rdi
mov    %rdi,(%rsi)
add    %rdi,(%rdx)
ret

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

LLVM IR (-O2):
define void @yodel_checksum(i64 %0, i64* nocapture %1, i64* nocapture %2) {
%4 = load i64, i64* %1
%5 = add nsw i64 %4, %0
store i64 %5, i64* %1
%6 = load i64, i64* %2
%7 = add nsw i64 %6, %5
store i64 %7, i64* %2
ret void
}
void XtGetSelectionValues() {}


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

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

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

LLVM IR (-O2):
define void @XtGetSelectionValues() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void write_yes(int fd) { write(fd, "yes\n", 4); }


x86 assembly (clang, -O0):
<write_yes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_yes>:
lea    0xee9(%rip),%rsi
mov    $0x4,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"yes\0A\00"
define void @write_yes(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_i1();
int /*<<< orphan*/ take_struct_i1(int /*<<< orphan*/);
void test_struct_i1() { take_struct_i1(return_struct_i1()); }


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

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

LLVM IR (-O0):
define void @test_struct_i1() {
%1 = call i32 (...) @return_struct_i1()
%2 = call i32 @take_struct_i1(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_i1() {
%1 = tail call i32 (...) @return_struct_i1()
%2 = tail call i32 @take_struct_i1(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "USAGE: arith [e|d] INPUTFILE\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"USAGE: arith [e|d] INPUTFILE\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"USAGE: arith [e|d] INPUTFILE\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long foo(unsigned char c) {
  unsigned long l;
  unsigned int i;
  i = ((unsigned int)c) << 8;
  i |= ((unsigned int)c) << 20;
  asm volatile("" :::);
  i = i & 0x0fe0fe00;
  asm volatile("" :::);
  l = (unsigned long)i;
  return l;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x14,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xfe0fe00,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
imul   $0x100100,%edi,%eax
and    $0xfe0fe00,%eax
ret

LLVM IR (-O0):
define i64 @foo(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
store i32 %7, i32* %4
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 20
%11 = load i32, i32* %4
%12 = or i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = and i32 %13, 266403328
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
store i64 %16, i64* %3
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @foo(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = mul nuw nsw i64 %2, 1048832
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%4 = and i64 %3, 266403328
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void checkEndianness() {
  unsigned int i = 1;
  char *c = (char *)&i;
  if (*c) {
    printf("little endian\n");
  } else {
    printf("big endian\n");
  }
}


x86 assembly (clang, -O0):
<checkEndianness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <checkEndianness+0x35>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <checkEndianness+0x41>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"little endian\0A\00"
@.str.1 = [12 x i8] c"big endian\0A\00"
define void @checkEndianness() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"little endian\00"
define void @checkEndianness() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ plus(int);
int main() {
  plus(100);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @plus(i32 100)
ret i32 0
}
__attribute__((no, noclone)) signed __int128 t141_3sub(unsigned __int128 y) {
  signed __int128 r;
  if (__builtin_sub_overflow(
          (signed __int128)((
              (signed __int128)(((unsigned __int128)1 << (16 * 8 - 1)) - 1))),
          y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t141_3sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    %edx,%r9d
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
sub    %rax,%rdx
mov    %r9,%r8
sbb    %r8,%r8
sbb    %r9,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
not    %rcx
mov    %rdx,%rdi
shr    $0x3f,%rdi
xor    %rdi,%rsi
or     %rsi,%rax
setne  %al
mov    %rdx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
test   $0x1,%al
jne    1195 <t141_3sub+0x85>
jmp    119c <t141_3sub+0x8c>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t141_3sub>:
mov    %rdi,%rax
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
sub    %rsi,%rdx
not    %rax
ret

LLVM IR (-O0):
define { i64, i64 } @t141_3sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = zext i128 %11 to i129
%13 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 170141183460469231731687303715884105727, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = sext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t141_3sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sub nsw i129 170141183460469231731687303715884105727, %7
%9 = trunc i129 %8 to i64
%10 = lshr i129 %8, 64
%11 = trunc i129 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t htons(uint16_t val) { return (val << 8) | (val >> 8); }


x86 assembly (clang, -O0):
<htons>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<htons>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @htons(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @htons(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
int test_imm_5Fint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x5F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Fint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6225920
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_5Auint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x5A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Auint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 90
%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_5Auint64_highword_reg(i64 %0) {
%2 = and i64 %0, 386547056640
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void amaret_local_A1_set__E() { printf("Pin:set\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"Pin:set\00"
define void @amaret_local_A1_set__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct lwan_strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lwan_strbuf_append_printf(struct lwan_strbuf *, char *,
                                             double);
void lwan_append_double_to_strbuf(struct lwan_strbuf *buf, void *ptr) {
  lwan_strbuf_append_printf(buf, "%f", *(double *)ptr);
}


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

x86 assembly (clang, -O2):
<lwan_append_double_to_strbuf>:
movsd  (%rsi),%xmm0
lea    0xee5(%rip),%rsi
jmp    1030 <lwan_strbuf_append_printf@plt>

LLVM IR (-O0):
%struct.lwan_strbuf = type { i32 }
@.str = [3 x i8] c"%f\00"
define void @lwan_append_double_to_strbuf(%struct.lwan_strbuf* %0, i8* %1) {
%3 = alloca %struct.lwan_strbuf*
%4 = alloca i8*
store %struct.lwan_strbuf* %0, %struct.lwan_strbuf** %3
store i8* %1, i8** %4
%5 = load %struct.lwan_strbuf*, %struct.lwan_strbuf** %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = call i32 @lwan_strbuf_append_printf(%struct.lwan_strbuf* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}

LLVM IR (-O2):
%struct.lwan_strbuf = type { i32 }
@.str = [3 x i8] c"%f\00"
define void @lwan_append_double_to_strbuf(%struct.lwan_strbuf* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to double*
%4 = load double, double* %3
%5 = tail call i32 @lwan_strbuf_append_printf(%struct.lwan_strbuf* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}
int get_rtc_minute(void) {
  (*(volatile unsigned int *)(0x7E005040)) |= (1 << 3);
  (*(volatile unsigned int *)(0x7E005040)) = 1;
  char value = (*(volatile unsigned int *)(0x7E005074));
  int minute = ((value >> 4) & 0x7) * 10 + (value & 0xF);
  (*(volatile unsigned int *)(0x7E005040)) = 0;
  return minute;
}


x86 assembly (clang, -O0):
<get_rtc_minute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e005040,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x7e005040,%eax
mov    %ecx,(%rax)
mov    $0x7e005040,%eax
movl   $0x1,(%rax)
mov    $0x7e005074,%eax
mov    (%rax),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0x7,%eax
imul   $0xa,%eax,%eax
movsbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7e005040,%eax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rtc_minute>:
orl    $0x8,0x7e005040
08
movl   $0x1,0x7e005040
mov    0x7e005074,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
and    $0x7,%ecx
lea    (%rcx,%rcx,4),%ecx
and    $0xf,%eax
lea    (%rax,%rcx,2),%eax
movl   $0x0,0x7e005040
ret

LLVM IR (-O0):
define i32 @get_rtc_minute() {
%1 = alloca i8
%2 = alloca i32
%3 = load volatile i32, i32* inttoptr (i64 2113949760 to i32*)
%4 = or i32 %3, 8
store volatile i32 %4, i32* inttoptr (i64 2113949760 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113949760 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 2113949812 to i32*)
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = and i32 %9, 7
%11 = mul nsw i32 %10, 10
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = and i32 %13, 15
%15 = add nsw i32 %11, %14
store i32 %15, i32* %2
store volatile i32 0, i32* inttoptr (i64 2113949760 to i32*)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_rtc_minute() {
%1 = load volatile i32, i32* inttoptr (i64 2113949760 to i32*)
%2 = or i32 %1, 8
store volatile i32 %2, i32* inttoptr (i64 2113949760 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113949760 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 2113949812 to i32*)
%4 = lshr i32 %3, 4
%5 = and i32 %4, 7
%6 = mul nuw nsw i32 %5, 10
%7 = and i32 %3, 15
%8 = add nuw nsw i32 %6, %7
store volatile i32 0, i32* inttoptr (i64 2113949760 to i32*)
ret i32 %8
}
unsigned int str_hash(const char *s) {
  unsigned int key = 0;
  while (*s)
    key = key * 37 + *s++;
  return key;
}


x86 assembly (clang, -O0):
<str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <str_hash+0x3c>
imul   $0x25,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <str_hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%edx
lea    (%rax,%rdx,4),%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @str_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 37
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
INSTR(MACL) { LOG_FATAL("MACL not implemented"); }


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

x86 assembly (clang, -O2):
<INSTR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <LOG_FATAL@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"MACL not implemented\00"
define i32 @INSTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @LOG_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [21 x i8] c"MACL not implemented\00"
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @LOG_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_report_power_status(const struct cec_msg *msg, __u8 *pwr_state) {
  *pwr_state = msg->msg[2];
}


x86 assembly (clang, -O0):
<cec_ops_report_power_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_ops_report_power_status>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_report_power_status(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_report_power_status(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
int test_imm_6Buint32_reg(unsigned int val) {
  return ((val) & (0x6B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Buint32_reg(i32 %0) {
%2 = and i32 %0, 107
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FOURCC(char, unsigned char, char, char);
int /*<<< orphan*/ NodeUnRegisterClass(int /*<<< orphan*/);
void Audio_Done() { NodeUnRegisterClass(FOURCC('A', 'U', 'D', 'I')); }


x86 assembly (clang, -O0):
<Audio_Done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
mov    $0x55,%esi
mov    $0x44,%edx
mov    $0x49,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
call   1040 <NodeUnRegisterClass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Audio_Done>:
push   %rax
mov    $0x41,%edi
mov    $0x55,%esi
mov    $0x44,%edx
mov    $0x49,%ecx
call   1030 <FOURCC@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <NodeUnRegisterClass@plt>

LLVM IR (-O0):
define void @Audio_Done() {
%1 = call i32 @FOURCC(i8 signext 65, i8 zeroext 85, i8 signext 68, i8 signext 73)
%2 = call i32 @NodeUnRegisterClass(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Audio_Done() {
%1 = tail call i32 @FOURCC(i8 signext 65, i8 zeroext 85, i8 signext 68, i8 signext 73)
%2 = tail call i32 @NodeUnRegisterClass(i32 %1)
ret void
}