xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ gdb_test_infcall();
void *malloc(int);
int main(void) {
  void *p;
  gdb_test_infcall();
  p = malloc(1);
  if (p == NULL)
    return 1;
  free(p);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gdb_test_infcall@plt>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <main+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1184 <main+0x54>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <gdb_test_infcall@plt>
mov    $0x1,%ebp
mov    $0x1,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1163 <main+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gdb_test_infcall()
%2 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %8
}
void ff_get_atom_xyz(struct ff *ff, int idx, double *xyz) {
  (void)ff;
  (void)idx;
  (void)xyz;
}


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

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

LLVM IR (-O0):
%struct.ff = type opaque
define void @ff_get_atom_xyz(%struct.ff* %0, i32 %1, double* %2) {
%4 = alloca %struct.ff*
%5 = alloca i32
%6 = alloca double*
store %struct.ff* %0, %struct.ff** %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load %struct.ff*, %struct.ff** %4
%8 = load i32, i32* %5
%9 = load double*, double** %6
ret void
}

LLVM IR (-O2):
%struct.ff = type opaque
define void @ff_get_atom_xyz(%struct.ff* nocapture %0, i32 %1, double* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_msg(char *);
int socket(int, int, int);
int Socket(int family, int type, int protocol) {
  int fd = socket(family, type, protocol);
  if (fd < 0)
    err_msg("socket failed \n");
  return fd;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1158 <Socket+0x38>
lea    0xead(%rip),%rdi
call   1030 <err_msg@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Socket+0x18>
lea    0xecd(%rip),%rdi
call   1030 <err_msg@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"socket failed \0A\00"
define i32 @Socket(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
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @err_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [16 x i8] c"socket failed \0A\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
uint8_t cmnReadRegister8(volatile void *Register) {
  return *(volatile uint8_t *)Register;
}


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

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

LLVM IR (-O0):
define i32 @cmnReadRegister8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @cmnReadRegister8(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *memcpy(void *, void *, unsigned int);
int /*<<< orphan*/ printf(char *, void *, void *);
void checked_memcpy(void *dst, void *src, unsigned n) {
  void *ret = memcpy(dst, src, n);
  if (ret != dst) {
    printf("Wrong memcpy return value: %p != %p\n", ret, dst);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checked_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1183 <checked_memcpy+0x53>
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_memcpy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <memcpy@plt>
cmp    %rbx,%rax
jne    1140 <checked_memcpy+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Wrong memcpy return value: %p != %p\0A\00"
define void @checked_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @memcpy(i8* %8, i8* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = icmp ne i8* %12, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = load i8*, i8** %4
%18 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Wrong memcpy return value: %p != %p\0A\00"
define void @checked_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @memcpy(i8* %0, i8* %1, i32 %2)
%5 = icmp eq i8* %4, %0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
int main() {
  int a;
  int b;
  int c;
  if (a && (b + a)) {
    c = -a;
  } else {
  A:
    b = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1131 <main+0x31>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1131 <main+0x31>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x3d>
jmp    1136 <main+0x36>
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
swap(char *a, char *b) {
  char c;
  c = *a;
  *a = *b;
  *b = c;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define i32 @swap(i8* %0, i8* %1) {
%3 = alloca i32
%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* %7
store i8 %8, i8* %6
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
store i8 %10, i8* %11
%12 = load i8, i8* %6
%13 = load i8*, i8** %5
store i8 %12, i8* %13
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __crow_f1();
int expect(int, int /*<<< orphan*/);
int test_f1() { return expect(42, __crow_f1()); }


x86 assembly (clang, -O0):
<test_f1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__crow_f1@plt>
mov    %eax,%esi
mov    $0x2a,%edi
call   1030 <expect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_f1>:
push   %rax
xor    %eax,%eax
call   1040 <__crow_f1@plt>
mov    $0x2a,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <expect@plt>

LLVM IR (-O0):
define i32 @test_f1() {
%1 = call i32 (...) @__crow_f1()
%2 = call i32 @expect(i32 42, i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_f1() {
%1 = tail call i32 (...) @__crow_f1()
%2 = tail call i32 @expect(i32 42, i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_insecure_channel_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


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

x86 assembly (clang, -O2):
<grpcsharp_insecure_channel_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_insecure_channel_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_insecure_channel_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void click() { system("xdotool click 1"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"xdotool click 1\00"
define void @click() {
%1 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"xdotool click 1\00"
define void @click() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
int default_askend(struct cnode *cnode, const struct cnodefuncs *type) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.cnode = type opaque
%struct.cnodefuncs = type opaque
define i32 @default_askend(%struct.cnode* nocapture readnone %0, %struct.cnodefuncs* nocapture readnone %1) {
ret i32 1
}
int vde_chain_nm5_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 4;
  if (sz_res)
    *sz_res = 3;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 58;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm5_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm5_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm5_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm5_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm5_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x3a,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm5_work>:
test   %rdi,%rdi
je     110b <vde_chain_nm5_work+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm5_work+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm5_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm5_work+0x2c>
movl   $0x3a,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vde_chain_nm5_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 4, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 3, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 58, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @vde_chain_nm5_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 58, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
int g4(int a, int b) {
  return ((a) > (((b) < (a) ? (b) : (a))) ? (a) : (((b) < (a) ? (b) : (a))));
}


x86 assembly (clang, -O0):
<g4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1127 <g4+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112d <g4+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jle    1146 <g4+0x46>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <g4+0x69>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115d <g4+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1163 <g4+0x63>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g4(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 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
br label %13
11: ; preds = %2
%12 = load i32, i32* %3
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
%15 = icmp sgt i32 %5, %14
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32, i32* %3
br label %28
18: ; preds = %13
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load i32, i32* %4
br label %26
24: ; preds = %18
%25 = load i32, i32* %3
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
br label %28
28: ; preds = %26, %16
%29 = phi i32 [ %17, %16 ], [ %27, %26 ]
ret i32 %29
}

LLVM IR (-O2):
define i32 @g4(i32 returned %0, i32 %1) {
ret i32 %0
}
char *posToString(char *input[], int pos) { return input[pos]; }


x86 assembly (clang, -O0):
<posToString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posToString>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i8* @posToString(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @posToString(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle10() { kprintf("ISR %d.\n", 10); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle10() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 10)
ret void
}
void sg_mem_destroy_comp(void) {}


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

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

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

LLVM IR (-O2):
define void @sg_mem_destroy_comp() {
ret void
}
char _echo_4(char a) { return (a); }


x86 assembly (clang, -O0):
<_echo_4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @_echo_4(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @_echo_4(i8 returned signext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void regular_printflush(void) { fflush(stdout); }


x86 assembly (clang, -O0):
<regular_printflush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
define void @regular_printflush() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @regular_printflush() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ init();
int /*<<< orphan*/ loop();
int main() {
  if (!init()) {
    cleanup();
    return EXIT_FAILURE;
  }
  loop();
  cleanup();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
cmp    $0x0,%eax
jne    1167 <main+0x37>
mov    $0x0,%al
call   1050 <cleanup@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <main+0x51>
mov    $0x0,%al
call   1030 <loop@plt>
mov    $0x0,%al
call   1050 <cleanup@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <init@plt>
test   %eax,%eax
je     114c <main+0x1c>
xor    %eax,%eax
call   1030 <loop@plt>
mov    0x2e8e(%rip),%rbx
jmp    1153 <main+0x23>
mov    0x2e8d(%rip),%rbx
xor    %eax,%eax
call   1050 <cleanup@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = icmp ne i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i32 (...) @cleanup()
%6 = load i32, i32* @EXIT_FAILURE
store i32 %6, i32* %1
br label %11
7: ; preds = %0
%8 = call i32 (...) @loop()
%9 = call i32 (...) @cleanup()
%10 = load i32, i32* @EXIT_SUCCESS
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @loop()
br label %5
5: ; preds = %0, %3
%6 = phi i32* [ @EXIT_SUCCESS, %3 ], [ @EXIT_FAILURE, %0 ]
%7 = tail call i32 (...) @cleanup()
%8 = load i32, i32* %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ set(int *);
int main(void) {
  int a, b, c;
  a = 8;
  b = 1;
  c = 3;
  b = 3;
  c = 5;
  set(&a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x8,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <set@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 8, i32* %1
%3 = call i32 @set(i32* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ m_len(int);
int /*<<< orphan*/ m_setlen(int, scalar_t__);
void m_drop(int m) { m_setlen(m, m_len(m) - 1); }


x86 assembly (clang, -O0):
<m_drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_len@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rsi
sub    $0x1,%rsi
call   1040 <m_setlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_drop>:
push   %rbx
mov    %edi,%ebx
call   1030 <m_len@plt>
lea    -0x1(%rax),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <m_setlen@plt>

LLVM IR (-O0):
define void @m_drop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @m_len(i32 %4)
%6 = sub nsw i64 %5, 1
%7 = call i32 @m_setlen(i32 %3, i64 %6)
ret void
}

LLVM IR (-O2):
define void @m_drop(i32 %0) {
%2 = tail call i64 @m_len(i32 %0)
%3 = add nsw i64 %2, -1
%4 = tail call i32 @m_setlen(i32 %0, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
unsigned int pthread_get_mutex_size() { return sizeof(pthread_mutex_t); }


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

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

LLVM IR (-O0):
define i32 @pthread_get_mutex_size() {
ret i32 4
}

LLVM IR (-O2):
define i32 @pthread_get_mutex_size() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ vec2f(float, float);
float vec2f_length(int /*<<< orphan*/);
float call_length2(float x, float y) { return vec2f_length(vec2f(x, y)); }


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

x86 assembly (clang, -O2):
<call_length2>:
push   %rax
call   1040 <vec2f@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <vec2f_length@plt>

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

LLVM IR (-O2):
define float @call_length2(float %0, float %1) {
%3 = tail call i32 @vec2f(float %0, float %1)
%4 = tail call float @vec2f_length(i32 %3)
ret float %4
}
unsigned long int unsignedlongint_ignoring_shortint(unsigned long int x,
                                                    short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlongint_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlongint_ignoring_shortint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlongint_ignoring_shortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_shortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int imprimir_menu(int n_argumentos, char *s_argumentos[]) {
  int i;
  for (i = 1; i < n_argumentos; i++) {
    printf("%s.\n", s_argumentos[i]);
  }
  return 1;
}


x86 assembly (clang, -O0):
<imprimir_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <imprimir_menu+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <imprimir_menu+0x16>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_menu>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <imprimir_menu+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <imprimir_menu+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"MBEDTLS_TIMING_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"MBEDTLS_TIMING_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dlag2s_(int *, int *, double *, int *, float *, int *,
                           int *);
int aa_cla_dlag2s(int M, int N, double *A, int LDA, float *SA, int LDSA) {
  int info = 0;
  dlag2s_(&M, &N, A, &LDA, SA, &LDSA, &info);
  return info;
}


x86 assembly (clang, -O0):
<aa_cla_dlag2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    -0x24(%rbp),%r9
lea    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <dlag2s_@plt>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dlag2s>:
sub    $0x28,%rsp
mov    %edi,0x24(%rsp)
mov    %esi,0x20(%rsp)
mov    %ecx,0x1c(%rsp)
mov    %r9d,0x18(%rsp)
movl   $0x0,0x14(%rsp)
lea    0x14(%rsp),%rax
mov    %rax,(%rsp)
lea    0x24(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x1c(%rsp),%rcx
lea    0x18(%rsp),%r9
call   1030 <dlag2s_@plt>
mov    0x14(%rsp),%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @aa_cla_dlag2s(i32 %0, i32 %1, double* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%12 = bitcast i32* %11 to i8*
store i32 0, i32* %11
%13 = call i32 @dlag2s_(i32* %7, i32* %8, double* %2, i32* %9, float* %4, i32* %10, i32* %11)
%14 = load i32, i32* %11
ret i32 %14
}
swap(a, b) int *a, *b;
{
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
void forget_locs_latest_prune(unsigned int n) {
  int x;
  int *a[5];
  if (n < 5) {
    x = 1;
  } else {
    x = 0;
    x = 2;
  }
  if (x) {
    a[n] = 0;
  }
}


x86 assembly (clang, -O0):
<forget_locs_latest_prune>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jae    111d <forget_locs_latest_prune+0x1d>
movl   $0x1,-0x8(%rbp)
jmp    112b <forget_locs_latest_prune+0x2b>
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1141 <forget_locs_latest_prune+0x41>
mov    -0x4(%rbp),%eax
movq   $0x0,-0x30(%rbp,%rax,8)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @forget_locs_latest_prune(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x i32*]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %3
br label %9
8: ; preds = %1
store i32 0, i32* %3
store i32 2, i32* %3
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds [5 x i32*], [5 x i32*]* %4, i64 0, i64 %14
store i32* null, i32** %15
br label %16
16: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @forget_locs_latest_prune(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void ignoreSigpipe() { signal(SIGPIPE, SIG_IGN); }


x86 assembly (clang, -O0):
<ignoreSigpipe>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoreSigpipe>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @ignoreSigpipe() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @ignoreSigpipe() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thread1Print(void *params __attribute__((unused))) {
  printf("I am thread 1\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"I am thread 1\0A\00"
define i8* @thread1Print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [14 x i8] c"I am thread 1\00"
define noalias i8* @thread1Print(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  int ret = 0;
  int n = -12;
  char s[12 + 1];
  int width = 10;
  itoa(n, s, width);
  reverse(s);
  printf("\n The value of the number %d is\n%s", n, s);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xfffffff4,-0xc(%rbp)
movl   $0xa,-0x20(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x19(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1050 <itoa@plt>
lea    -0x19(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0xc(%rbp),%esi
lea    -0x19(%rbp),%rdx
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x3(%rsp),%rbx
mov    $0xfffffff4,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1050 <itoa@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xea5(%rip),%rdi
mov    $0xfffffff4,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0A The value of the number %d is\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [13 x i8]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 -12, i32* %3
store i32 10, i32* %5
%6 = load i32, i32* %3
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %5
%9 = call i32 @itoa(i32 %6, i8* %7, i32 %8)
%10 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%11 = call i32 @reverse(i8* %10)
%12 = load i32, i32* %3
%13 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0A The value of the number %d is\0A%s\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 -12, i8* %2, i32 10)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 -12, i8* %2)
ret i32 0
}
int Tcl_DbCkfree(ptr, file, line)
char *ptr;
char *file;
int line;
{
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<Tcl_DbCkfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Tcl_DbCkfree(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
tail call void @free(i8* %0)
ret i32 0
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int /*<<< orphan*/ fegetenv(int *);
int /*<<< orphan*/ fesetenv(int *);
int fesetexceptflag(const fexcept_t *__flagp, int __excepts) {
  fexcept_t __fpscr;
  fegetenv(&__fpscr);
  __fpscr &= ~__excepts;
  __fpscr |= *__flagp & __excepts;
  fesetenv(&__fpscr);
  return 0;
}


x86 assembly (clang, -O0):
<fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <fegetenv@plt>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <fesetenv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetexceptflag>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <fegetenv@plt>
mov    0xc(%rsp),%eax
mov    (%rbx),%ecx
xor    %eax,%ecx
and    %ebp,%ecx
xor    %eax,%ecx
mov    %ecx,0xc(%rsp)
mov    %r14,%rdi
call   1030 <fesetenv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fesetexceptflag(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 @fegetenv(i32* %5)
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = load i32, i32* %5
%10 = and i32 %9, %8
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32, i32* %4
%14 = and i32 %12, %13
%15 = load i32, i32* %5
%16 = or i32 %15, %14
store i32 %16, i32* %5
%17 = call i32 @fesetenv(i32* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @fesetexceptflag(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fegetenv(i32* %3)
%6 = xor i32 %1, -1
%7 = load i32, i32* %3
%8 = and i32 %7, %6
%9 = load i32, i32* %0
%10 = and i32 %9, %1
%11 = or i32 %10, %8
store i32 %11, i32* %3
%12 = call i32 @fesetenv(i32* %3)
ret i32 0
}
/* Variables and functions */
void *__cxa_begin_catch(void *);
void *_ITM_cxa_begin_catch(void *exc_ptr) { return __cxa_begin_catch(exc_ptr); }


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

x86 assembly (clang, -O2):
<_ITM_cxa_begin_catch>:
jmp    1030 <__cxa_begin_catch@plt>

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

LLVM IR (-O2):
define i8* @_ITM_cxa_begin_catch(i8* %0) {
%2 = tail call i8* @__cxa_begin_catch(i8* %0)
ret i8* %2
}
void d_alloc(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<d_alloc>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_alloc>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.d_alloc = [8 x i8] c"d_alloc\00"
define void @d_alloc() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.d_alloc, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.d_alloc = [8 x i8] c"d_alloc\00"
define void @d_alloc() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.d_alloc, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rlimit {
  int rlim_cur;
  int rlim_max;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ down1(int);
int /*<<< orphan*/ down2(int);
scalar_t__ setrlimit(int /*<<< orphan*/, struct rlimit *);
int main(void) {
  struct rlimit r;
  r.rlim_cur = 8192 * 1024;
  r.rlim_max = 8192 * 1024;
  if (setrlimit(RLIMIT_STACK, &r) != 0)
    abort();
  down1(1000);
  down2(1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x800000,-0x10(%rbp)
movl   $0x800000,-0xc(%rbp)
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1050 <setrlimit@plt>
cmp    $0x0,%rax
je     1180 <main+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x3e8,%edi
call   1060 <down1@plt>
mov    $0x3e8,%edi
call   1040 <down2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x80000000800000,%rax
mov    %rax,(%rsp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1050 <setrlimit@plt>
test   %rax,%rax
jne    117d <main+0x3d>
mov    $0x3e8,%edi
call   1060 <down1@plt>
mov    $0x3e8,%edi
call   1040 <down2@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
store i32 8388608, i32* %3
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 1
store i32 8388608, i32* %4
%5 = load i32, i32* @RLIMIT_STACK
%6 = call i64 @setrlimit(i32 %5, %struct.rlimit* %2)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @down1(i32 1000)
%12 = call i32 @down2(i32 1000)
ret i32 0
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
store i32 8388608, i32* %3
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 1
store i32 8388608, i32* %4
%5 = load i32, i32* @RLIMIT_STACK
%6 = call i64 @setrlimit(i32 %5, %struct.rlimit* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @down1(i32 1000)
%12 = call i32 @down2(i32 1000)
ret i32 0
}