xunge/DecIR huggingface dataset:
int tcp_wrapping_check(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tcp_wrapping_check(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("it was the best of times.\n");
  printf("It was the worst of times.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%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>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"it was the best of times.\0A\00"
@.str.1 = [28 x i8] c"It was the worst of times.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"it was the best of times.\00"
@str.2 = [27 x i8] c"It was the worst of times.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct i2c_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct i2c_client *);
void i2c_unregister_device(struct i2c_client *c) { kfree(c); }


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

x86 assembly (clang, -O2):
<i2c_unregister_device>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.i2c_client = type { i32 }
define void @i2c_unregister_device(%struct.i2c_client* %0) {
%2 = tail call i32 @kfree(%struct.i2c_client* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t le_to_h_u24(const uint8_t *buf) {
  return (uint32_t)((uint32_t)buf[0] | (uint32_t)buf[1] << 8 |
                    (uint32_t)buf[2] << 16);
}


x86 assembly (clang, -O0):
<le_to_h_u24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_h_u24>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le_to_h_u24(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i64*, i64** %2
%14 = getelementptr inbounds i64, i64* %13, i64 2
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @le_to_h_u24(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
ret i32 %13
}
void os_trace_isr_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @os_trace_isr_exit() {
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ ispunct(int);
int isprint(int c) { return ispunct(c) || isalnum(c) || c == ' '; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ispunct@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1169 <isprint+0x49>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1169 <isprint+0x49>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <ispunct@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1148 <isprint+0x28>
mov    %ebp,%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1148 <isprint+0x28>
xor    %ebx,%ebx
cmp    $0x20,%ebp
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ispunct(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isalnum(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 32
br label %13
13: ; preds = %10, %6, %1
%14 = phi i1 [ true, %6 ], [ true, %1 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = tail call i64 @ispunct(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @isalnum(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp eq i32 %0, 32
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %4, %1
%11 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %9, %7 ]
ret i32 %11
}
void strange() {
  char x = (char){
      2,
  };
  char *y = (char[3]){'a', x, x = 'b'};
  char z = ({ 'a', x, x = 'b'; });
}


x86 assembly (clang, -O0):
<strange>:
push   %rbp
mov    %rsp,%rbp
movb   $0x2,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movb   $0x61,-0x13(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x12(%rbp)
movb   $0x62,-0x1(%rbp)
movb   $0x62,-0x11(%rbp)
lea    -0x13(%rbp),%rax
mov    %rax,-0x10(%rbp)
movb   $0x62,-0x1(%rbp)
movb   $0x62,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    %al,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @strange() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8*
%4 = alloca [3 x i8]
%5 = alloca i8
%6 = alloca i8
store i8 2, i8* %2
%7 = load i8, i8* %2
store i8 %7, i8* %1
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
store i8 97, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %1
store i8 %10, i8* %9
%11 = getelementptr inbounds i8, i8* %9, i64 1
store i8 98, i8* %1
store i8 98, i8* %11
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
store i8* %12, i8** %3
%13 = load i8, i8* %1
store i8 98, i8* %1
store i8 98, i8* %6
%14 = load i8, i8* %6
store i8 %14, i8* %5
ret void
}

LLVM IR (-O2):
define void @strange() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int execute(char *cmd) { return !system(cmd); }


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %rax
call   1030 <system@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @execute(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_F6uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xF6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F6uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1056561954816
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RecursiveReturn();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void EndCODE() {
  fputs("}", stdout);
  RecursiveReturn();
}


x86 assembly (clang, -O0):
<EndCODE>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x0,%al
call   1040 <RecursiveReturn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndCODE>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <RecursiveReturn@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"}\00"
@stdout = global i32 0
define void @EndCODE() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @RecursiveReturn()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"}\00"
@stdout = global i32 0
define void @EndCODE() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @RecursiveReturn()
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/fn.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/fn.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/fn.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
double calc_force(double, double);
int /*<<< orphan*/ printf(char *, double);
double readd(char *);
int main() {
  double f, m, a;
  m = readd("Enter the mass");
  a = readd("Enter the acceleration");
  f = calc_force(m, a);
  printf("The force is %.2fN\n", f);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <readd@plt>
movsd  %xmm0,-0x18(%rbp)
lea    0xeb8(%rip),%rdi
call   1040 <readd@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <calc_force@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <readd@plt>
movsd  %xmm0,(%rsp)
lea    0xec6(%rip),%rdi
call   1040 <readd@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
call   1050 <calc_force@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter the mass\00"
@.str.1 = [23 x i8] c"Enter the acceleration\00"
@.str.2 = [20 x i8] c"The force is %.2fN\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call double @readd(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store double %5, double* %3
%6 = call double @readd(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store double %6, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call double @calc_force(double %7, double %8)
store double %9, double* %2
%10 = load double, double* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter the mass\00"
@.str.1 = [23 x i8] c"Enter the acceleration\00"
@.str.2 = [20 x i8] c"The force is %.2fN\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call double @readd(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call double @readd(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call double @calc_force(double %1, double %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ a(int /*<<< orphan*/);
int /*<<< orphan*/ c(int /*<<< orphan*/);
int main() {
  a(0);
  c(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a(i32 0)
%2 = tail call i32 @c(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "-i : interface\n"
                  "-m : show menu (no option required)\n"
                  "-a : station MAC address\n"
                  "-k : network key\n"
                  "-v : be verbose (default: no)\n"
                  "-e : error stream (default: stderr)\n"
                  "-o : output stream (default: stdout)\n"
                  "-s : input stream (default: stdin)\n"
                  "-h : this help\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [247 x i8] c"-i : interface\0A-m : show menu (no option required)\0A-a : station MAC address\0A-k : network key\0A-v : be verbose (default: no)\0A-e : error stream (default: stderr)\0A-o : output stream (default: stdout)\0A-s : input stream (default: stdin)\0A-h : this help\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [247 x i8] c"-i : interface\0A-m : show menu (no option required)\0A-a : station MAC address\0A-k : network key\0A-v : be verbose (default: no)\0A-e : error stream (default: stderr)\0A-o : output stream (default: stdout)\0A-s : input stream (default: stdin)\0A-h : this help\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int arr[], int n) {
  for (int i = 0; i < n; ++i)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
int find_sqrt(int s, int n) {
  if (s * s > n)
    return (-1);
  if (s * s == n)
    return (s);
  return (find_sqrt(s + 1, n));
}


x86 assembly (clang, -O0):
<find_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <find_sqrt+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <find_sqrt+0x56>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1155 <find_sqrt+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <find_sqrt+0x56>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1030 <find_sqrt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_sqrt>:
mov    %edi,%ecx
imul   %edi,%ecx
mov    $0xffffffff,%eax
cmp    %esi,%ecx
jg     1120 <find_sqrt+0x20>
xchg   %ax,%ax
cmp    %esi,%ecx
je     1121 <find_sqrt+0x21>
add    $0x1,%edi
mov    %edi,%ecx
imul   %edi,%ecx
cmp    %esi,%ecx
jle    1110 <find_sqrt+0x10>
ret
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @find_sqrt(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = icmp sgt i32 %3, %1
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i32 [ %11, %9 ], [ %3, %2 ]
%7 = phi i32 [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i32 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = add nsw i32 %7, 1
%11 = mul nsw i32 %10, %10
%12 = icmp sgt i32 %11, %1
br i1 %12, label %13, label %5
13: ; preds = %9, %5, %2
%14 = phi i32 [ -1, %2 ], [ %7, %5 ], [ -1, %9 ]
ret i32 %14
}
/* Variables and functions */
int chmod(char const *, int);
int Sys_Chmod(const char *file, int mode) { return chmod(file, mode); }


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

x86 assembly (clang, -O2):
<Sys_Chmod>:
jmp    1030 <chmod@plt>

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

LLVM IR (-O2):
define i32 @Sys_Chmod(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @chmod(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void utils_int16Copy(void *dst, const void *src) {
  const bool is_big_endian = (*(uint16_t *)"\0\xff" < 0x100);
  if (is_big_endian)
    memcpy(dst, src, 2);
  else {
    const uint16_t *orig = (const uint16_t *)src;
    *((uint16_t *)dst) = (uint16_t)(*orig << 8) | (uint16_t)(*orig >> 8);
  }
}


x86 assembly (clang, -O0):
<utils_int16Copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x100,0xed6(%rip)
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1156 <utils_int16Copy+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
jmp    1178 <utils_int16Copy+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
shl    $0x8,%ecx
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
sar    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_int16Copy>:
mov    (%rsi),%eax
mov    %eax,%ecx
shl    $0x8,%ecx
sar    $0x8,%eax
or     %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\00\FF\00"
define void @utils_int16Copy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* bitcast ([3 x i8]* @.str to i32*)
%8 = icmp slt i32 %7, 256
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @memcpy(i8* %13, i8* %14, i32 2)
br label %28
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i32*
store i32* %18, i32** %6
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = shl i32 %20, 8
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = ashr i32 %23, 8
%25 = or i32 %21, %24
%26 = load i8*, i8** %3
%27 = bitcast i8* %26 to i32*
store i32 %25, i32* %27
br label %28
28: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
define void @utils_int16Copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = ashr i32 %4, 8
%7 = or i32 %5, %6
%8 = bitcast i8* %0 to i32*
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
scalar_t__ _citrus_bcs_isspace(char const);
const char *_citrus_bcs_skip_ws(const char *p) {
  while (*p && _citrus_bcs_isspace(*p))
    p++;
  return (p);
}


x86 assembly (clang, -O0):
<_citrus_bcs_skip_ws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <_citrus_bcs_skip_ws+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <_citrus_bcs_isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <_citrus_bcs_skip_ws+0x47>
jmp    1168 <_citrus_bcs_skip_ws+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <_citrus_bcs_skip_ws+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_bcs_skip_ws>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <_citrus_bcs_skip_ws+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <_citrus_bcs_isspace@plt>
test   %rax,%rax
je     1139 <_citrus_bcs_skip_ws+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_citrus_bcs_skip_ws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_citrus_bcs_skip_ws(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @_citrus_bcs_isspace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @_citrus_bcs_skip_ws(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @_citrus_bcs_isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef void uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sg_put_unaligned_le16(int, void *);
void sg_put_unaligned_le32(uint32_t val, void *p) {
  sg_put_unaligned_le16(val >> 16, (uint8_t *)p + 2);
  sg_put_unaligned_le16(val, p);
}


x86 assembly (clang, -O0):
<sg_put_unaligned_le32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
mov    -0x10(%rbp),%rsi
add    $0x2,%rsi
call   1030 <sg_put_unaligned_le16@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sg_put_unaligned_le16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_put_unaligned_le32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
add    $0x2,%rsi
call   1030 <sg_put_unaligned_le16@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sg_put_unaligned_le16@plt>

LLVM IR (-O0):
define void @sg_put_unaligned_le32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 16
%7 = load i8*, i8** %4
%8 = getelementptr i8, i8* %7, i64 2
%9 = call i32 @sg_put_unaligned_le16(i32 %6, i8* %8)
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 @sg_put_unaligned_le16(i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @sg_put_unaligned_le32(i32 %0, i8* %1) {
%3 = ashr i32 %0, 16
%4 = getelementptr i8, i8* %1, i64 2
%5 = tail call i32 @sg_put_unaligned_le16(i32 %3, i8* %4)
%6 = tail call i32 @sg_put_unaligned_le16(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fxn(int *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int num1 = 1;
  printf("num1 is %d", num1);
  fxn(&num1);
  printf("\nnum1 is %d", num1);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1050 <fxn@plt>
mov    -0x4(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0xec1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1050 <fxn@plt>
mov    0x4(%rsp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"num1 is %d\00"
@.str.1 = [12 x i8] c"\0Anum1 is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @fxn(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @getchar()
ret i32 0
}
int reverseByte(int a) {}


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

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

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

LLVM IR (-O2):
define i32 @reverseByte(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(char *program_name) {
  printf("Usage:\t pyt <a> <b> <c>\nDeclare the variable you are looking for "
         "as '0'.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"Usage:\09 pyt <a> <b> <c>\0ADeclare the variable you are looking for as '0'.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [73 x i8] c"Usage:\09 pyt <a> <b> <c>\0ADeclare the variable you are looking for as '0'.\00"
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ uart_init(int);
void console_init(void) { uart_init(0x16000000); }


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

x86 assembly (clang, -O2):
<console_init>:
mov    $0x16000000,%edi
jmp    1030 <uart_init@plt>

LLVM IR (-O0):
define void @console_init() {
%1 = call i32 @uart_init(i32 369098752)
ret void
}

LLVM IR (-O2):
define void @console_init() {
%1 = tail call i32 @uart_init(i32 369098752)
ret void
}
void StackBurner() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @UI_get0_result_string() {
ret void
}
timer0Init() {
  (*(volatile unsigned int *)((0x3FF0000 + 0x6004)) = (0xffffffff));
  (*(volatile unsigned int *)((0x3FF0000 + 0x6000)) = (1));
}


x86 assembly (clang, -O0):
<timer0Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ff6004,%eax
movl   $0xffffffff,(%rax)
mov    $0x3ff6000,%eax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer0Init>:
movl   $0xffffffff,0x3ff6004
ff ff ff ff
movl   $0x1,0x3ff6000
ret

LLVM IR (-O0):
define i32 @timer0Init() {
%1 = alloca i32
store volatile i32 -1, i32* inttoptr (i64 67067908 to i32*)
store volatile i32 1, i32* inttoptr (i64 67067904 to i32*)
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @timer0Init() {
store volatile i32 -1, i32* inttoptr (i64 67067908 to i32*)
store volatile i32 1, i32* inttoptr (i64 67067904 to i32*)
ret i32 undef
}
int main(int argc, char *argv[]) {
  assert("OK!");
  assert(!"DON'T PANIC!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"OK!\00"
@.str.1 = [13 x i8] c"DON'T PANIC!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"OK!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  unsigned int x = 1;
  if (((char *)&x)[0] == 0) {
    puts("BIG ENDIAN");
  } else {
    puts("LITTLE ENDIAN");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    1144 <main+0x34>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
jmp    1150 <main+0x40>
lea    0xec0(%rip),%rdi
call   1030 <puts@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 = [11 x i8] c"BIG ENDIAN\00"
@.str.1 = [14 x i8] c"LITTLE ENDIAN\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"LITTLE ENDIAN\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void glPointParameterxv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glPointParameterxv() {
ret void
}
/* Variables and functions */
int connect_or_die();
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int snprintf(char *, int, char *, int);
void extend(int t) {
  int fd = connect_or_die();
  char buf[32];
  int n = snprintf(buf, sizeof buf, "extend %d\n", t);
  send(fd, buf, n, 0);
}


x86 assembly (clang, -O0):
<extend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <connect_or_die@plt>
mov    %eax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x20,%esi
lea    0xea8(%rip),%rdx
call   1050 <snprintf@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <connect_or_die@plt>
mov    %eax,%ebp
lea    0xeb6(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    %ebx,%ecx
call   1050 <snprintf@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"extend %d\0A\00"
define void @extend(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [32 x i8]
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (...) @connect_or_die()
store i32 %6, i32* %3
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @snprintf(i8* %7, i32 32, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call i32 @send(i32 %10, i8* %11, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"extend %d\0A\00"
define void @extend(i32 %0) {
%2 = alloca [32 x i8]
%3 = tail call i32 (...) @connect_or_die()
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @send(i32 %3, i8* %4, i32 %5, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ O_CREAT;
int /*<<< orphan*/ *SEM_FAILED;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ *sem_open(char const *, int /*<<< orphan*/, int,
                             int /*<<< orphan*/);
sem_t *open_sem(const char *designator) {
  sem_t *sem_id;
  sem_id = sem_open(designator, O_CREAT, 0600, 0);
  if (sem_id == SEM_FAILED) {
    perror("failed on sem_open");
    return NULL;
  }
  return sem_id;
}


x86 assembly (clang, -O0):
<open_sem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    $0x180,%edx
xor    %ecx,%ecx
call   1030 <sem_open@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
jne    1176 <open_sem+0x56>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    117e <open_sem+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_sem>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    $0x180,%edx
xor    %ecx,%ecx
call   1030 <sem_open@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     1144 <open_sem+0x24>
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
@SEM_FAILED = global i32* null
@.str = [19 x i8] c"failed on sem_open\00"
define i32* @open_sem(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_CREAT
%7 = call i32* @sem_open(i8* %5, i32 %6, i32 384, i32 0)
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = load i32*, i32** @SEM_FAILED
%10 = icmp eq i32* %8, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32* null, i32** %2
br label %15
13: ; preds = %1
%14 = load i32*, i32** %4
store i32* %14, i32** %2
br label %15
15: ; preds = %13, %11
%16 = load i32*, i32** %2
ret i32* %16
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@SEM_FAILED = global i32* null
@.str = [19 x i8] c"failed on sem_open\00"
define i32* @open_sem(i8* %0) {
%2 = load i32, i32* @O_CREAT
%3 = tail call i32* @sem_open(i8* %0, i32 %2, i32 384, i32 0)
%4 = load i32*, i32** @SEM_FAILED
%5 = icmp eq i32* %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %6
%9 = phi i32* [ null, %6 ], [ %3, %1 ]
ret i32* %9
}
void FPUEnable(void) {
  (*((volatile unsigned long *)(0xE000ED88))) =
      (((*((volatile unsigned long *)(0xE000ED88))) &
        ~(0x00300000 | 0x00C00000)) |
       0x00300000 | 0x00C00000);
}


x86 assembly (clang, -O0):
<FPUEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed88,%eax
mov    (%rax),%rcx
and    $0xffffffffff0fffff,%rcx
or     $0x300000,%rcx
or     $0xc00000,%rcx
mov    $0xe000ed88,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUEnable>:
mov    $0xe000ed88,%eax
orq    $0xf00000,(%rax)
ret

LLVM IR (-O0):
define void @FPUEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157192 to i64*)
%2 = and i64 %1, -15728641
%3 = or i64 %2, 3145728
%4 = or i64 %3, 12582912
store volatile i64 %4, i64* inttoptr (i64 3758157192 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPUEnable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157192 to i64*)
%2 = or i64 %1, 15728640
store volatile i64 %2, i64* inttoptr (i64 3758157192 to i64*)
ret void
}