xunge/DecIR huggingface dataset:
/* Variables and functions */
int nvidia_mcp_gpio_set(int, int);
int nvidia_mcp_gpio10_raise(void) { return nvidia_mcp_gpio_set(0x10, 1); }


x86 assembly (clang, -O0):
<nvidia_mcp_gpio10_raise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <nvidia_mcp_gpio_set@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nvidia_mcp_gpio10_raise() {
%1 = call i32 @nvidia_mcp_gpio_set(i32 16, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @nvidia_mcp_gpio10_raise() {
%1 = tail call i32 @nvidia_mcp_gpio_set(i32 16, i32 1)
ret i32 %1
}
int aa_pro_ctr_a04(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a04>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a04>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a04 = [15 x i8] c"aa_pro_ctr_a04\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a04(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a04, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a04 = [15 x i8] c"aa_pro_ctr_a04\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a04(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a04, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ strtol(char *, char **, int);
void ignorereturn(void) {
  char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";
  char *pEnd;
  strtol(szNumbers, &pEnd, 10);
}


x86 assembly (clang, -O0):
<ignorereturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2d,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignorereturn>:
sub    $0x48,%rsp
movups 0xf02(%rip),%xmm0
movups %xmm0,0x2d(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.ignorereturn.szNumbers = [45 x i8] c"2001 60c0c0 -1101110100110100100000 0x6fffff\00"
define void @ignorereturn() {
%1 = alloca [45 x i8]
%2 = alloca i8*
%3 = bitcast [45 x i8]* %1 to i8*
%4 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%5 = call i32 @strtol(i8* %4, i8** %2, i32 10)
ret void
}

LLVM IR (-O2):
@__const.ignorereturn.szNumbers = [45 x i8] c"2001 60c0c0 -1101110100110100100000 0x6fffff\00"
define void @ignorereturn() {
%1 = alloca [45 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%4 = bitcast i8** %2 to i8*
%5 = call i32 @strtol(i8* %3, i8** %2, i32 10)
ret void
}
void StreamWriter_WriteData(struct StreamWriter *self, char *string) {}


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

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

LLVM IR (-O0):
%struct.StreamWriter = type opaque
define void @StreamWriter_WriteData(%struct.StreamWriter* %0, i8* %1) {
%3 = alloca %struct.StreamWriter*
%4 = alloca i8*
store %struct.StreamWriter* %0, %struct.StreamWriter** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.StreamWriter = type opaque
define void @StreamWriter_WriteData(%struct.StreamWriter* nocapture %0, i8* nocapture %1) {
ret void
}
int vm_stop() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vm_stop() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ trabajo_hijo(scalar_t__);
int /*<<< orphan*/ trabajo_padre(scalar_t__);
void main(void) {
  pid_t pid;
  pid = fork();
  if (pid == 0)
    trabajo_hijo(pid);
  else
    trabajo_padre(pid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115c <main+0x2c>
mov    -0x8(%rbp),%rdi
call   1040 <trabajo_hijo@plt>
jmp    1165 <main+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <trabajo_padre@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
je     1146 <main+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1030 <trabajo_padre@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <trabajo_hijo@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i64, i64* %1
%7 = call i32 @trabajo_hijo(i64 %6)
br label %11
8: ; preds = %0
%9 = load i64, i64* %1
%10 = call i32 @trabajo_padre(i64 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @trabajo_hijo(i64 0)
br label %7
5: ; preds = %0
%6 = tail call i32 @trabajo_padre(i64 %1)
br label %7
7: ; preds = %5, %3
ret void
}
unsigned int iavf_txd_use_count(unsigned int size) {
  return ((size * 85) >> 20) + 1;
}


x86 assembly (clang, -O0):
<iavf_txd_use_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x55,-0x4(%rbp),%eax
shr    $0x14,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iavf_txd_use_count>:
imul   $0x55,%edi,%eax
shr    $0x14,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @iavf_txd_use_count(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 85
%5 = lshr i32 %4, 20
%6 = add i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @iavf_txd_use_count(i32 %0) {
%2 = mul i32 %0, 85
%3 = lshr i32 %2, 20
%4 = add nuw nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void op0xD7(void) { rst(0x10); }


x86 assembly (clang, -O0):
<op0xD7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1030 <rst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op0xD7>:
mov    $0x10,%edi
jmp    1030 <rst@plt>

LLVM IR (-O0):
define void @op0xD7() {
%1 = call i32 @rst(i32 16)
ret void
}

LLVM IR (-O2):
define void @op0xD7() {
%1 = tail call i32 @rst(i32 16)
ret void
}
/* Variables and functions */
char *my_strstr(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *, char const *, char *);
void str_cases(const char *string, const char *key) {
  printf("try to find %s in %s, result location is %s.\n", key, string,
         my_strstr(string, key));
}


x86 assembly (clang, -O0):
<str_cases>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <my_strstr@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cases>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <my_strstr@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"try to find %s in %s, result location is %s.\0A\00"
define void @str_cases(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i8* @my_strstr(i8* %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"try to find %s in %s, result location is %s.\0A\00"
define void @str_cases(i8* %0, i8* %1) {
%3 = tail call i8* @my_strstr(i8* %0, i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i8* %3)
ret void
}
int test_imm_C7int8_mem(signed char *val) {
  return ((*val) & (-0xC7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C7int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff39,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C7int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -199
%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_C7int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -199
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printBool(int);
int main(int argc, char *argv[]) {
  int d = 2;
  int a = 1;
  int b = 0;
  int c = -1;
  printBool(a);
  printBool(b);
  printBool(c);
  printBool(d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0xffffffff,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <printBool@plt>
mov    -0x1c(%rbp),%edi
call   1030 <printBool@plt>
mov    -0x20(%rbp),%edi
call   1030 <printBool@plt>
mov    -0x14(%rbp),%edi
call   1030 <printBool@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 1, i32* %7
store i32 0, i32* %8
store i32 -1, i32* %9
%10 = load i32, i32* %7
%11 = call i32 @printBool(i32 %10)
%12 = load i32, i32* %8
%13 = call i32 @printBool(i32 %12)
%14 = load i32, i32* %9
%15 = call i32 @printBool(i32 %14)
%16 = load i32, i32* %6
%17 = call i32 @printBool(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printBool(i32 1)
%4 = tail call i32 @printBool(i32 0)
%5 = tail call i32 @printBool(i32 -1)
%6 = tail call i32 @printBool(i32 2)
ret i32 0
}
void free_env(char **env) {
  int i = 0;
  while (env[i])
    free(env[i++]);
  free(env);
  return;
}


x86 assembly (clang, -O0):
<free_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <free_env+0x46>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1123 <free_env+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_env>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <free_env+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <free_env+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_env(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
%7 = add nuw nsw i64 %5, 1
tail call void @free(i8* %6)
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void print_func(const char *format, va_list va, void *state) {
  vprintf(format, va);
  printf("%s", "\n");
}


x86 assembly (clang, -O0):
<print_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <vprintf@plt>
lea    0xeba(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_func>:
push   %rax
call   1040 <vprintf@plt>
lea    0xed3(%rip),%rdi
lea    0xecf(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_func(i8* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @vprintf(i8* %0, i32 %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_pimatrix(int **m) {
  free((char *)(m[0]));
  free((char *)(m));
}


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

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

LLVM IR (-O0):
define void @free_pimatrix(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = getelementptr inbounds i32*, i32** %3, i64 0
%5 = load i32*, i32** %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @free(i8* %6)
%8 = load i32**, i32*** %2
%9 = bitcast i32** %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_pimatrix(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = bitcast i32** %0 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ terminate();
void sigterm_handler(int sig) {
  terminate();
  exit(2);
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <terminate@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigterm_handler>:
push   %rax
xor    %eax,%eax
call   1030 <terminate@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @terminate()
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 (...) @terminate()
%3 = tail call i32 @exit(i32 2)
unreachable
}
char *hash_plugin_detailed(void) {
  return ("sha256 - A simple sha256 plugin\n"
          "------------------------\n"
          "Use this module to crack simple sha256 hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "Known software that uses this password hashing method:\n"
          "Zikula 1.02, Snitz Forums 2000\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [287 x i8] c"sha256 - A simple sha256 plugin\0A------------------------\0AUse this module to crack simple sha256 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AZikula 1.02, Snitz Forums 2000\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [287 x i8] c"sha256 - A simple sha256 plugin\0A------------------------\0AUse this module to crack simple sha256 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0AZikula 1.02, Snitz Forums 2000\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str, i64 0, i64 0)
}
f(void (*func)()) { func(); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   *-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define i32 @f(void (...)* nocapture %0) {
tail call void (...) %0()
ret i32 undef
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_message_at_end(void *m,
                                                                 int complete) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_at_end>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_at_end>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_at_end(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_at_end(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
unsigned int ht_get_head_num(char *key, unsigned int max_size) {
  unsigned long int hash = 0;
  int c;
  while ((c = *key++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash % max_size;
}


x86 assembly (clang, -O0):
<ht_get_head_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1158 <ht_get_head_num+0x58>
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <ht_get_head_num+0x13>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_get_head_num>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <ht_get_head_num+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ht_get_head_num+0x10>
jmp    112d <ht_get_head_num+0x2d>
xor    %eax,%eax
mov    %esi,%ecx
mov    %rax,%rdx
shr    $0x20,%rdx
je     1141 <ht_get_head_num+0x41>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ht_get_head_num(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i64 0, i64* %5
br label %7
7: ; preds = %13, %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
store i32 %11, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %7
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = load i64, i64* %5
%17 = shl i64 %16, 6
%18 = add i64 %15, %17
%19 = load i64, i64* %5
%20 = shl i64 %19, 16
%21 = add i64 %18, %20
%22 = load i64, i64* %5
%23 = sub i64 %21, %22
store i64 %23, i64* %5
br label %7
24: ; preds = %7
%25 = load i64, i64* %5
%26 = load i32, i32* %4
%27 = zext i32 %26 to i64
%28 = urem i64 %25, %27
%29 = trunc i64 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @ht_get_head_num(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i64 [ %12, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %6 to i64
%11 = mul i64 %8, 65599
%12 = add i64 %11, %10
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %12, %5 ]
%17 = zext i32 %1 to i64
%18 = urem i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}
int foo2(distance, i, j)
int distance;
int i, j;
{
  int t = distance;
  if (t <= 0)
    t = ((t) >= 0 ? (t) : -(t));
  return t;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     1140 <foo2+0x40>
cmpl   $0x0,-0x10(%rbp)
jl     1132 <foo2+0x32>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    113a <foo2+0x3a>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo2(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %4
}
void delay(int nops) {
  while (nops > 0) {
    asm("nop");
    nops--;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1120 <delay+0x20>
nop
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
test   %edi,%edi
jle    1119 <delay+0x19>
add    $0x1,%edi
nopw   0x0(%rax,%rax,1)
nop
add    $0xffffffff,%edi
cmp    $0x1,%edi
ja     1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nsw i32 %4, -1
%6 = icmp ugt i32 %4, 1
br i1 %6, label %3, label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int rand();
void populate_array_seq(int *v, int n) {
  for (int i = 0; i < n; ++i) {
    v[i] = rand() % n;
  }
}


x86 assembly (clang, -O0):
<populate_array_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <populate_array_seq+0x46>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <populate_array_seq+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate_array_seq>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <populate_array_seq+0x38>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <populate_array_seq+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @populate_array_seq(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @populate_array_seq(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, %1
%11 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int newline(char *to, int offset) {
  char *c = to;
  *c++ = '\n';
  for (offset += 4; offset--; *c++ = ' ')
    ;
  return (c - to);
}


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0xa,(%rax)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     115e <newline+0x5e>
jmp    1147 <newline+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x20,(%rax)
jmp    112e <newline+0x2e>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movb   $0xa,(%rdi)
lea    0x1(%rdi),%rax
mov    %esi,%ecx
add    $0x4,%ecx
je     1141 <newline+0x31>
mov    %esi,%ebx
mov    %ecx,%edx
mov    %rax,%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
add    $0x3,%ebx
lea    (%rbx,%r14,1),%rax
add    $0x2,%rax
sub    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @newline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %5
store i8 10, i8* %7
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 4
store i32 %10, i32* %4
br label %11
11: ; preds = %16, %2
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp ne i32 %12, 0
br i1 %14, label %15, label %19
15: ; preds = %11
br label %16
16: ; preds = %15
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %5
store i8 32, i8* %17
br label %11
19: ; preds = %11
%20 = load i8*, i8** %5
%21 = load i8*, i8** %3
%22 = ptrtoint i8* %20 to i64
%23 = ptrtoint i8* %21 to i64
%24 = sub i64 %22, %23
%25 = trunc i64 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @newline(i8* %0, i32 %1) {
store i8 10, i8* %0
%3 = add i32 %1, 4
%4 = getelementptr i8, i8* %0, i64 1
%5 = icmp eq i32 %3, 0
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = zext i32 %3 to i64
%8 = add i32 %1, 3
%9 = zext i32 %8 to i64
%10 = add nuw nsw i64 %9, 2
%11 = getelementptr i8, i8* %0, i64 %10
br label %12
12: ; preds = %6, %2
%13 = phi i8* [ %4, %2 ], [ %11, %6 ]
%14 = ptrtoint i8* %13 to i64
%15 = ptrtoint i8* %0 to i64
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void cond_resched(void) { usleep(100); }


x86 assembly (clang, -O0):
<cond_resched>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_resched>:
mov    $0x64,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @cond_resched() {
%1 = call i32 @usleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @cond_resched() {
%1 = tail call i32 @usleep(i32 100)
ret void
}
/* Variables and functions */
double pow(double, double);
double deriv(double x, double n) { return (x * pow(x, n - 1)); }


x86 assembly (clang, -O0):
<deriv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deriv>:
push   %rax
movsd  %xmm0,(%rsp)
addsd  0xee2(%rip),%xmm1
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @deriv(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* %3
%7 = load double, double* %4
%8 = fsub double %7, 1.000000e+00
%9 = call double @pow(double %6, double %8)
%10 = fmul double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @deriv(double %0, double %1) {
%3 = fadd double %1, -1.000000e+00
%4 = tail call double @pow(double %0, double %3)
%5 = fmul double %4, %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ bk();
int /*<<< orphan*/ dg();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  bk();
  dg();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bk@plt>
mov    $0x0,%al
call   1040 <dg@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bk@plt>
xor    %eax,%eax
call   1040 <dg@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bk()
%3 = call i32 (...) @dg()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bk()
%2 = tail call i32 (...) @dg()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_adc_enable() {
  mbus_remote_register_write(0x3, 0x3B,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) |
                              (0 << 12) | (1 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_adc_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x3b,%esi
mov    $0xfefff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_enable>:
push   %rax
mov    $0x3,%edi
mov    $0x3b,%esi
mov    $0xfefff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_adc_enable() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 59, i32 1044479)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_enable() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 59, i32 1044479)
%2 = tail call i32 @delay(i32 100)
ret void
}
unsigned long long combine_zero_extended_int(unsigned int a, unsigned int b) {
  return (a & 0xffff0000ll) | (b & 0x0000ffffll);
}


x86 assembly (clang, -O0):
<combine_zero_extended_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movabs $0xffff0000,%rcx
and    %rcx,%rax
mov    -0x8(%rbp),%ecx
and    $0xffff,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<combine_zero_extended_int>:
and    $0xffff0000,%edi
movzwl %si,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i64 @combine_zero_extended_int(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 = zext i32 %5 to i64
%7 = and i64 %6, 4294901760
%8 = load i32, i32* %4
%9 = zext i32 %8 to i64
%10 = and i64 %9, 65535
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @combine_zero_extended_int(i32 %0, i32 %1) {
%3 = and i32 %0, -65536
%4 = and i32 %1, 65535
%5 = or i32 %4, %3
%6 = zext i32 %5 to i64
ret i64 %6
}
void gtk_icon_source_set_direction_wildcarded() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_set_direction_wildcarded() {
ret void
}
int c_isblank(int c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<c_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <c_isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @c_isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void mod_httpd_is_GPL_compatible() {}


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

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

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

LLVM IR (-O2):
define void @mod_httpd_is_GPL_compatible() {
ret void
}
void yy_1_MagicWordChoice(char *yytext, int yyleng) {
  ;
  ;
}


x86 assembly (clang, -O0):
<yy_1_MagicWordChoice>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yy_1_MagicWordChoice(i8* nocapture %0, i32 %1) {
ret void
}
int Bematech_FI_ClicheProprietario(Var, Retorno) {
  return Formata("\x1b|35|13|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_ClicheProprietario>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_ClicheProprietario>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|13|\1B\00"
define i32 @Bematech_FI_ClicheProprietario(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|13|\1B\00"
define i32 @Bematech_FI_ClicheProprietario(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
int gauss_pyr_down_get_buf_size_8u_C1R(int width, int height) {
  return width * height / 2;
}


x86 assembly (clang, -O0):
<gauss_pyr_down_get_buf_size_8u_C1R>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss_pyr_down_get_buf_size_8u_C1R>:
imul   %esi,%edi
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @gauss_pyr_down_get_buf_size_8u_C1R(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 = mul nsw i32 %5, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @gauss_pyr_down_get_buf_size_8u_C1R(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_unmask_fd(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 &= ~0x02;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_unmask_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_unmask_fd+0x4d>
movsbl -0x1(%rbp),%eax
and    $0xfffffffd,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_unmask_fd+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_unmask_fd>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_unmask_fd+0x41>
movsbl 0xf(%rsp),%esi
and    $0xfffffffd,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_unmask_fd() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -3
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_unmask_fd() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, -3
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
int g(const int *restrict a, int *b) {
  *b = 1;
  *a;
  return 0;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
movl   $0x1,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32* noalias nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 1, i32* %1
ret i32 0
}
int test_imm_50int32_reg(int val) { return ((val) & (0x50 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_50int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 80
%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_50int32_reg(i32 %0) {
%2 = and i32 %0, 80
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CP15DCacheCleanBuff(unsigned int, unsigned int);
void CacheDataCleanBuff(unsigned int startAddr, unsigned int numBytes) {
  CP15DCacheCleanBuff(startAddr, numBytes);
}


x86 assembly (clang, -O0):
<CacheDataCleanBuff>:
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 <CP15DCacheCleanBuff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CacheDataCleanBuff>:
jmp    1030 <CP15DCacheCleanBuff@plt>

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

LLVM IR (-O2):
define void @CacheDataCleanBuff(i32 %0, i32 %1) {
%3 = tail call i32 @CP15DCacheCleanBuff(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct rdp_tcp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g_free(struct rdp_tcp *);
void rdp_tcp_delete(struct rdp_tcp *self) { g_free(self); }


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

x86 assembly (clang, -O2):
<rdp_tcp_delete>:
jmp    1030 <g_free@plt>

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

LLVM IR (-O2):
%struct.rdp_tcp = type { i32 }
define void @rdp_tcp_delete(%struct.rdp_tcp* %0) {
%2 = tail call i32 @g_free(%struct.rdp_tcp* %0)
ret void
}