xunge/DecIR huggingface dataset:
/* Variables and functions */
int casting();
scalar_t__ heir1(int *);
int /*<<< orphan*/ rvalue(int *);
expression() {
  int lval[2];
  int cast;
  cast = casting();
  if (heir1(lval))
    rvalue(lval);
  if (cast != -1)
    lval[1] = cast;
  return lval[1];
}


x86 assembly (clang, -O0):
<expression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <casting@plt>
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <heir1@plt>
cmp    $0x0,%rax
je     115e <expression+0x2e>
lea    -0x8(%rbp),%rdi
call   1040 <rvalue@plt>
cmpl   $0xffffffff,-0xc(%rbp)
je     116e <expression+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expression>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <casting@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1050 <heir1@plt>
test   %rax,%rax
je     1157 <expression+0x27>
lea    0x8(%rsp),%rdi
call   1040 <rvalue@plt>
cmp    $0xffffffff,%ebx
jne    1160 <expression+0x30>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @expression() {
%1 = alloca [2 x i32]
%2 = alloca i32
%3 = call i32 (...) @casting()
store i32 %3, i32* %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = call i64 @heir1(i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%9 = call i32 @rvalue(i32* %8)
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 %14, i32* %15
br label %16
16: ; preds = %13, %10
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%18 = load i32, i32* %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @expression() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = tail call i32 (...) @casting()
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = call i64 @heir1(i32* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @rvalue(i32* %4)
br label %9
9: ; preds = %7, %0
%10 = icmp eq i32 %3, -1
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%12 = load i32, i32* %11
%13 = select i1 %10, i32 %12, i32 %3
ret i32 %13
}
__attribute__((visibility("default"))) void callpic_mov(void) {}


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

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

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

LLVM IR (-O2):
define void @callpic_mov() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(char *);
void sockets_err(char *s) { err(s); }


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

x86 assembly (clang, -O2):
<sockets_err>:
jmp    1030 <err@plt>

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

LLVM IR (-O2):
define void @sockets_err(i8* %0) {
%2 = tail call i32 @err(i8* %0)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, ...);
int strlen(char *);
char *buildMsg(char *msg) {
  int len = strlen(msg);
  char *data = malloc(len + 1);
  memcpy(data, &len, 1);
  memcpy(data + 1, msg, len);
  return data;
}


x86 assembly (clang, -O0):
<buildMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildMsg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,0x4(%rsp)
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <memcpy@plt>
lea    0x1(%rbx),%rdi
mov    0x4(%rsp),%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <memcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @buildMsg(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @memcpy(i8* %10, i32* %3, i32 1)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @buildMsg(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @strlen(i8* %0)
store i32 %4, i32* %2
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = call i32 (i8*, ...) @memcpy(i8* %6, i32* %2, i32 1)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @memcpy(i8* %8, i8* %0, i32 %9)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int main() {
  int i = 1;
  func1();
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
ret i32 1
}
int test_imm_64uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x64 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_64uint64_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, 100
%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_64uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 100
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void term_control_seq_exec_api(const char c[]) {
  if (c)
    printf("%s", c);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<term_control_seq_exec_api>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <term_control_seq_exec_api+0x27>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_control_seq_exec_api>:
push   %rax
test   %rdi,%rdi
je     1135 <term_control_seq_exec_api+0x15>
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @term_control_seq_exec_api(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @term_control_seq_exec_api(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
ret void
}
/* Variables and functions */
char *lua_check_string(int, char *);
scalar_t__ lua_getparam(int);
char *lua_opt_string(int numArg, char *def, char *funcname) {
  return (lua_getparam(numArg) == 0) ? def : lua_check_string(numArg, funcname);
}


x86 assembly (clang, -O0):
<lua_opt_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lua_getparam@plt>
cmp    $0x0,%rax
jne    1152 <lua_opt_string+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <lua_opt_string+0x42>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <lua_check_string@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_opt_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <lua_getparam@plt>
test   %rax,%rax
je     1144 <lua_opt_string+0x24>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <lua_check_string@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @lua_opt_string(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 = call i64 @lua_getparam(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i8*, i8** %5
br label %16
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %6
%15 = call i8* @lua_check_string(i32 %13, i8* %14)
br label %16
16: ; preds = %12, %10
%17 = phi i8* [ %11, %10 ], [ %15, %12 ]
ret i8* %17
}

LLVM IR (-O2):
define i8* @lua_opt_string(i32 %0, i8* readnone %1, i8* %2) {
%4 = tail call i64 @lua_getparam(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @lua_check_string(i32 %0, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ %1, %3 ]
ret i8* %9
}
void f(int n) {
  if (n)
    f(n / 2), printf("%d ", n);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1158 <f+0x38>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <f@plt>
mov    -0x4(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     1144 <f+0x24>
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%edi
add    %ebx,%edi
sar    %edi
call   1030 <f@plt>
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = sdiv i32 %0, 2
tail call void @f(i32 %5)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void english_UTF_8_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<english_UTF_8_close_env>:
jmp    1030 <SN_close_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define void @english_UTF_8_close_env(%struct.SN_env* %0) {
%2 = alloca %struct.SN_env*
store %struct.SN_env* %0, %struct.SN_env** %2
%3 = load %struct.SN_env*, %struct.SN_env** %2
%4 = call i32 @SN_close_env(%struct.SN_env* %3)
ret void
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @english_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ opd_open_logfile();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sfile_close_files();
void opd_sighup(void) {
  printf("Received SIGHUP.\n");
  sfile_close_files();
  close(1);
  close(2);
  opd_open_logfile();
}


x86 assembly (clang, -O0):
<opd_sighup>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <sfile_close_files@plt>
mov    $0x1,%edi
call   1050 <close@plt>
mov    $0x2,%edi
call   1050 <close@plt>
mov    $0x0,%al
call   1060 <opd_open_logfile@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<opd_sighup>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <sfile_close_files@plt>
mov    $0x1,%edi
call   1050 <close@plt>
mov    $0x2,%edi
call   1050 <close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <opd_open_logfile@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Received SIGHUP.\0A\00"
define void @opd_sighup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @sfile_close_files()
%3 = call i32 @close(i32 1)
%4 = call i32 @close(i32 2)
%5 = call i32 (...) @opd_open_logfile()
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Received SIGHUP.\00"
define void @opd_sighup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @sfile_close_files()
%3 = tail call i32 @close(i32 1)
%4 = tail call i32 @close(i32 2)
%5 = tail call i32 (...) @opd_open_logfile()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *rfcdown_malloc(size_t size) {
  void *ret = malloc(size);
  if (!ret) {
    fprintf(stderr, "Allocation failed.\n");
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<rfcdown_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <rfcdown_malloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfcdown_malloc>:
push   %rax
call   1050 <malloc@plt>
test   %rax,%rax
je     113d <rfcdown_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failed.\0A\00"
define i8* @rfcdown_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failed.\0A\00"
define noalias i8* @rfcdown_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
void g_byte_array_remove_range() {}


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

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

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

LLVM IR (-O2):
define void @g_byte_array_remove_range() {
ret void
}
int test_imm_58int8_reg(signed char val) {
  return ((val) & (0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x58,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_58int8_reg(i8 signext %0) {
%2 = and i8 %0, 88
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M163_f(char *s) {
  debug("M163_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M163_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    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"M163_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M163_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 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 = [47 x i8] c"M163_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M163_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 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
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void PCM_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @PCM_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @PCM_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
int test_imm_B7uint16_reg(unsigned short val) {
  return ((val) & (0xB7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B7uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 183
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
min(a, b) int a, b;
{ return (a < b ? a : b); }


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

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

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int dma_hl(int stream) { return ((stream & 0x4) >> 2); }


x86 assembly (clang, -O0):
<dma_hl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma_hl>:
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @dma_hl(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 1
ret i32 %3
}
int corrupted_tlb_arg(char arg, char *optarg) { return 1; }


x86 assembly (clang, -O0):
<corrupted_tlb_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @corrupted_tlb_arg(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
ret i32 1
}

LLVM IR (-O2):
define i32 @corrupted_tlb_arg(i8 signext %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ kernel_idle();
void idle(void *arg) { kernel_idle(); }


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

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

LLVM IR (-O0):
define void @idle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @kernel_idle()
ret void
}

LLVM IR (-O2):
define void @idle(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @kernel_idle()
ret void
}
int test_imm_27int64_lowword_reg(long long val) {
  return ((val) & (0x27 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_27int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 39
%5 = icmp ne i64 %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_27int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 39
%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 printLast() { printf("Which nobody can deny!\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Which nobody can deny!\0A\00"
define void @printLast() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Which nobody can deny!\00"
define void @printLast() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t round_up_to_power_2(size_t v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v |= v >> 32;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<round_up_to_power_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up_to_power_2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @round_up_to_power_2(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ Console_Ln();
void OPM_LogWLn(void) { Console_Ln(); }


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

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

LLVM IR (-O0):
define void @OPM_LogWLn() {
%1 = call i32 (...) @Console_Ln()
ret void
}

LLVM IR (-O2):
define void @OPM_LogWLn() {
%1 = tail call i32 (...) @Console_Ln()
ret void
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    return (c + ('a' - 'A'));
  }
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <ft_tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <ft_tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
scalar_t__ HaveAlsaRoutines();
int /*<<< orphan*/ MySound_Init0();
int MySound_Init(void) {
  if (HaveAlsaRoutines()) {
    MySound_Init0();
  }
  return 1;
}


x86 assembly (clang, -O0):
<MySound_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HaveAlsaRoutines@plt>
cmp    $0x0,%rax
je     113c <MySound_Init+0x1c>
mov    $0x0,%al
call   1040 <MySound_Init0@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySound_Init>:
push   %rax
xor    %eax,%eax
call   1030 <HaveAlsaRoutines@plt>
test   %rax,%rax
je     1134 <MySound_Init+0x14>
xor    %eax,%eax
call   1040 <MySound_Init0@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @MySound_Init() {
%1 = call i64 (...) @HaveAlsaRoutines()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @MySound_Init0()
br label %5
5: ; preds = %3, %0
ret i32 1
}

LLVM IR (-O2):
define i32 @MySound_Init() {
%1 = tail call i64 (...) @HaveAlsaRoutines()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @MySound_Init0()
br label %5
5: ; preds = %3, %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMREXCLUDECLIPRECT_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 4, torev);
}


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

x86 assembly (clang, -O2):
<U_WMREXCLUDECLIPRECT_swap>:
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMREXCLUDECLIPRECT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 4, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void swapb(uint8_t *x, uint8_t *y) {
  uint8_t t;
  t = *x;
  *x = *y;
  *y = t;
}


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

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

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

LLVM IR (-O2):
define void @swapb(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
int test6(char *X) { return __builtin___memcpy_chk(X, X, 42, 42) != 0; }


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

x86 assembly (clang, -O2):
<test6>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @test6(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %3, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test6(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef double int32_t;

/* Variables and functions */
scalar_t__ INT32_MAX;
int32_t dtos32(double d, int32_t scale) {
  return (int32_t)((d / scale) * (double)INT32_MAX);
}


x86 assembly (clang, -O0):
<dtos32>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtos32>:
divsd  %xmm1,%xmm0
mov    0x2ed5(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@INT32_MAX = global i64 0
define double @dtos32(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = load i64, i64* @INT32_MAX
%9 = sitofp i64 %8 to double
%10 = fmul double %7, %9
ret double %10
}

LLVM IR (-O2):
@INT32_MAX = global i64 0
define double @dtos32(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = load i64, i64* @INT32_MAX
%5 = sitofp i64 %4 to double
%6 = fmul double %3, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ get_param(char const *, char *, int);
int get_param_int(const char *cmd) {
  char buf[80];
  return atoi(get_param(cmd, buf, sizeof(buf)));
}


x86 assembly (clang, -O0):
<get_param_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x50,%edx
call   1030 <get_param@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_param_int>:
sub    $0x58,%rsp
mov    %rsp,%rsi
mov    $0x50,%edx
call   1030 <get_param@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @get_param_int(i8* %0) {
%2 = alloca i8*
%3 = alloca [80 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = call i32 @get_param(i8* %4, i8* %5, i32 80)
%7 = call i32 @atoi(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_param_int(i8* %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @get_param(i8* %0, i8* %3, i32 80)
%5 = call i32 @atoi(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ezdClearDrawSurface();
void eraseWindow() { ezdClearDrawSurface(); }


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

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

LLVM IR (-O0):
define void @eraseWindow() {
%1 = call i32 (...) @ezdClearDrawSurface()
ret void
}

LLVM IR (-O2):
define void @eraseWindow() {
%1 = tail call i32 (...) @ezdClearDrawSurface()
ret void
}
int __attribute__((target("no-sse4"))) narwhal(int a) { return 4; }


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

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

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

LLVM IR (-O2):
define i32 @narwhal(i32 %0) {
ret i32 4
}
__attribute__((no, noclone)) unsigned __int128 t121_3mul(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_mul_overflow((signed __int128)(0), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t121_3mul>:
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)
xor    %eax,%eax
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
test   $0x1,%al
jne    114f <t121_3mul+0x3f>
jmp    1156 <t121_3mul+0x46>
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):
<t121_3mul>:
xor    %eax,%eax
xor    %edx,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @t121_3mul(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 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.smul.with.overflow.i129(i129 0, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext 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 } @t121_3mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
int execute_mlockall() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mlockall() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_move_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_move_sd(__m128d A, __m128d B) { return _mm_move_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_move_sd>:
jmp    1030 <_mm_move_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_move_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_move_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int get_gpio_number(int);
int /*<<< orphan*/ output_gpio(int, int);
void digitalWrite(int gpio, int value) {
  int gpioPin = get_gpio_number(gpio);
  output_gpio(gpioPin, value);
}


x86 assembly (clang, -O0):
<digitalWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_gpio_number@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <output_gpio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitalWrite>:
push   %rbx
mov    %esi,%ebx
call   1030 <get_gpio_number@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <output_gpio@plt>

LLVM IR (-O0):
define void @digitalWrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @get_gpio_number(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @output_gpio(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @digitalWrite(i32 %0, i32 %1) {
%3 = tail call i32 @get_gpio_number(i32 %0)
%4 = tail call i32 @output_gpio(i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deserialize_long_long(char **, long long *);
void deserialize_int(char **f, int *n) {
  long long ll;
  deserialize_long_long(f, &ll);
  *n = ll;
}


x86 assembly (clang, -O0):
<deserialize_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <deserialize_long_long@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deserialize_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <deserialize_long_long@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @deserialize_int(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca i64
store i8** %0, i8*** %3
store i32* %1, i32** %4
%6 = load i8**, i8*** %3
%7 = call i32 @deserialize_long_long(i8** %6, i64* %5)
%8 = load i64, i64* %5
%9 = trunc i64 %8 to i32
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @deserialize_int(i8** %0, i32* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @deserialize_long_long(i8** %0, i64* %3)
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char **);
void recurse_stack(int depth) {
  char str[65535] = {0};
  printf("depth %3d: stack %p \n", depth, &str);
  recurse_stack(depth + 1);
}


x86 assembly (clang, -O0):
<recurse_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10010(%rbp),%rdi
xor    %esi,%esi
mov    $0xffff,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%esi
lea    -0x10010(%rbp),%rdx
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1050 <recurse_stack@plt>
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse_stack>:
push   %r14
push   %rbx
sub    $0x10008,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    $0xffff,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1050 <recurse_stack@plt>
add    $0x10008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"depth %3d: stack %p \0A\00"
define void @recurse_stack(i32 %0) {
%2 = alloca i32
%3 = alloca [65535 x i8]
store i32 %0, i32* %2
%4 = bitcast [65535 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = bitcast [65535 x i8]* %3 to i8**
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5, i8** %6)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"depth %3d: stack %p \0A\00"
define void @recurse_stack(i32 %0) {
%2 = alloca [65535 x i8]
%3 = getelementptr inbounds [65535 x i8], [65535 x i8]* %2, i64 0, i64 0
%4 = bitcast [65535 x i8]* %2 to i8**
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %4)
%6 = add nsw i32 %0, 1
ret void
}
long get_vbatt_max() { return 2550; }


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

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

LLVM IR (-O0):
define i64 @get_vbatt_max() {
ret i64 2550
}

LLVM IR (-O2):
define i64 @get_vbatt_max() {
ret i64 2550
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
char base64b8(unsigned char val) {
  const uint32_t base64b8values =
      (uint32_t)((uint32_t)'A' + ((uint32_t)'Q' << 8) + ((uint32_t)'g' << 16) +
                 ((uint32_t)'w' << 24));
  return (char)((base64b8values >> (val << 3)) & 0xFF);
}


x86 assembly (clang, -O0):
<base64b8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x77675141,-0x8(%rbp)
movzbl -0x1(%rbp),%ecx
shl    $0x3,%ecx
mov    $0x77675141,%eax
sar    %cl,%eax
and    $0xff,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64b8>:
lea    0x0(,%rdi,8),%ecx
mov    $0x77675141,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define signext i8 @base64b8(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 2003259713, i32* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 3
%7 = ashr i32 2003259713, %6
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @base64b8(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 3
%4 = lshr i32 2003259713, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}
void Security_setUser(char *userName, struct Log *logger, struct Except *eh) {}


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

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

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

LLVM IR (-O2):
%struct.Log = type opaque
%struct.Except = type opaque
define void @Security_setUser(i8* nocapture %0, %struct.Log* nocapture %1, %struct.Except* nocapture %2) {
ret void
}
int test_imm_3Fuint8_mem(unsigned char *val) {
  return ((*val) & (-0x3F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Fuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -63
%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_3Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -63
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}