xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void mycallback(char *name, int argc, char **argv, void *user_data) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("%s\n", argv[i]);
  }
}


x86 assembly (clang, -O0):
<mycallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <mycallback+0x50>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <mycallback+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycallback>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <mycallback+0x35>
mov    %rdx,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <mycallback+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @mycallback(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
store i32 0, i32* %9
br label %10
10: ; preds = %21, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i8**, i8*** %7
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %9
%23 = add nsw i32 %22, 1
store i32 %23, i32* %9
br label %10
24: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @mycallback(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8* nocapture readnone %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %2, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _xfree(void **ptr) {
  if (ptr != NULL) {
    free(*ptr);
    *ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<_xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <_xfree+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xfree>:
test   %rdi,%rdi
je     1129 <_xfree+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @_xfree(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 %10
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
%9 = load i8**, i8*** %2
store i8* null, i8** %9
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_xfree(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %3, %1
ret void
}
int int_fetch_nand_seq_cst(int *ptr, int value) {
  return __atomic_fetch_nand(ptr, value, 5);
}


x86 assembly (clang, -O0):
<int_fetch_nand_seq_cst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    %ecx,-0x1c(%rbp)
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
mov    %edx,-0x30(%rbp)
not    %edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x2c(%rbp)
test   $0x1,%cl
mov    %eax,-0x18(%rbp)
jne    1152 <int_fetch_nand_seq_cst+0x52>
jmp    1124 <int_fetch_nand_seq_cst+0x24>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_fetch_nand_seq_cst>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    %esi,%ecx
not    %ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <int_fetch_nand_seq_cst+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_fetch_nand_seq_cst(i32* nocapture %0, i32 %1) {
%3 = atomicrmw nand i32* %0, i32 %1 seq_cst
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gl_destroy_until(int /*<<< orphan*/ *);
int /*<<< orphan*/ gl_push(int /*<<< orphan*/ *);
int main() {
  gl_push(NULL);
  gl_destroy_until(NULL);
  gl_push(NULL);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @gl_push(i32* null)
%2 = tail call i32 @gl_destroy_until(i32* null)
%3 = tail call i32 @gl_push(i32* null)
ret i32 0
}
/* Variables and functions */
scalar_t__ argint(int /*<<< orphan*/, int *);
int kill(int);
int sys_kill(void) {
  int pid;
  if (argint(0, &pid) < 0) {
    return -1;
  }
  return kill(pid);
}


x86 assembly (clang, -O0):
<sys_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1040 <argint@plt>
cmp    $0x0,%rax
jge    1149 <sys_kill+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <sys_kill+0x34>
mov    -0x8(%rbp),%edi
call   1030 <kill@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_kill>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
call   1040 <argint@plt>
test   %rax,%rax
js     113d <sys_kill+0x1d>
mov    0x4(%rsp),%edi
call   1030 <kill@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sys_kill() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 @argint(i32 0, i32* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @kill(i32 %7)
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_kill() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @argint(i32 0, i32* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @kill(i32 %6)
br label %8
8: ; preds = %0, %5
%9 = phi i32 [ %7, %5 ], [ -1, %0 ]
ret i32 %9
}
/* Variables and functions */
int read(int, char *, int);
int qcc_read(int fd, char *buf, int len) {
  int i;
  i = read(fd, buf, len);
  return i;
}


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

x86 assembly (clang, -O2):
<qcc_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @qcc_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float sal, novo_sal;
  printf("salario: ");
  scanf("%f", &sal);
  printf("Novo salario: %.2f", sal + sal * 0.25);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"salario: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Novo salario: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 2.500000e-01, double %7)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"salario: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Novo salario: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call double @llvm.fmuladd.f64(double %6, double 2.500000e-01, double %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_exit();
void sigint_handler(int s) { cleanup_exit(); }


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

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

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

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 (...) @cleanup_exit()
ret void
}
void XtCvtStringToShort() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToShort() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ in_port_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
char *consume_until_whitespace(char **);
int /*<<< orphan*/ fatal(char *);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
in_port_t consume_tcp_port(char **str) {
  char *tok = consume_until_whitespace(str);
  if (!tok)
    fatal("TCP port isn't specified");
  return htons(atoi(tok));
}


x86 assembly (clang, -O0):
<consume_tcp_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <consume_until_whitespace@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <consume_tcp_port+0x30>
lea    0xe95(%rip),%rdi
call   1060 <fatal@plt>
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <htons@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_tcp_port>:
push   %rbx
call   1030 <consume_until_whitespace@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <consume_tcp_port+0x1a>
lea    0xeab(%rip),%rdi
call   1060 <fatal@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <htons@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"TCP port isn't specified\00"
define i32 @consume_tcp_port(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i8* @consume_until_whitespace(i8** %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = call i32 @atoi(i8* %11)
%13 = call i32 @htons(i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"TCP port isn't specified\00"
define i32 @consume_tcp_port(i8** %0) {
%2 = tail call i8* @consume_until_whitespace(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @atoi(i8* %2)
%8 = tail call i32 @htons(i32 %7)
ret i32 %8
}
/* Variables and functions */
int ea_mode(int);
scalar_t__ ea_valid(int);
int ea_valid_na(int opcode) {
  return (ea_mode(opcode) != 1 && ea_valid(opcode));
}


x86 assembly (clang, -O0):
<ea_valid_na>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ea_mode@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x5(%rbp)
je     1155 <ea_valid_na+0x35>
mov    -0x4(%rbp),%edi
call   1040 <ea_valid@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ea_valid_na>:
push   %rbx
mov    %edi,%ebx
call   1030 <ea_mode@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
je     1143 <ea_valid_na+0x23>
mov    %ebx,%edi
call   1040 <ea_valid@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ea_valid_na(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ea_mode(i32 %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @ea_valid(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ea_valid_na(i32 %0) {
%2 = tail call i32 @ea_mode(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @ea_valid(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int symlink(char *, char *);
int link_new(char *path) {
  int flag;
  flag = symlink(
      path, "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK");
  if (flag != 0) {
    perror(path);
  }
  return flag;
}


x86 assembly (clang, -O0):
<link_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <symlink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1152 <link_new+0x32>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link_new>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1030 <symlink@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1141 <link_new+0x21>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
jmp    1138 <link_new+0x18>

LLVM IR (-O0):
@.str = [64 x i8] c"/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK\00"
define i32 @link_new(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @symlink(i8* %4, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @perror(i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [64 x i8] c"/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK\00"
define i32 @link_new(i8* %0) {
%2 = tail call i32 @symlink(i8* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
void Java_com_voidel_security_sgx_uae_SGX_1AEServices_initializeNativeAEServices() {
}


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

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

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

LLVM IR (-O2):
define void @Java_com_voidel_security_sgx_uae_SGX_1AEServices_initializeNativeAEServices() {
ret void
}
void car_migrate_variables(void) {}


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

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

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

LLVM IR (-O2):
define void @car_migrate_variables() {
ret void
}
__attribute__((always_)) int drwav__is_little_endian(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @drwav__is_little_endian() {
ret i32 1
}
int test_imm_EEuint16_mem(unsigned short *val) {
  return ((*val) & (-0xEE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EEuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -238
%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_EEuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -238
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ execute_child(int, int);
scalar_t__ vfork();
__attribute__((no)) pid_t spawn_child(int input_fd, int output_fd) {
  pid_t pid = vfork();
  if (pid == 0)
    execute_child(input_fd, output_fd);
  return pid;
}


x86 assembly (clang, -O0):
<spawn_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <vfork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <spawn_child+0x2f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <execute_child@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spawn_child>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <vfork@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <spawn_child+0x22>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <execute_child@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @spawn_child(i32 %0, i32 %1) {
%3 = tail call i64 (...) @vfork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @execute_child(i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ g(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/, char *, int);
main() {
  f(0, 0, "hi", 2);
  g(0, 0, 0, 0, "hi", 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
lea    0xed3(%rip),%rdx
mov    $0x2,%ecx
mov    %esi,%edi
call   1030 <f@plt>
xor    %ecx,%ecx
lea    0xebe(%rip),%r8
mov    $0x2,%r9d
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <g@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0x2,%ecx
call   1030 <f@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
mov    $0x2,%r9d
call   1040 <g@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = call i32 @f(i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = call i32 @g(i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 @f(i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @g(i32 0, i32 0, i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
void HwMdSetVram(unsigned short word) {
  while ((*(volatile unsigned short *)0x20004020))
    ;
  (*(volatile unsigned short *)0x20004022) = word;
  (*(volatile unsigned short *)0x20004020) = 0x0700;
  while ((*(volatile unsigned short *)0x20004020))
    ;
}


x86 assembly (clang, -O0):
<HwMdSetVram>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x20004020,%eax
mov    (%rax),%ax
cmp    $0x0,%ax
je     1122 <HwMdSetVram+0x22>
jmp    110b <HwMdSetVram+0xb>
mov    -0x2(%rbp),%cx
mov    $0x20004022,%eax
mov    %cx,(%rax)
mov    $0x20004020,%eax
movw   $0x700,(%rax)
mov    $0x20004020,%eax
mov    (%rax),%ax
cmp    $0x0,%ax
je     114f <HwMdSetVram+0x4f>
jmp    1138 <HwMdSetVram+0x38>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwMdSetVram>:
cmpw   $0x0,0x20004020
jne    1100 <HwMdSetVram>
mov    %di,0x20004022
20
movw   $0x700,0x20004020
nopl   (%rax)
cmpw   $0x0,0x20004020
jne    1120 <HwMdSetVram+0x20>
ret

LLVM IR (-O0):
define void @HwMdSetVram(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
br label %3
3: ; preds = %6, %1
%4 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%5 = icmp ne i16 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i16, i16* %2
store volatile i16 %8, i16* inttoptr (i64 536887330 to i16*)
store volatile i16 1792, i16* inttoptr (i64 536887328 to i16*)
br label %9
9: ; preds = %12, %7
%10 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%11 = icmp ne i16 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %9
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @HwMdSetVram(i16 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
store volatile i16 %0, i16* inttoptr (i64 536887330 to i16*)
store volatile i16 1792, i16* inttoptr (i64 536887328 to i16*)
br label %6
6: ; preds = %6, %5
%7 = load volatile i16, i16* inttoptr (i64 536887328 to i16*)
%8 = icmp eq i16 %7, 0
br i1 %8, label %9, label %6
9: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("hello foo\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"hello foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void cuda_set_device(int n) {}


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

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

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

LLVM IR (-O2):
define void @cuda_set_device(i32 %0) {
ret void
}
function1(f, n) {
  int (*kfunc)();
  int (*function2())();
  kfunc = function2();
  return 0;
}


x86 assembly (clang, -O0):
<function1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <function2@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @function1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32 (...)*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...)* (...) @function2()
store i32 (...)* %6, i32 (...)** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @function1(i32 %0, i32 %1) {
%3 = tail call i32 (...)* (...) @function2()
ret i32 0
}
int test_imm_91int64_highword_reg(long long val) {
  return ((val >> 32) & (0x91 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_91int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 145
%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_91int64_highword_reg(i64 %0) {
%2 = and i64 %0, 622770257920
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *tolower_str(str)
char *str;
{
  static char temp_str[256];
  char *ptr;
  strcpy(temp_str, str);
  ptr = temp_str;
  while ((*ptr = (char)tolower((int)*ptr)))
    ptr++;
  return (temp_str);
}


x86 assembly (clang, -O0):
<tolower_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f09(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2efd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1172 <tolower_str+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <tolower_str+0x27>
lea    0x2ec7(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower_str>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f15(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rbx),%edi
call   1040 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1140 <tolower_str+0x20>
lea    0x2ee7(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@tolower_str.temp_str = internal global [256 x i8] zeroinitializer
define i8* @tolower_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strcpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tolower_str.temp_str, i64 0, i64 0), i8* %4)
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tolower_str.temp_str, i64 0, i64 0), i8** %3
br label %6
6: ; preds = %14, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 @tolower(i32 %9)
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
store i8 %11, i8* %12
%13 = icmp ne i8 %11, 0
br i1 %13, label %14, label %17
14: ; preds = %6
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %6
17: ; preds = %6
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tolower_str.temp_str, i64 0, i64 0)
}

LLVM IR (-O2):
@tolower_str.temp_str = internal global [256 x i8] zeroinitializer
define i8* @tolower_str(i8* nocapture %0) {
%2 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @tolower_str.temp_str, i64 0, i64 0), i8* dereferenceable(1) %0)
br label %3
3: ; preds = %3, %1
%4 = phi i8* [ getelementptr inbounds ([256 x i8], [256 x i8]* @tolower_str.temp_str, i64 0, i64 0), %1 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = tail call i32 @tolower(i32 %6)
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @tolower_str.temp_str, i64 0, i64 0)
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t c = 0;
  unsigned char *cc = (unsigned char *)str;
  while (*cc++)
    c++;
  return c + 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,(%rax)
je     1141 <strlen+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <strlen+0x18>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111e <strlen+0x1e>
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i64 [ %8, %4 ], [ 1, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add i64 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 1, %1 ], [ %8, %4 ]
ret i64 %12
}
int getmax(int a, int b, int c) {
  int m = a;
  if (m < b)
    m = b;
  if (m < c)
    m = c;
  return (m);
}


x86 assembly (clang, -O0):
<getmax>:
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)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1125 <getmax+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1137 <getmax+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getmax(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 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
store i32 %13, i32* %7
br label %14
14: ; preds = %12, %3
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %6
store i32 %19, i32* %7
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @getmax(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
int test_imm_10uint8_reg(unsigned char val) {
  return ((val) & (0x10 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_10uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 16
%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_10uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 16
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ core1_swap(char *, int);
void U_EMRPOLYBEZIER_swap(char *record, int torev) {
  core1_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYBEZIER_swap>:
jmp    1030 <core1_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRPOLYBEZIER_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core1_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
char *getenv(char const *);
int str2bool(char *);
int env2bool(const char *name, int value_default) {
  char *p = getenv(name);
  if (p == NULL) {
    return value_default;
  }
  return str2bool(p);
}


x86 assembly (clang, -O0):
<env2bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1152 <env2bool+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <env2bool+0x3e>
mov    -0x20(%rbp),%rdi
call   1040 <str2bool@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env2bool>:
push   %rbx
mov    %esi,%ebx
call   1030 <getenv@plt>
test   %rax,%rax
je     1136 <env2bool+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <str2bool@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @env2bool(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i8* @getenv(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %16
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i32 @str2bool(i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @env2bool(i8* nocapture %0, i32 %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @str2bool(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %1, %2 ]
ret i32 %8
}
int owHasPowerDelivery(int portnum) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @owHasPowerDelivery(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef char XML_Char;

/* Variables and functions */
XML_Char XchompConvert(XML_Char c) {
  if (c == '\n' || c == '\t' || c == '\r')
    return ' ';
  if (c == 1)
    return '\n';
  return c;
}


x86 assembly (clang, -O0):
<XchompConvert>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
je     1131 <XchompConvert+0x31>
movsbl -0x2(%rbp),%eax
cmp    $0x9,%eax
je     1131 <XchompConvert+0x31>
movsbl -0x2(%rbp),%eax
cmp    $0xd,%eax
jne    113a <XchompConvert+0x3a>
movb   $0x20,-0x1(%rbp)
jmp    1156 <XchompConvert+0x56>
movsbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1150 <XchompConvert+0x50>
movb   $0xa,-0x1(%rbp)
jmp    1156 <XchompConvert+0x56>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XchompConvert>:
mov    $0x20,%al
lea    -0x9(%rdi),%ecx
cmp    $0x2,%cl
jb     111b <XchompConvert+0x1b>
cmp    $0xd,%dil
je     111b <XchompConvert+0x1b>
cmp    $0x1,%dil
jne    1119 <XchompConvert+0x19>
mov    $0xa,%al
ret
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @XchompConvert(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 10
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 13
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i8 32, i8* %2
br label %23
16: ; preds = %11
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %16
store i8 10, i8* %2
br label %23
21: ; preds = %16
%22 = load i8, i8* %3
store i8 %22, i8* %2
br label %23
23: ; preds = %21, %20, %15
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @XchompConvert(i8 signext %0) {
switch i8 %0, label %3 [
i8 13, label %4
i8 10, label %4
i8 9, label %4
i8 1, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %3, %2
%5 = phi i8 [ 10, %2 ], [ %0, %3 ], [ 32, %1 ], [ 32, %1 ], [ 32, %1 ]
ret i8 %5
}
double gatecappass(width, wirelength)
double width;
double wirelength;
{ return (width * 0.8 * 1.45e-15 + wirelength * 0.25e-15 * 0.8); }


x86 assembly (clang, -O0):
<gatecappass>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeed(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gatecappass>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm2
mulsd  0xef0(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @gatecappass(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 = fmul double %5, 8.000000e-01
%7 = load double, double* %4
%8 = fmul double %7, 2.500000e-16
%9 = fmul double %8, 8.000000e-01
%10 = call double @llvm.fmuladd.f64(double %6, double 1.450000e-15, double %9)
ret double %10
}

LLVM IR (-O2):
define double @gatecappass(double %0, double %1) {
%3 = fmul double %0, 8.000000e-01
%4 = fmul double %1, 2.500000e-16
%5 = fmul double %4, 8.000000e-01
%6 = tail call double @llvm.fmuladd.f64(double %3, double 1.450000e-15, double %5)
ret double %6
}
/* Variables and functions */
int PAPI_accum(int, long long *);
void papif_accum(int *EventSet, long long *values, int *check) {
  *check = PAPI_accum(*EventSet, values);
}


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

x86 assembly (clang, -O2):
<papif_accum>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_accum@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_accum(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_accum(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
int main() {
  int a = 3, b = 2;
  long c = 6;
  int d = a / b;
  int e = a % b;
  int f = a / c;
  return d + e + f;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movq   $0x6,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x20(%rbp)
movslq -0x8(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 2, i32* %3
store i64 6, i64* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sdiv i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = srem i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = load i64, i64* %4
%17 = sdiv i64 %15, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %7
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_PUBLIC;
scalar_t__ d2i_PUBKEY;
EVP_PKEY *PEM_read_PUBKEY(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,
                          void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_PUBKEY, PEM_STRING_PUBLIC, fp,
                       (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_PUBKEY>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_PUBKEY
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_PUBLIC
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_PUBKEY
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PUBLIC
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
void g_unichar_tolower() {}


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

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

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

LLVM IR (-O2):
define void @g_unichar_tolower() {
ret void
}