xunge/DecIR huggingface dataset:
void px_put_long_be(char *cp, long lval) {
  *cp++ = (lval >> 24) & 0xff;
  *cp++ = (lval >> 16) & 0xff;
  *cp++ = (lval >> 8) & 0xff;
  *cp++ = lval & 0xff;
}


x86 assembly (clang, -O0):
<px_put_long_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<px_put_long_be>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @px_put_long_be(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = ashr i64 %5, 24
%7 = and i64 %6, 255
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
%11 = load i64, i64* %4
%12 = ashr i64 %11, 16
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
store i8 %14, i8* %15
%17 = load i64, i64* %4
%18 = ashr i64 %17, 8
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
store i8 %20, i8* %21
%23 = load i64, i64* %4
%24 = and i64 %23, 255
%25 = trunc i64 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
store i8 %25, i8* %26
ret void
}

LLVM IR (-O2):
define void @px_put_long_be(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %8
%12 = trunc i64 %1 to i8
store i8 %12, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fact_help(void) {
  printf("turbo-freq:\tEnables the ability to set different turbo "
         "ratio\n		limits to cores based on priority.\n");
  printf("\nCommand: For feature=turbo-freq\n");
  printf("\tcommand : info\n");
  printf("\tcommand : enable\n");
  printf("\tcommand : disable\n");
}


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

x86 assembly (clang, -O2):
<fact_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf53(%rip),%rdi
call   1030 <puts@plt>
lea    0xf57(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [99 x i8] c"turbo-freq:\09Enables the ability to set different turbo ratio\0A\09\09limits to cores based on priority.\0A\00"
@.str.1 = [34 x i8] c"\0ACommand: For feature=turbo-freq\0A\00"
@.str.2 = [17 x i8] c"\09command : info\0A\00"
@.str.3 = [19 x i8] c"\09command : enable\0A\00"
@.str.4 = [20 x i8] c"\09command : disable\0A\00"
define void @fact_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [98 x i8] c"turbo-freq:\09Enables the ability to set different turbo ratio\0A\09\09limits to cores based on priority.\00"
@str.5 = [33 x i8] c"\0ACommand: For feature=turbo-freq\00"
@str.6 = [16 x i8] c"\09command : info\00"
@str.7 = [18 x i8] c"\09command : enable\00"
@str.8 = [19 x i8] c"\09command : disable\00"
define void @fact_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.8, i64 0, i64 0))
ret void
}
void retbr_indirect_jump(int *buf) { __builtin_longjmp(buf, 1); }


x86 assembly (clang, -O0):
<retbr_indirect_jump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rbp
mov    0x8(%rcx),%rax
mov    0x10(%rcx),%rsp
jmp    *%rax

x86 assembly (clang, -O2):
<retbr_indirect_jump>:
push   %rbp
mov    (%rdi),%rbp
mov    0x8(%rdi),%rax
mov    0x10(%rdi),%rsp
jmp    *%rax

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

