xunge/DecIR huggingface dataset:
int msg_handler(int from, int to, char *header, int len, int payloadSize) {
  return 0;
}


x86 assembly (clang, -O0):
<msg_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @msg_handler(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @msg_handler(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core11_swap(char *, int);
void U_EMRINVERTRGN_swap(char *record, int torev) {
  core11_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRINVERTRGN_swap>:
jmp    1030 <core11_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRINVERTRGN_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core11_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int __u16;

/* Variables and functions */
int cec_has_tuner(__u16 log_addr_mask) {
  return log_addr_mask & ((1 << 3) | (1 << 6) | (1 << 7) | (1 << 10));
}


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

x86 assembly (clang, -O2):
<cec_has_tuner>:
mov    %edi,%eax
and    $0x4c8,%eax
ret

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

LLVM IR (-O2):
define i32 @cec_has_tuner(i32 %0) {
%2 = and i32 %0, 1224
ret i32 %2
}
/* Type definitions */
struct trienode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct trienode *);
void freeTrie(struct trienode *node) { free(node); }


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

x86 assembly (clang, -O2):
<freeTrie>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.trienode = type { i32 }
define void @freeTrie(%struct.trienode* nocapture %0) {
%2 = tail call i32 @free(%struct.trienode* %0)
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
char *MySAR_copy_delimited(char *from, char *delimiter) {
  char *target = strstr(from, delimiter);
  if (target == NULL)
    return 0;
  return (char *)(target);
}


x86 assembly (clang, -O0):
<MySAR_copy_delimited>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1149 <MySAR_copy_delimited+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1151 <MySAR_copy_delimited+0x41>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySAR_copy_delimited>:
jmp    1030 <strstr@plt>

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

LLVM IR (-O2):
define i8* @MySAR_copy_delimited(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
int xmm6260_init_modemctl_device(struct modem_ctl *mc,
                                 struct modem_data *pdata) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.modem_ctl = type opaque
%struct.modem_data = type opaque
define i32 @xmm6260_init_modemctl_device(%struct.modem_ctl* %0, %struct.modem_data* %1) {
%3 = alloca %struct.modem_ctl*
%4 = alloca %struct.modem_data*
store %struct.modem_ctl* %0, %struct.modem_ctl** %3
store %struct.modem_data* %1, %struct.modem_data** %4
ret i32 0
}

LLVM IR (-O2):
%struct.modem_ctl = type opaque
%struct.modem_data = type opaque
define i32 @xmm6260_init_modemctl_device(%struct.modem_ctl* nocapture readnone %0, %struct.modem_data* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
void bar() { foo(0); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %edi,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @foo(i32 0)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mempcpy(char *, char *, int);
void mempcpy1() {
  char src[] = {1, 2, 3, 4};
  char dst[10];
  mempcpy(dst, src, 5);
}


x86 assembly (clang, -O0):
<mempcpy1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x5,%edx
call   1030 <mempcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempcpy1>:
sub    $0x18,%rsp
movl   $0x4030201,0x8(%rsp)
04
lea    0xe(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1030 <mempcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.mempcpy1.src = [4 x i8] c"\01\02\03\04"
define void @mempcpy1() {
%1 = alloca [4 x i8]
%2 = alloca [10 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i32 @mempcpy(i8* %4, i8* %5, i32 5)
ret void
}

LLVM IR (-O2):
define void @mempcpy1() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @mempcpy(i8* %4, i8* %3, i32 5)
ret void
}
double *fct_5(double *a, double *b, double *c, double *d, double *e, double *f,
              double *g, double *h) {
  (void)a;
  (void)b;
  (void)c;
  (void)d;
  (void)e;
  (void)f;
  (void)g;
  (void)h;
  return f;
}


x86 assembly (clang, -O0):
<fct_5>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fct_5>:
mov    %r9,%rax
ret

LLVM IR (-O0):
define double* @fct_5(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
%17 = load double*, double** %9
%18 = load double*, double** %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load double*, double** %13
%22 = load double*, double** %14
%23 = load double*, double** %15
%24 = load double*, double** %16
%25 = load double*, double** %14
ret double* %25
}

LLVM IR (-O2):
define double* @fct_5(double* nocapture readnone %0, double* nocapture readnone %1, double* nocapture readnone %2, double* nocapture readnone %3, double* nocapture readnone %4, double* readnone returned %5, double* nocapture readnone %6, double* nocapture readnone %7) {
ret double* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strlen(char *);
int main() {
  char arr[6] = {'H', 'i', '\0', 'h', 'i', '\0'};
  printf("%s\n", arr);
  printf("%zu\n", strlen(arr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    -0xa(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x69,0xc(%rsp)
movl   $0x68006948,0x8(%rsp)
68
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i8] c"Hi\00hi\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i8* @strlen(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i8] c"Hi\00hi\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"%zu\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @strlen(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
int PDMCCompare2(P, PDMCQStruct)
struct Person **P;
struct AllPeopleStruct *PDMCQStruct;
{
  return (0);
}


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

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

LLVM IR (-O0):
%struct.Person = type opaque
%struct.AllPeopleStruct = type opaque
define i32 @PDMCCompare2(%struct.Person** %0, %struct.AllPeopleStruct* %1) {
%3 = alloca %struct.Person**
%4 = alloca %struct.AllPeopleStruct*
store %struct.Person** %0, %struct.Person*** %3
store %struct.AllPeopleStruct* %1, %struct.AllPeopleStruct** %4
ret i32 0
}

LLVM IR (-O2):
%struct.Person = type opaque
%struct.AllPeopleStruct = type opaque
define i32 @PDMCCompare2(%struct.Person** nocapture readnone %0, %struct.AllPeopleStruct* nocapture readnone %1) {
ret i32 0
}
signed short huffman_codebook(unsigned char i) {
  static const unsigned int data = 16428320;
  if (i == 0)
    return (signed short)(data >> 16) & 0xFFFF;
  else
    return (signed short)data & 0xFFFF;
}


x86 assembly (clang, -O0):
<huffman_codebook>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x0,%eax
jne    1122 <huffman_codebook+0x22>
movw   $0xfa,-0x2(%rbp)
jmp    1128 <huffman_codebook+0x28>
movw   $0xad20,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<huffman_codebook>:
test   %edi,%edi
mov    $0xfa,%ecx
mov    $0xad20,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
@huffman_codebook.data = internal constant i32 16428320
define signext i16 @huffman_codebook(i8 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 250, i16* %2
br label %9
8: ; preds = %1
store i16 -21216, i16* %2
br label %9
9: ; preds = %8, %7
%10 = load i16, i16* %2
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @huffman_codebook(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i16 250, i16 -21216
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Flow_MemFree(void **buffer) {
  if (*buffer) {
    free(*buffer);
    *buffer = NULL;
  }
}


x86 assembly (clang, -O0):
<Flow_MemFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <Flow_MemFree+0x31>
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):
<Flow_MemFree>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <Flow_MemFree+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Flow_MemFree(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 5;
  int *p = &i;
  int **q = &p;
  printf("p is %d, q is %d\n", *p, **q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"p is %d, q is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ iterateB(int);
int /*<<< orphan*/ printf(char *, ...);
void iterateA(int n) {
  int j = 0;
  for (j = 0; j < n; j++) {
    printf("iterateA j = %d\n", j);
  }
  printf("\n");
  iterateB(5);
}


x86 assembly (clang, -O0):
<iterateA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1164 <iterateA+0x44>
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <iterateA+0x19>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <iterateB@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterateA>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1163 <iterateA+0x33>
mov    %edi,%ebx
lea    0xebf(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1150 <iterateA+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <iterateB@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"iterateA j = %d\0A\00"
define void @iterateA(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @iterateB(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int whatami(int);
int main(void) {
  int num;
  printf("%d\n", num);
  printf("%d\n", whatami(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <whatami@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
call   1040 <whatami@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @whatami(i32 undef)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ LongSwap(int /*<<< orphan*/);
float FloatSwap(float f) {
  union {
    float f;
    uint32_t l;
  } dat1, dat2;
  dat1.f = f;
  dat2.l = LongSwap(dat1.l);
  return dat2.f;
}


x86 assembly (clang, -O0):
<FloatSwap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <LongSwap@plt>
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FloatSwap>:
push   %rax
movd   %xmm0,%edi
call   1030 <LongSwap@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @FloatSwap(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = bitcast %union.anon* %3 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
%9 = call i32 @LongSwap(i32 %8)
%10 = bitcast %union.anon* %4 to i32*
store i32 %9, i32* %10
%11 = bitcast %union.anon* %4 to float*
%12 = load float, float* %11
ret float %12
}

LLVM IR (-O2):
define float @FloatSwap(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @LongSwap(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ ems1Stok(char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void emsSeti(const char *token, int ivalue) {
  char str[200 + 1];
  ;
  ;
  sprintf(str, "%d", ivalue);
  ems1Stok(token, str);
  return;
}


x86 assembly (clang, -O0):
<emsSeti>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <ems1Stok@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emsSeti>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ems1Stok@plt>
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @emsSeti(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [201 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [201 x i8], [201 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [201 x i8], [201 x i8]* %5, i64 0, i64 0
%11 = call i32 @ems1Stok(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @emsSeti(i8* %0, i32 %1) {
%3 = alloca [201 x i8]
%4 = getelementptr inbounds [201 x i8], [201 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @ems1Stok(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int getpgrp();
int machdep_sys_wait4(int, int *, int, int /*<<< orphan*/ *);
machdep_sys_waitpid(int pid, int *statusp, int options) {
  if (pid == -1)
    pid = 0;
  else if (pid == 0)
    pid = -getpgrp();
  return machdep_sys_wait4(pid, statusp, options, NULL);
}


x86 assembly (clang, -O0):
<machdep_sys_waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1148 <machdep_sys_waitpid+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1167 <machdep_sys_waitpid+0x47>
cmpl   $0x0,-0x4(%rbp)
jne    1162 <machdep_sys_waitpid+0x42>
mov    $0x0,%al
call   1040 <getpgrp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <machdep_sys_waitpid+0x47>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <machdep_sys_wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_waitpid>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
cmp    $0xffffffff,%edi
je     113e <machdep_sys_waitpid+0x1e>
test   %edi,%edi
jne    1140 <machdep_sys_waitpid+0x20>
xor    %eax,%eax
call   1040 <getpgrp@plt>
mov    %eax,%edi
neg    %edi
jmp    1140 <machdep_sys_waitpid+0x20>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <machdep_sys_wait4@plt>

LLVM IR (-O0):
define i32 @machdep_sys_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %3
store i32 0, i32* %4
br label %17
10: ; preds = %3
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i32 (...) @getpgrp()
%15 = sub nsw i32 0, %14
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %10
br label %17
17: ; preds = %16, %9
%18 = load i32, i32* %4
%19 = load i32*, i32** %5
%20 = load i32, i32* %6
%21 = call i32 @machdep_sys_wait4(i32 %18, i32* %19, i32 %20, i32* null)
ret i32 %21
}

LLVM IR (-O2):
define i32 @machdep_sys_waitpid(i32 %0, i32* %1, i32 %2) {
switch i32 %0, label %7 [
i32 -1, label %8
i32 0, label %4
]
4: ; preds = %3
%5 = tail call i32 (...) @getpgrp()
%6 = sub nsw i32 0, %5
br label %8
7: ; preds = %3
br label %8
8: ; preds = %3, %7, %4
%9 = phi i32 [ %6, %4 ], [ 0, %3 ], [ %0, %7 ]
%10 = tail call i32 @machdep_sys_wait4(i32 %9, i32* %1, i32 %2, i32* null)
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_CLR(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ debugprintf(char *, int);
void close_client(int clisock, fd_set *master) {
  debugprintf("closing client socket: %d.\n", clisock);
  close(clisock);
  FD_CLR(clisock, master);
}


x86 assembly (clang, -O0):
<close_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <debugprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <FD_CLR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_client>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
call   1030 <debugprintf@plt>
mov    %ebp,%edi
call   1040 <close@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <FD_CLR@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"closing client socket: %d.\0A\00"
define void @close_client(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 = call i32 @debugprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = call i32 @FD_CLR(i32 %9, i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"closing client socket: %d.\0A\00"
define void @close_client(i32 %0, i32* %1) {
%3 = tail call i32 @debugprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @close(i32 %0)
%5 = tail call i32 @FD_CLR(i32 %0, i32* %1)
ret void
}
void libmsamr_init() {}


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

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

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

LLVM IR (-O2):
define void @libmsamr_init() {
ret void
}
int get_garbage() {
  static int garbage[] = {
      0xaabbccdd, 0xffffffff, 0x0000ffff, 0xffff0000,
      0x00001234, 0x00004321, 0x1a2b3c4d, 0xa1b2c3d4,
  };
  const int garbage_cnt = sizeof(garbage) / sizeof(garbage[0]);
  static int p = 0;
  if (p == garbage_cnt)
    return garbage[p = 0];
  else
    return garbage[p++];
}


x86 assembly (clang, -O0):
<get_garbage>:
push   %rbp
mov    %rsp,%rbp
movl   $0x8,-0x8(%rbp)
cmpl   $0x8,0x2f42(%rip)
jne    1130 <get_garbage+0x30>
movl   $0x0,0x2f32(%rip)
mov    0x2f08(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <get_garbage+0x51>
mov    0x2f1e(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f13(%rip)
movslq %eax,%rcx
lea    0x2ee5(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_garbage>:
movslq 0x2f1d(%rip),%rax
cmp    $0x8,%rax
jne    111d <get_garbage+0x1d>
movl   $0x0,0x2f0d(%rip)
mov    $0xaabbccdd,%eax
ret
lea    0x1(%rax),%ecx
mov    %ecx,0x2efe(%rip)
lea    0xed3(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@get_garbage.garbage = internal global [8 x i32] [i32 -1430532899, i32 -1, i32 65535, i32 -65536, i32 4660, i32 17185, i32 439041101, i32 -1582119980]
@get_garbage.p = internal global i32 0
define i32 @get_garbage() {
%1 = alloca i32
%2 = alloca i32
store i32 8, i32* %2
%3 = load i32, i32* @get_garbage.p
%4 = icmp eq i32 %3, 8
br i1 %4, label %5, label %7
5: ; preds = %0
store i32 0, i32* @get_garbage.p
%6 = load i32, i32* getelementptr inbounds ([8 x i32], [8 x i32]* @get_garbage.garbage, i64 0, i64 0)
store i32 %6, i32* %1
br label %13
7: ; preds = %0
%8 = load i32, i32* @get_garbage.p
%9 = add nsw i32 %8, 1
store i32 %9, i32* @get_garbage.p
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds [8 x i32], [8 x i32]* @get_garbage.garbage, i64 0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %1
br label %13
13: ; preds = %7, %5
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@get_garbage.garbage = internal unnamed_addr constant [8 x i32] [i32 -1430532899, i32 -1, i32 65535, i32 -65536, i32 4660, i32 17185, i32 439041101, i32 -1582119980]
@get_garbage.p = internal unnamed_addr global i32 0
define i32 @get_garbage() {
%1 = load i32, i32* @get_garbage.p
%2 = icmp eq i32 %1, 8
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 0, i32* @get_garbage.p
br label %9
4: ; preds = %0
%5 = add nsw i32 %1, 1
store i32 %5, i32* @get_garbage.p
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @get_garbage.garbage, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %4, %3
%10 = phi i32 [ -1430532899, %3 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freetab(double **tab) {
  int i, n;
  n = (int)*(*(tab));
  for (i = 0; i <= n; i++) {
    free((char *)*(tab + i));
  }
  free((char *)tab);
}


x86 assembly (clang, -O0):
<freetab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     115c <freetab+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <freetab+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freetab>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%rax
cvttsd2si (%rax),%r15d
test   %r15d,%r15d
js     1142 <freetab+0x32>
add    $0x1,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freetab+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freetab(double** %0) {
%2 = alloca double**
%3 = alloca i32
%4 = alloca i32
store double** %0, double*** %2
%5 = load double**, double*** %2
%6 = load double*, double** %5
%7 = load double, double* %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %4
store i32 0, i32* %3
br label %9
9: ; preds = %21, %1
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load double**, double*** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double*, double** %14, i64 %16
%18 = load double*, double** %17
%19 = bitcast double* %18 to i8*
%20 = call i32 @free(i8* %19)
br label %21
21: ; preds = %13
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %9
24: ; preds = %9
%25 = load double**, double*** %2
%26 = bitcast double** %25 to i8*
%27 = call i32 @free(i8* %26)
ret void
}

LLVM IR (-O2):
define void @freetab(double** nocapture %0) {
%2 = load double*, double** %0
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %1
%7 = add nuw i32 %4, 1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %15, %9 ]
%11 = getelementptr inbounds double*, double** %0, i64 %10
%12 = bitcast double** %11 to i8**
%13 = load i8*, i8** %12
%14 = tail call i32 @free(i8* %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %1
%18 = bitcast double** %0 to i8*
%19 = tail call i32 @free(i8* %18)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
uint8_t get_interrupt_defaults(uint8_t address, uint8_t port) {
  return get_port(address, port, 0x06, 0x07);
}


x86 assembly (clang, -O0):
<get_interrupt_defaults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x6,%edx
mov    $0x7,%ecx
call   1030 <get_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_interrupt_defaults>:
mov    $0x6,%edx
mov    $0x7,%ecx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @get_interrupt_defaults(i32 %0, i32 %1) {
%3 = tail call i32 @get_port(i32 %0, i32 %1, i32 6, i32 7)
ret i32 %3
}
/* Variables and functions */
int findFreeFdSlot();
int /*<<< orphan*/ wrapFd(int);
int wrapFdFillsSlot() {
  int freeSlot;
  int fd = 123;
  freeSlot = findFreeFdSlot();
  wrapFd(fd);
  if (findFreeFdSlot() != freeSlot) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<wrapFdFillsSlot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7b,-0xc(%rbp)
mov    $0x0,%al
call   1040 <findFreeFdSlot@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <wrapFd@plt>
mov    $0x0,%al
call   1040 <findFreeFdSlot@plt>
cmp    -0x8(%rbp),%eax
je     115d <wrapFdFillsSlot+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <wrapFdFillsSlot+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapFdFillsSlot>:
push   %rbx
xor    %eax,%eax
call   1040 <findFreeFdSlot@plt>
mov    %eax,%ebx
mov    $0x7b,%edi
call   1030 <wrapFd@plt>
xor    %eax,%eax
call   1040 <findFreeFdSlot@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @wrapFdFillsSlot() {
%1 = tail call i32 (...) @findFreeFdSlot()
%2 = tail call i32 @wrapFd(i32 123)
%3 = tail call i32 (...) @findFreeFdSlot()
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char *safe_strdup_impl(const char *s, char *allocated) {
  strcpy(allocated, s);
  return allocated;
}


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

x86 assembly (clang, -O2):
<safe_strdup_impl>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_strdup_impl(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 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @safe_strdup_impl(i8* %0, i8* returned %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* %0)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 0;
  do {
    i++;
    printf(" Hola ");
  } while (i < 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xa,-0x8(%rbp)
jl     1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c" Hola \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_alrm(int signo) { printf("sigalarm in sleep1.c\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"sigalarm in sleep1.c\0A\00"
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"sigalarm in sleep1.c\00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double drand2();
double log(double);
double ranexp(void) {
  double x, t;
  t = (drand2());
  x = -log(1.0 - t);
  return x;
}


x86 assembly (clang, -O0):
<ranexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <drand2@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranexp>:
push   %rax
xor    %eax,%eax
call   1030 <drand2@plt>
movsd  0xed0(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <log@plt>
xorpd  0xecb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ranexp() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @drand2()
store double %3, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
%6 = call double @log(double %5)
%7 = fneg double %6
store double %7, double* %1
%8 = load double, double* %1
ret double %8
}

LLVM IR (-O2):
define double @ranexp() {
%1 = tail call double (...) @drand2()
%2 = fsub double 1.000000e+00, %1
%3 = tail call double @log(double %2)
%4 = fneg double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ _qspallint(long long *, long long, long long, long long *);
void qsortllint(long long int *a, long long int b, long long int e) {
  long long int p;
  if (b < e) {
    _qspallint(a, b, e, &p);
    qsortllint(a, b, p - 1);
    qsortllint(a, p + 1, e);
  }
}


x86 assembly (clang, -O0):
<qsortllint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1181 <qsortllint+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <_qspallint@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1040 <qsortllint@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
call   1040 <qsortllint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsortllint>:
cmp    %rdx,%rsi
jge    1172 <qsortllint+0x52>
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x8(%rsp),%rcx
call   1030 <_qspallint@plt>
mov    0x8(%rsp),%rdx
add    $0xffffffffffffffff,%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <qsortllint@plt>
mov    0x8(%rsp),%rsi
add    $0x1,%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1040 <qsortllint@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @qsortllint(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i64*, i64** %4
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = call i32 @_qspallint(i64* %12, i64 %13, i64 %14, i64* %7)
%16 = load i64*, i64** %4
%17 = load i64, i64* %5
%18 = load i64, i64* %7
%19 = sub nsw i64 %18, 1
%20 = load i64*, i64** %4
%21 = load i64, i64* %7
%22 = add nsw i64 %21, 1
%23 = load i64, i64* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @qsortllint(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = icmp slt i64 %1, %2
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = call i32 @_qspallint(i64* %0, i64 %1, i64 %2, i64* %4)
%9 = load i64, i64* %4
%10 = add nsw i64 %9, -1
%11 = load i64, i64* %4
%12 = add nsw i64 %11, 1
br label %13
13: ; preds = %7, %3
ret void
}
void platform_log(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @platform_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  char *p = (void *)s;
  size_t length = 0;
  while (*p++ != 0)
    length++;
  return length;
}


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

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

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i64 0, i64* %4
br label %6
6: ; preds = %12, %1
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = load i64, i64* %4
%14 = add i64 %13, 1
store i64 %14, i64* %4
br label %6
15: ; preds = %6
%16 = load i64, i64* %4
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 i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 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 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
double V_blendIndexedOnEdge(int i, double *L) {
  if (i == 0)
    return 0.5 * (1.0 - L[0]);
  else
    return 0.5 * (1.0 + L[0]);
}


x86 assembly (clang, -O0):
<V_blendIndexedOnEdge>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113b <V_blendIndexedOnEdge+0x3b>
mov    -0x18(%rbp),%rax
movsd  0xee7(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0xed3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115c <V_blendIndexedOnEdge+0x5c>
mov    -0x18(%rbp),%rax
movsd  0xec1(%rip),%xmm1
addsd  (%rax),%xmm1
movsd  0xead(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<V_blendIndexedOnEdge>:
movsd  (%rsi),%xmm0
test   %edi,%edi
jne    1110 <V_blendIndexedOnEdge+0x10>
xorpd  0xef0(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @V_blendIndexedOnEdge(i32 %0, double* %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = fsub double 1.000000e+00, %11
%13 = fmul double 5.000000e-01, %12
store double %13, double* %3
br label %20
14: ; preds = %2
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double, double* %16
%18 = fadd double 1.000000e+00, %17
%19 = fmul double 5.000000e-01, %18
store double %19, double* %3
br label %20
20: ; preds = %14, %8
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @V_blendIndexedOnEdge(i32 %0, double* nocapture %1) {
%3 = icmp eq i32 %0, 0
%4 = load double, double* %1
%5 = fneg double %4
%6 = select i1 %3, double %5, double %4
%7 = fadd double %6, 1.000000e+00
%8 = fmul double %7, 5.000000e-01
ret double %8
}