xunge/DecIR huggingface dataset:
int exe$rename(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$rename>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$rename"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$rename"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;
typedef int ui32Base;

/* Variables and functions */
uint32_t PWMGenPeriodGet(uint32_t ui32Base, uint32_t ui32Gen) {
  ;
  ;
  ui32Gen = ((ui32Base) + (ui32Gen));
  if ((*((volatile uint32_t *)(ui32Gen + 0x00000000))) & 0x00000002) {
    return ((*((volatile uint32_t *)(ui32Gen + 0x00000010))) * 2);
  } else {
    return ((*((volatile uint32_t *)(ui32Gen + 0x00000010))) + 1);
  }
}


x86 assembly (clang, -O0):
<PWMGenPeriodGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     113e <PWMGenPeriodGet+0x3e>
mov    -0xc(%rbp),%eax
add    $0x10,%eax
cltq
mov    (%rax),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114e <PWMGenPeriodGet+0x4e>
mov    -0xc(%rbp),%eax
add    $0x10,%eax
cltq
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenPeriodGet>:
movslq %esi,%rax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%edx
mov    0x10(%rax,%rcx,1),%eax
lea    (%rax,%rax,1),%ecx
add    $0x1,%eax
test   $0x2,%edx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @PWMGenPeriodGet(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* %5
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 0
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, 2
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %2
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 16
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load volatile i32, i32* %20
%22 = mul nsw i32 %21, 2
store i32 %22, i32* %3
br label %30
23: ; preds = %2
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 16
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load volatile i32, i32* %27
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %23, %16
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @PWMGenPeriodGet(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 2
%8 = icmp eq i32 %7, 0
%9 = add nsw i32 %3, 16
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = shl nsw i32 %12, 1
%14 = add nsw i32 %12, 1
%15 = select i1 %8, i32 %14, i32 %13
ret i32 %15
}
int f5(int x __attribute__((__unused__))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f5(i32 %0) {
ret i32 0
}
int se_16_32(int reg) {
  int value = (0x0000ffff & reg);
  int mask = 0x00008000;
  if (mask & reg) {
    value += 0xffff0000;
  }
  return value;
}


x86 assembly (clang, -O0):
<se_16_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
movl   $0x8000,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1133 <se_16_32+0x33>
mov    -0x8(%rbp),%eax
add    $0xffff0000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<se_16_32>:
movzwl %di,%ecx
movswl %cx,%eax
and    $0xffff0000,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @se_16_32(i32 %0) {
%2 = and i32 %0, 65535
%3 = and i32 %0, 32768
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 0, i32 -65536
%6 = or i32 %5, %2
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int SetHelpFilePosition(int /*<<< orphan*/ *, int, unsigned long, int);
int SetOrigFileLength(FILE *ofptr, int pos, unsigned long length) {
  return SetHelpFilePosition(ofptr, pos, length, 2);
}


x86 assembly (clang, -O0):
<SetOrigFileLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <SetHelpFilePosition@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetOrigFileLength>:
mov    $0x2,%ecx
jmp    1030 <SetHelpFilePosition@plt>

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

LLVM IR (-O2):
define i32 @SetOrigFileLength(i32* %0, i32 %1, i64 %2) {
%4 = tail call i32 @SetHelpFilePosition(i32* %0, i32 %1, i64 %2, i32 2)
ret i32 %4
}
int isGreaterThan10(int value) { return value > 10; }


x86 assembly (clang, -O0):
<isGreaterThan10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isGreaterThan10>:
xor    %eax,%eax
cmp    $0xb,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @isGreaterThan10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isGreaterThan10(i32 %0) {
%2 = icmp sgt i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.fb_monspecs = type opaque
define i32 @fb_get_monitor_limits(i8* nocapture readnone %0, %struct.fb_monspecs* nocapture readnone %1) {
ret i32 1
}
cbuf3(f, n) { return (cbuf(f, n, 3)); }


x86 assembly (clang, -O0):
<cbuf3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf3>:
mov    $0x3,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf3(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 3)
ret i32 %3
}
void X509_EXTENSION_create_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_EXTENSION_create_by_NID() {
ret void
}
int iswhitespace(char c) {
  if (c == '\t' || c == '\r' || c == '\f' || c == '\n' || c == '\v' || c == ' ')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1158 <iswhitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     1158 <iswhitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xc,%eax
je     1158 <iswhitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1158 <iswhitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
je     1158 <iswhitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1164 <iswhitespace+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <iswhitespace+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhitespace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <iswhitespace+0xe>
ret
cmp    $0x20,%dil
je     110d <iswhitespace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iswhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int GCD(int n, int d) {
  int temp;
  while (d > 0) {
    temp = n;
    n = d;
    d = temp % d;
  }
  return n;
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <GCD+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
jmp    110a <GCD+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <GCD+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <GCD+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
pid_t vfork(void) {
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<vfork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @vfork() {
%1 = load i32, i32* @ENOMEM
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @vfork() {
%1 = load i32, i32* @ENOMEM
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ clear_gc_stats();
void primitive_clear_gc_stats(void) { clear_gc_stats(); }


x86 assembly (clang, -O0):
<primitive_clear_gc_stats>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clear_gc_stats@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @primitive_clear_gc_stats() {
%1 = call i32 (...) @clear_gc_stats()
ret void
}

LLVM IR (-O2):
define void @primitive_clear_gc_stats() {
%1 = tail call i32 (...) @clear_gc_stats()
ret void
}
void MSN_logout(sd) int sd;
{ send(sd, "OUT\r\n", 5, 0); }


x86 assembly (clang, -O0):
<MSN_logout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MSN_logout>:
lea    0xee9(%rip),%rsi
mov    $0x5,%edx
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1030 <send@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"OUT\0D\0A\00"
define void @MSN_logout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i8*, i32, i32, ...) bitcast (i32 (...)* @send to i32 (i32, i8*, i32, i32, ...)*)(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"OUT\0D\0A\00"
define void @MSN_logout(i32 %0) {
%2 = tail call i32 (i32, i8*, i32, i32, ...) bitcast (i32 (...)* @send to i32 (i32, i8*, i32, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5, i32 0)
ret void
}
void *thread_2(void *arg) {
  printf("fun = %s thread_id = %u, arg = %d \n", __func__, (int)pthread_self(),
         (int)(long)arg);
}


x86 assembly (clang, -O0):
<thread_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
lea    0xebe(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_2>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xece(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    %eax,%edx
mov    %ebx,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"fun = %s thread_id = %u, arg = %d \0A\00"
@__func__.thread_2 = [9 x i8] c"thread_2\00"
define i8* @thread_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @pthread_self()
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.thread_2, i64 0, i64 0), i32 %4, i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [36 x i8] c"fun = %s thread_id = %u, arg = %d \0A\00"
@__func__.thread_2 = [9 x i8] c"thread_2\00"
define noalias i8* @thread_2(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.thread_2, i64 0, i64 0), i32 %2, i32 %4)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ apic_write_atomic(int, int /*<<< orphan*/);
__attribute__((always_)) void ack_APIC_irq(void) {
  apic_write_atomic((0xB0), (0));
}


x86 assembly (clang, -O0):
<ack_APIC_irq>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
xor    %esi,%esi
call   1030 <apic_write_atomic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack_APIC_irq>:
mov    $0xb0,%edi
xor    %esi,%esi
jmp    1030 <apic_write_atomic@plt>

LLVM IR (-O0):
define void @ack_APIC_irq() {
%1 = call i32 @apic_write_atomic(i32 176, i32 0)
ret void
}

LLVM IR (-O2):
define void @ack_APIC_irq() {
%1 = tail call i32 @apic_write_atomic(i32 176, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
void fclose_with_dash(FILE *file) {
  if (file != stdin)
    fclose(file);
}


x86 assembly (clang, -O0):
<fclose_with_dash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%rax
je     1139 <fclose_with_dash+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclose_with_dash>:
mov    0x2ed1(%rip),%rax
cmp    %rdi,(%rax)
je     1121 <fclose_with_dash+0x11>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
@stdin = global i32* null
define void @fclose_with_dash(i32* nocapture %0) {
%2 = load i32*, i32** @stdin
%3 = icmp eq i32* %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %0)
br label %6
6: ; preds = %4, %1
ret void
}
char *strcpy(char *restrict s1, register const char *restrict s2) {
  register char *t = s1;
  while ((*(t++) = *(s2++)) != '\0')
    ;
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
unsigned char const crc_calc(unsigned char const *);
int crc_ok(const unsigned char *b) { return crc_calc(b) == b[127]; }


x86 assembly (clang, -O0):
<crc_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <crc_calc@plt>
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x7f(%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_ok>:
push   %rbx
mov    %rdi,%rbx
call   1030 <crc_calc@plt>
xor    %ecx,%ecx
cmp    0x7f(%rbx),%al
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @crc_ok(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call zeroext i8 @crc_calc(i8* %3)
%5 = zext i8 %4 to i32
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 127
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %5, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @crc_ok(i8* %0) {
%2 = tail call zeroext i8 @crc_calc(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 127
%4 = load i8, i8* %3
%5 = icmp eq i8 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void gtk_widget_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_type() {
ret void
}
/* Type definitions */
struct pmm_paramdef_set {
  int dummy;
};
struct pmm_interval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int adjust_interval_with_param_constraint_min(struct pmm_interval *i,
                                              struct pmm_paramdef_set *pd_set) {
  (void)i;
  (void)pd_set;
  printf("muParser not enabled at configure.\n");
  return -1;
}


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

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

LLVM IR (-O0):
%struct.pmm_interval = type { i32 }
%struct.pmm_paramdef_set = type { i32 }
@.str = [36 x i8] c"muParser not enabled at configure.\0A\00"
define i32 @adjust_interval_with_param_constraint_min(%struct.pmm_interval* %0, %struct.pmm_paramdef_set* %1) {
%3 = alloca %struct.pmm_interval*
%4 = alloca %struct.pmm_paramdef_set*
store %struct.pmm_interval* %0, %struct.pmm_interval** %3
store %struct.pmm_paramdef_set* %1, %struct.pmm_paramdef_set** %4
%5 = load %struct.pmm_interval*, %struct.pmm_interval** %3
%6 = load %struct.pmm_paramdef_set*, %struct.pmm_paramdef_set** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.pmm_interval = type { i32 }
%struct.pmm_paramdef_set = type { i32 }
@str = [35 x i8] c"muParser not enabled at configure.\00"
define i32 @adjust_interval_with_param_constraint_min(%struct.pmm_interval* nocapture readnone %0, %struct.pmm_paramdef_set* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ TFD_NONBLOCK;
int timerfd_create(int /*<<< orphan*/, int /*<<< orphan*/);
int ftimerfd_create() {
  int fd = timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK);
  if (fd == -1)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<ftimerfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <timerfd_create@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1148 <ftimerfd_create+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <ftimerfd_create+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftimerfd_create>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <timerfd_create@plt>

LLVM IR (-O0):
@CLOCK_MONOTONIC = global i32 0
@TFD_NONBLOCK = global i32 0
define i32 @ftimerfd_create() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = load i32, i32* @TFD_NONBLOCK
%5 = call i32 @timerfd_create(i32 %3, i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@CLOCK_MONOTONIC = global i32 0
@TFD_NONBLOCK = global i32 0
define i32 @ftimerfd_create() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = load i32, i32* @TFD_NONBLOCK
%3 = tail call i32 @timerfd_create(i32 %1, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void halp(const char *prog) {
  printf(
      "Usage: %s [-hwf]\n  --help\tDisplay this help screen\n  -h "
      "<number>\tSpecify the height (must be a 2^n + 1)\n  -w "
      "<number>\tSpecify the width (must be a 2^n + 1)\n  -r <number>\tSpecify "
      "the roughness of the terrain (positive number, may be a fractional "
      "decimal)\n  -f <filename>\tThe file to save the map to\n",
      prog);
}


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

x86 assembly (clang, -O2):
<halp>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [299 x i8] c"Usage: %s [-hwf]\0A --help\09Display this help screen\0A -h <number>\09Specify the height (must be a 2^n + 1)\0A -w <number>\09Specify the width (must be a 2^n + 1)\0A -r <number>\09Specify the roughness of the terrain (positive number, may be a fractional decimal)\0A -f <filename>\09The file to save the map to\0A\00"
define void @halp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [299 x i8] c"Usage: %s [-hwf]\0A --help\09Display this help screen\0A -h <number>\09Specify the height (must be a 2^n + 1)\0A -w <number>\09Specify the width (must be a 2^n + 1)\0A -r <number>\09Specify the roughness of the terrain (positive number, may be a fractional decimal)\0A -f <filename>\09The file to save the map to\0A\00"
define void @halp(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([299 x i8], [299 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ memcopy(void *, char *, int);
void gswap(void *a, void *b, int sz) {
  char *buf = malloc(sizeof(char) * sz);
  memcopy(buf, a, sz);
  memcopy(a, b, sz);
  memcopy(b, buf, sz);
  free(buf);
}


x86 assembly (clang, -O0):
<gswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcopy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcopy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcopy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gswap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <memcopy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcopy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1040 <memcopy@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @gswap(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 i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = call i32 @memcopy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = call i32 @memcopy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %5
%22 = load i8*, i8** %7
%23 = load i32, i32* %6
%24 = call i32 @memcopy(i8* %21, i8* %22, i32 %23)
%25 = load i8*, i8** %7
%26 = call i32 @free(i8* %25)
ret void
}

LLVM IR (-O2):
define void @gswap(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @malloc(i32 %2)
%5 = tail call i32 @memcopy(i8* %4, i8* %0, i32 %2)
%6 = tail call i32 @memcopy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcopy(i8* %1, i8* %4, i32 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
long long int longlongint_ignoring_unsignedchar(long long int x,
                                                unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<longlongint_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @longlongint_ignoring_unsignedchar(i64 returned %0, i8 zeroext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ Drivers_SoundMusic_Uninit();
int /*<<< orphan*/ Drivers_Voice_Uninit();
void Drivers_All_Uninit() {
  Drivers_SoundMusic_Uninit();
  Drivers_Voice_Uninit();
}


x86 assembly (clang, -O0):
<Drivers_All_Uninit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Drivers_SoundMusic_Uninit@plt>
mov    $0x0,%al
call   1030 <Drivers_Voice_Uninit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Drivers_All_Uninit>:
push   %rax
xor    %eax,%eax
call   1040 <Drivers_SoundMusic_Uninit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Drivers_Voice_Uninit@plt>

LLVM IR (-O0):
define void @Drivers_All_Uninit() {
%1 = call i32 (...) @Drivers_SoundMusic_Uninit()
%2 = call i32 (...) @Drivers_Voice_Uninit()
ret void
}

LLVM IR (-O2):
define void @Drivers_All_Uninit() {
%1 = tail call i32 (...) @Drivers_SoundMusic_Uninit()
%2 = tail call i32 (...) @Drivers_Voice_Uninit()
ret void
}
void free_no_ops(void *data) { return; }


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

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

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

LLVM IR (-O2):
define void @free_no_ops(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("valid arguments: -n (size)\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"valid arguments: -n (size)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
void GPIOPinIntDisable(unsigned int baseAdd, unsigned int intLine,
                       unsigned int pinNumber) {
  if ((0x0) == intLine) {
    (*((volatile unsigned int *)(baseAdd + (0x3C + (0 * 4))))) =
        (1 << pinNumber);
  } else {
    (*((volatile unsigned int *)(baseAdd + (0x3C + (1 * 4))))) =
        (1 << pinNumber);
  }
}


x86 assembly (clang, -O0):
<GPIOPinIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1133 <GPIOPinIntDisable+0x33>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x3c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
jmp    1149 <GPIOPinIntDisable+0x49>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinIntDisable>:
mov    %edx,%ecx
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    $0x1,%edx
shl    %cl,%edx
lea    (%rdi,%rax,4),%eax
add    $0x3c,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPIOPinIntDisable(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 0, %7
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i32, i32* %6
%11 = shl i32 1, %10
%12 = load i32, i32* %4
%13 = add i32 %12, 60
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %11, i32* %15
br label %23
16: ; preds = %3
%17 = load i32, i32* %6
%18 = shl i32 1, %17
%19 = load i32, i32* %4
%20 = add i32 %19, 64
%21 = zext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 %18, i32* %22
br label %23
23: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @GPIOPinIntDisable(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = shl nuw i32 1, %2
%6 = select i1 %4, i32 60, i32 64
%7 = add i32 %6, %0
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int vsnprintf(char *, int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vsprintf(char *str, const char *format, va_list parameters) {
  return vsnprintf(str, INT_MAX, format, parameters);
}


x86 assembly (clang, -O0):
<vsprintf>:
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    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @vsprintf(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
%8 = load i32, i32* @INT_MAX
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i8* %7, i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @INT_MAX
%5 = tail call i32 @vsnprintf(i8* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int featureModelValid();
int main() {
  int tmp;
  tmp = featureModelValid();
  if (!tmp)
  ERROR:
    return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <featureModelValid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113f <main+0x2f>
jmp    1138 <main+0x28>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @featureModelValid()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *addColor(char *, char *);
char *black(char *str) { return addColor("30", str); }


x86 assembly (clang, -O0):
<black>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <addColor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<black>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"30\00"
define i8* @black(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"30\00"
define i8* @black(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
void HVnoFunction() {}


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

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

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

LLVM IR (-O2):
define void @HVnoFunction() {
ret void
}
/* Type definitions */
struct output {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fail(int);
int /*<<< orphan*/ write_output(int, struct output *);
void output_fail(struct output *output, int fd) {
  fail(fd);
  write_output(fd, output);
  exit(1);
}


x86 assembly (clang, -O0):
<output_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <fail@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <write_output@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<output_fail>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <fail@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <write_output@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.output = type { i32 }
define void @output_fail(%struct.output* %0, i32 %1) {
%3 = alloca %struct.output*
%4 = alloca i32
store %struct.output* %0, %struct.output** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @fail(i32 %5)
%7 = load i32, i32* %4
%8 = load %struct.output*, %struct.output** %3
%9 = call i32 @write_output(i32 %7, %struct.output* %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.output = type { i32 }
define void @output_fail(%struct.output* %0, i32 %1) {
%3 = tail call i32 @fail(i32 %1)
%4 = tail call i32 @write_output(i32 %1, %struct.output* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ vfork();
void f1(void) {
  if (vfork() < 0)
    perror("vfork error");
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <vfork@plt>
cmp    $0x0,%rax
jge    1141 <f1+0x21>
lea    0xec4(%rip),%rdi
call   1030 <perror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
xor    %eax,%eax
call   1040 <vfork@plt>
test   %rax,%rax
js     112f <f1+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <perror@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"vfork error\00"
define void @f1() {
%1 = call i64 (...) @vfork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"vfork error\00"
define void @f1() {
%1 = tail call i64 (...) @vfork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_stuff() { printf("Hello, "); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hello, \00"
define void @do_stuff() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_background(void) {
  printf("\nplease put '&' at last separated by spaces from other parameters");
  printf("\ncheck out your program using ps command");
  printf("\nfor any problem contact amrit kumar at amritkrs@gmail.com\n");
}


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

x86 assembly (clang, -O2):
<help_background>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0e(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"\0Aplease put '&' at last separated by spaces from other parameters\00"
@.str.1 = [41 x i8] c"\0Acheck out your program using ps command\00"
@.str.2 = [60 x i8] c"\0Afor any problem contact amrit kumar at amritkrs@gmail.com\0A\00"
define void @help_background() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"\0Aplease put '&' at last separated by spaces from other parameters\00"
@.str.1 = [41 x i8] c"\0Acheck out your program using ps command\00"
@str = [59 x i8] c"\0Afor any problem contact amrit kumar at amritkrs@gmail.com\00"
define void @help_background() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int, int);
uint8_t io_get_port_direction(uint8_t port) {
  return get_port(port, 0x00, 0x01);
}


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

x86 assembly (clang, -O2):
<io_get_port_direction>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @io_get_port_direction(i32 %0) {
%2 = tail call i32 @get_port(i32 %0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
double taus_get(void *);
double taus_get_double(void *vstate) { return taus_get(vstate) / 4294967296.0; }


x86 assembly (clang, -O0):
<taus_get_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <taus_get@plt>
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taus_get_double>:
push   %rax
call   1030 <taus_get@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @taus_get_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @taus_get(i8* %3)
%5 = fdiv double %4, 0x41F0000000000000
ret double %5
}

LLVM IR (-O2):
define double @taus_get_double(i8* %0) {
%2 = tail call double @taus_get(i8* %0)
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}
unsigned int off_uint(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @off_uint() {
ret i32 0
}
void mb_atomic_set_int(volatile int *v, int i) {
  asm volatile("xchgl %1, %0 \n\t" : "+q"(i), "=m"(*v) : "m"(*v) : "memory");
}


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

x86 assembly (clang, -O2):
<mb_atomic_set_int>:
xchg   %esi,(%rdi)
ret

LLVM IR (-O0):
define void @mb_atomic_set_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 asm sideeffect "xchgl $1, $0 \0A\09", "=q,=*m,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %6, i32* elementtype(i32) %7, i32 %5)
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @mb_atomic_set_int(i32* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "xchgl $1, $0 \0A\09", "=q,=*m,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %0, i32 %1)
ret void
}