LLVM IR (-O2):
define void @retbr_indirect_jump(i32* %0) {
%2 = bitcast i32* %0 to i8*
tail call void @llvm.eh.sjlj.longjmp(i8* %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(unsigned long);
int /*<<< orphan*/ perror(char *);
void *safe_malloc(unsigned long nbytes) {
  void *p;
  if ((p = malloc(nbytes)) == NULL) {
    perror("malloc");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1169 <safe_malloc+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <safe_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int T;
  scanf("%d", &T);
  for (int i = 0; i < 1000; i++)
    printf("N[%d] = %d\n", i, i % T);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1177 <main+0x57>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
xchg   %ax,%ax
mov    %ebx,%eax
cltd
idivl  0x4(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"N[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %5
4: ; preds = %5
ret i32 0
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %10, %5 ]
%7 = load i32, i32* %1
%8 = srem i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %8)
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, 1000
br i1 %11, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pstream_set_drain_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_pstream_set_drain_callback"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"NOT IMPLEMENTED:pa_pstream_set_drain_callback\0A\00"
define i32 @pa_pstream_set_drain_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_pstream_set_drain_callback\00"
define i32 @pa_pstream_set_drain_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
long long get_time() {
  struct timespec t;
  clock_gettime(CLOCK_MONOTONIC, &t);
  return 1000000000LL * t.tv_sec + t.tv_nsec;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 1000000000, %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int *);
void g(int x, int y, int *z) {
  int u;
  if (x > 0) {
    f(x - 1, &u);
    *z = u + y;
  } else
    *z = 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <g+0x3c>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
lea    -0x14(%rbp),%rsi
call   1030 <f@plt>
mov    -0x14(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
jmp    1156 <g+0x46>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
test   %edi,%edi
jle    112f <g+0x1f>
mov    %esi,%ebp
add    $0xffffffff,%edi
lea    0x4(%rsp),%rsi
call   1030 <f@plt>
add    0x4(%rsp),%ebp
jmp    1134 <g+0x24>
mov    $0x1,%ebp
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @g(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = add nsw i32 %0, -1
%9 = call i32 @f(i32 %8, i32* %4)
%10 = load i32, i32* %4
%11 = add nsw i32 %10, %1
br label %12
12: ; preds = %3, %7
%13 = phi i32 [ %11, %7 ], [ 1, %3 ]
store i32 %13, i32* %2
ret void
}
void break4() {}


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

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

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

LLVM IR (-O2):
define void @break4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ except_throw(int, int, char *);
void syntax_error(void) { except_throw(0x34DB9C4A, 1, "syntax_error"); }


x86 assembly (clang, -O0):
<syntax_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34db9c4a,%edi
mov    $0x1,%esi
lea    0xedb(%rip),%rdx
call   1030 <except_throw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syntax_error>:
lea    0xee9(%rip),%rdx
mov    $0x34db9c4a,%edi
mov    $0x1,%esi
jmp    1030 <except_throw@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"syntax_error\00"
define void @syntax_error() {
%1 = tail call i32 @except_throw(i32 886807626, i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void nva_gwr32(void *base, uint32_t addr, uint32_t val) {
  *((volatile uint32_t *)(((volatile uint8_t *)base) + addr)) = val;
}


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

x86 assembly (clang, -O2):
<nva_gwr32>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @nva_gwr32(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store volatile i32 %7, i32* %12
ret void
}

LLVM IR (-O2):
define void @nva_gwr32(i8* %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
store volatile i32 %2, i32* %6
ret void
}
int offset(int i, int j, int n, int m) {
  return (sizeof(int) * 2) + ((i * m + j) * sizeof(double));
}


x86 assembly (clang, -O0):
<offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
cltq
shl    $0x3,%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset>:
imul   %ecx,%edi
add    %esi,%edi
lea    0x8(,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @offset(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = add i64 8, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @offset(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = add nsw i32 %5, %1
%7 = shl i32 %6, 3
%8 = add i32 %7, 8
ret i32 %8
}
int parse_prefix(int c) {
  switch (c) {
  case '*':
    return 1 << 0;
  case 'u':
    return 1 << 1;
  case 's':
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2a,%eax
je     113d <parse_prefix+0x3d>
jmp    111b <parse_prefix+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x73,%eax
je     1155 <parse_prefix+0x55>
jmp    112c <parse_prefix+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
je     1149 <parse_prefix+0x49>
jmp    1161 <parse_prefix+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <parse_prefix+0x68>
movl   $0x2,-0x4(%rbp)
jmp    1168 <parse_prefix+0x68>
movl   $0x0,-0x4(%rbp)
jmp    1168 <parse_prefix+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_prefix>:
cmp    $0x2a,%edi
je     1118 <parse_prefix+0x18>
cmp    $0x73,%edi
je     1115 <parse_prefix+0x15>
cmp    $0x75,%edi
jne    1115 <parse_prefix+0x15>
mov    $0x2,%eax
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @parse_prefix(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 42, label %5
i32 117, label %6
i32 115, label %7
]
5: ; preds = %1
store i32 1, i32* %2
br label %9
6: ; preds = %1
store i32 2, i32* %2
br label %9
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @parse_prefix(i32 %0) {
switch i32 %0, label %4 [
i32 42, label %5
i32 117, label %2
i32 115, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 0, %4 ], [ 0, %3 ], [ 2, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
ssize_t _write(int fd, const void *buf, size_t count) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_write>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int setpgid(pid_t pid, pid_t pgid) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @setpgid(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_char(void *data, void *extra_data) {
  char c = *(char *)data;
  printf("%c, ", c);
}


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
lea    0xed0(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
movsbl (%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%c, \00"
define void @print_char(i8* %0, i8* %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
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8, i8* %5
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c, \00"
define void @print_char(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ emitString(char *, int, int);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glutSwapBuffers();
void displayFrameCB(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(0.0, 0.0, 0.0);
  emitString("What does this do?", 10, 13);
  emitString("I don't know.", 10, 13 + 25);
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<displayFrameCB>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glColor3f@plt>
lea    0xe99(%rip),%rdi
mov    $0xa,%esi
mov    $0xd,%edx
call   1030 <emitString@plt>
lea    0xe96(%rip),%rdi
mov    $0xa,%esi
mov    $0x26,%edx
call   1030 <emitString@plt>
mov    $0x0,%al
call   1050 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayFrameCB>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <glClear@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1060 <glColor3f@plt>
lea    0xe9c(%rip),%rdi
mov    $0xa,%esi
mov    $0xd,%edx
call   1030 <emitString@plt>
lea    0xe99(%rip),%rdi
mov    $0xa,%esi
mov    $0x26,%edx
call   1030 <emitString@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@.str = [19 x i8] c"What does this do?\00"
@.str.1 = [14 x i8] c"I don't know.\00"
define void @displayFrameCB() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%4 = call i32 @emitString(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10, i32 13)
%5 = call i32 @emitString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 38)
%6 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@.str = [19 x i8] c"What does this do?\00"
@.str.1 = [14 x i8] c"I don't know.\00"
define void @displayFrameCB() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%4 = tail call i32 @emitString(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 10, i32 13)
%5 = tail call i32 @emitString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 38)
%6 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void UARTRxErrorClear(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000004))) = 0;
}


x86 assembly (clang, -O0):
<UARTRxErrorClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRxErrorClear>:
movq   $0x0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @UARTRxErrorClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTRxErrorClear(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t *_mcp_strchr(uint8_t *p, uint8_t *last, uint8_t c) {
  while (p < last) {
    if (*p == c) {
      return p;
    }
    p++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<_mcp_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114d <_mcp_strchr+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jne    113c <_mcp_strchr+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <_mcp_strchr+0x55>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_mcp_strchr+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mcp_strchr>:
cmp    %rsi,%rdi
jae    111e <_mcp_strchr+0x1e>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %rdx,(%rax)
je     1120 <_mcp_strchr+0x20>
add    $0x8,%rax
cmp    %rsi,%rax
jb     1110 <_mcp_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @_mcp_strchr(i64* %0, i64* readnone %1, i64 %2) {
%4 = icmp ult i64* %0, %1
br i1 %4, label %5, label %12
5: ; preds = %3, %9
%6 = phi i64* [ %10, %9 ], [ %0, %3 ]
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, %2
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %6, i64 1
%11 = icmp ult i64* %10, %1
br i1 %11, label %5, label %12
12: ; preds = %5, %9, %3
%13 = phi i64* [ null, %3 ], [ null, %9 ], [ %6, %5 ]
ret i64* %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void print_state(char *buff, int status) {
  if (status)
    fprintf(stdout, "%s", buff);
}


x86 assembly (clang, -O0):
<print_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1142 <print_state+0x32>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_state>:
test   %esi,%esi
je     112c <print_state+0x1c>
mov    %rdi,%rdx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @print_state(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stdout
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
define void @print_state(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage_symbols_mode(void) {
  fprintf(stderr, "Valid symbol modes are: none, ddt, all.\n");
}


x86 assembly (clang, -O0):
<usage_symbols_mode>:
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_symbols_mode>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Valid symbol modes are: none, ddt, all.\0A\00"
define void @usage_symbols_mode() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Valid symbol modes are: none, ddt, all.\0A\00"
define void @usage_symbols_mode() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct group {
  char *gr_name;
};

/* Variables and functions */
struct group *getgrnam(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  struct group *grp = getgrnam("nobody");
  printf("(%s)\n", grp->gr_name);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <getgrnam@plt>
mov    (%rax),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.group = type { i8* }
@.str = [7 x i8] c"nobody\00"
@.str.1 = [6 x i8] c"(%s)\0A\00"
define i32 @main() {
%1 = tail call %struct.group* @getgrnam(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = getelementptr inbounds %struct.group, %struct.group* %1, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PutLitChar(char);
void InsertNewLine(void) { PutLitChar('\n'); }


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

x86 assembly (clang, -O2):
<InsertNewLine>:
mov    $0xa,%edi
jmp    1030 <PutLitChar@plt>

LLVM IR (-O0):
define void @InsertNewLine() {
%1 = call i32 @PutLitChar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @InsertNewLine() {
%1 = tail call i32 @PutLitChar(i8 signext 10)
ret void
}
/* Variables and functions */
int fat_impar(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  printf("Informe o número: ");
  scanf("%d", &num);
  printf("O resultado é: %d\n", fat_impar(num));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fat_impar@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fat_impar@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Informe o n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"O resultado \C3\A9: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @fat_impar(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Informe o n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"O resultado \C3\A9: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fat_impar(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
float get_weight(int N, int m, int n, int v, float *vector) {
  return vector[(N + 1) * (N + 1) * m + (N + 1) * n + v];
}


x86 assembly (clang, -O0):
<get_weight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    -0x4(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
imul   -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
add    $0x1,%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_weight>:
add    $0x1,%edi
imul   %edi,%esi
add    %edx,%esi
imul   %edi,%esi
add    %ecx,%esi
movslq %esi,%rax
movss  (%r8,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @get_weight(i32 %0, i32 %1, i32 %2, i32 %3, float* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store float* %4, float** %10
%11 = load float*, float** %10
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
%16 = mul nsw i32 %13, %15
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %8
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %18, %22
%24 = load i32, i32* %9
%25 = add nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %11, i64 %26
%28 = load float, float* %27
ret float %28
}

LLVM IR (-O2):
define float @get_weight(i32 %0, i32 %1, i32 %2, i32 %3, float* nocapture %4) {
%6 = add nsw i32 %0, 1
%7 = mul i32 %6, %1
%8 = add i32 %7, %2
%9 = mul i32 %8, %6
%10 = add i32 %9, %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %4, i64 %11
%13 = load float, float* %12
ret float %13
}
int nthdigit(int x, int n) {
  static int powersof10[] = {1, 10, 100, 1000};
  return ((x / powersof10[n]) % 10);
}


x86 assembly (clang, -O0):
<nthdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movslq -0x8(%rbp),%rsi
lea    0x2f18(%rip),%rcx
cltd
idivl  (%rcx,%rsi,4)
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nthdigit>:
mov    %edi,%eax
movslq %esi,%rcx
lea    0xef4(%rip),%rsi
cltd
idivl  (%rsi,%rcx,4)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
@nthdigit.powersof10 = internal global [4 x i32] [i32 1, i32 10, i32 100, i32 1000]
define i32 @nthdigit(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 = sext i32 %6 to i64
%8 = getelementptr inbounds [4 x i32], [4 x i32]* @nthdigit.powersof10, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = sdiv i32 %5, %9
%11 = srem i32 %10, 10
ret i32 %11
}

LLVM IR (-O2):
@nthdigit.powersof10 = internal unnamed_addr constant [4 x i32] [i32 1, i32 10, i32 100, i32 1000]
define i32 @nthdigit(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x i32], [4 x i32]* @nthdigit.powersof10, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = sdiv i32 %0, %5
%7 = srem i32 %6, 10
ret i32 %7
}
/* Variables and functions */
int f3_cmp(long double, long double);
int __gttf2(long double a, long double b) { return -f3_cmp(b, a); }


x86 assembly (clang, -O0):
<__gttf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <f3_cmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gttf2>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fldt   0x30(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <f3_cmp@plt>
neg    %eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @__gttf2(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %4
%6 = load x86_fp80, x86_fp80* %3
%7 = call i32 @f3_cmp(x86_fp80 %5, x86_fp80 %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @__gttf2(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i32 @f3_cmp(x86_fp80 %1, x86_fp80 %0)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int ChangerStatutBouton(int, int);
int /*<<< orphan*/ printf(char *);
void testChangerStatutBouton() {
  int identifiantBouton;
  int statutBouton;
  int result = ChangerStatutBouton(identifiantBouton, statutBouton);
  if (1) {
    printf("%%TEST_FAILED%% time=0 testname=testChangerStatutBouton "
           "(Test_gestioncommandes) message=error message sample\n");
  }
}


x86 assembly (clang, -O0):
<testChangerStatutBouton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ChangerStatutBouton@plt>
mov    %eax,-0xc(%rbp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testChangerStatutBouton>:
push   %rax
call   1030 <ChangerStatutBouton@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [110 x i8] c"%%TEST_FAILED%% time=0 testname=testChangerStatutBouton (Test_gestioncommandes) message=error message sample\0A\00"
define void @testChangerStatutBouton() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @ChangerStatutBouton(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [110 x i8] c"%%TEST_FAILED%% time=0 testname=testChangerStatutBouton (Test_gestioncommandes) message=error message sample\0A\00"
define void @testChangerStatutBouton() {
%1 = tail call i32 @ChangerStatutBouton(i32 undef, i32 undef)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0))
ret void
}
exit(n) {
  _cleanup();
  _exit(n);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_cleanup@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_cleanup@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @_cleanup()
%4 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define i32 @exit(i32 %0) {
%2 = tail call i32 (...) @_cleanup()
tail call void @_exit(i32 %0)
unreachable
}
int numa_available(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @numa_available() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assign();
int /*<<< orphan*/ emit();
int /*<<< orphan*/ getargs(int, char **);
int /*<<< orphan*/ map();
int /*<<< orphan*/ memalloc();
int /*<<< orphan*/ readkeys(int, char **);
int /*<<< orphan*/ verify();
int main(int argc, char **argv) {
  getargs(argc, argv);
  readkeys(argc, argv);
  memalloc();
  map();
  assign();
  verify();
  emit();
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <getargs@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <readkeys@plt>
mov    $0x0,%al
call   1040 <memalloc@plt>
mov    $0x0,%al
call   1050 <map@plt>
mov    $0x0,%al
call   1070 <assign@plt>
mov    $0x0,%al
call   1060 <verify@plt>
mov    $0x0,%al
call   1080 <emit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1090 <getargs@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <readkeys@plt>
xor    %eax,%eax
call   1040 <memalloc@plt>
xor    %eax,%eax
call   1050 <map@plt>
xor    %eax,%eax
call   1070 <assign@plt>
xor    %eax,%eax
call   1060 <verify@plt>
xor    %eax,%eax
call   1080 <emit@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @getargs(i32 %6, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @readkeys(i32 %9, i8** %10)
%12 = call i32 (...) @memalloc()
%13 = call i32 (...) @map()
%14 = call i32 (...) @assign()
%15 = call i32 (...) @verify()
%16 = call i32 (...) @emit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getargs(i32 %0, i8** %1)
%4 = tail call i32 @readkeys(i32 %0, i8** %1)
%5 = tail call i32 (...) @memalloc()
%6 = tail call i32 (...) @map()
%7 = tail call i32 (...) @assign()
%8 = tail call i32 (...) @verify()
%9 = tail call i32 (...) @emit()
ret i32 0
}
int positionAddr(int x, int y, int z, int xSize, int ySize) {
  return (z * xSize * ySize) + (y * xSize) + x;
}


x86 assembly (clang, -O0):
<positionAddr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<positionAddr>:
imul   %r8d,%edx
lea    (%rdx,%rsi,1),%eax
imul   %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @positionAddr(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %8
%12 = load i32, i32* %9
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %10
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %7
%17 = load i32, i32* %9
%18 = mul nsw i32 %16, %17
%19 = add nsw i32 %15, %18
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @positionAddr(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul i32 %4, %2
%7 = add i32 %6, %1
%8 = mul i32 %7, %3
%9 = add i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *xmalloc(int);
char *xstrdup(const char *s) {
  int len = strlen(s) + 1;
  char *dup = xmalloc(len);
  memcpy(dup, s, len);
  return dup;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i8* @xmalloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i32, i32* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @xmalloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}