xunge/DecIR huggingface dataset:
int ioctl_get_last_block(unsigned char starttrack, int msf, int maxlen,
                         int single) {
  return 0;
}


x86 assembly (clang, -O0):
<ioctl_get_last_block>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ioctl_get_last_block(i8 zeroext %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @ioctl_get_last_block(i8 zeroext %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setLeds(int, int);
int /*<<< orphan*/ vTaskDelay(int);
void delay(int time) {
  for (int i = 0; i < time; i++) {
    vTaskDelay(1);
    setLeds(0x9700, 0x700);
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <delay+0x45>
mov    $0x1,%edi
call   1040 <vTaskDelay@plt>
mov    $0x9700,%edi
mov    $0x700,%esi
call   1030 <setLeds@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <delay+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %rbx
test   %edi,%edi
jle    114e <delay+0x2e>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <vTaskDelay@plt>
mov    $0x9700,%edi
mov    $0x700,%esi
call   1030 <setLeds@plt>
add    $0xffffffff,%ebx
jne    1130 <delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 @vTaskDelay(i32 1)
%10 = call i32 @setLeds(i32 38656, i32 1792)
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i32 @vTaskDelay(i32 1)
%7 = tail call i32 @setLeds(i32 38656, i32 1792)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %4
}
void RTTestSub(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestSub() {
ret void
}
void Swap(int *x_p, int *y_p) {
  int temp;
  temp = *x_p;
  *x_p = *y_p;
  *y_p = temp;
}


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

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

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

LLVM IR (-O2):
define void @Swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *new = realloc(ptr, size);
  if (new == NULL)
    fatal("out of memory");
  return new;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setenv(char const *, char const *, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
void UTILS_setenv(const char *name, const char *value) {
  setenv(name, value, 1);
  setlocale(LC_ALL, "C");
}


x86 assembly (clang, -O0):
<UTILS_setenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1040 <setlocale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTILS_setenv>:
push   %rax
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
pop    %rax
jmp    1040 <setlocale@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
define void @UTILS_setenv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @setenv(i8* %5, i8* %6, i32 1)
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [2 x i8] c"C\00"
define void @UTILS_setenv(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
%4 = load i32, i32* @LC_ALL
%5 = tail call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void board_init(void) { asm("nop"); }


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

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

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

LLVM IR (-O2):
define void @board_init() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void spin(int n) {
  while (--n) {
  }
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     111e <spin+0x1e>
jmp    1107 <spin+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @spin(i32 %0) {
ret void
}
/* Variables and functions */
float g(void *, void *, int /*<<< orphan*/, int, float);
float f(void *a, void *b, int c, float d) { return g(a, b, 0, c, d); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
movss  -0x18(%rbp),%xmm0
xor    %edx,%edx
call   1030 <g@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <g@plt>

LLVM IR (-O0):
define float @f(i8* %0, i8* %1, i32 %2, float %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca float
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load float, float* %8
%13 = call float @g(i8* %9, i8* %10, i32 0, i32 %11, float %12)
ret float %13
}

LLVM IR (-O2):
define float @f(i8* %0, i8* %1, i32 %2, float %3) {
%5 = tail call float @g(i8* %0, i8* %1, i32 0, i32 %2, float %3)
ret float %5
}
void _M2_RawIO_init(__attribute__((unused)) int argc,
                    __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_RawIO_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_M2_RawIO_init(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runLengthEncodeDescomp(char *);
void descompactar(int n, char **vetor) { runLengthEncodeDescomp(vetor[2]); }


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

x86 assembly (clang, -O2):
<descompactar>:
mov    0x10(%rsi),%rdi
jmp    1030 <runLengthEncodeDescomp@plt>

LLVM IR (-O0):
define void @descompactar(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 2
%7 = load i8*, i8** %6
%8 = call i32 @runLengthEncodeDescomp(i8* %7)
ret void
}

LLVM IR (-O2):
define void @descompactar(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @runLengthEncodeDescomp(i8* %4)
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t iolooper_now(void) {
  struct timeval time_now;
  return gettimeofday(&time_now, NULL)
             ? -1
             : (int64_t)time_now.tv_sec * 1000LL + time_now.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<iolooper_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     113f <iolooper_now+0x2f>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    116b <iolooper_now+0x5b>
mov    -0x8(%rbp),%rax
cltq
imul   $0x3e8,%rax,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iolooper_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1132 <iolooper_now+0x22>
add    $0x18,%rsp
ret
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x26,%rcx
add    %eax,%ecx
imul   $0x3e8,0x10(%rsp),%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @iolooper_now() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %16
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = sext i32 %8 to i64
%10 = mul nsw i64 %9, 1000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 1000
%14 = sext i32 %13 to i64
%15 = add nsw i64 %10, %14
br label %16
16: ; preds = %5, %4
%17 = phi i64 [ -1, %4 ], [ %15, %5 ]
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @iolooper_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = trunc i64 %7 to i32
%12 = mul i32 %11, 1000
%13 = add i32 %12, %10
br label %14
14: ; preds = %0, %5
%15 = phi i32 [ %13, %5 ], [ -1, %0 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ display(int);
int main() {
  int c[] = {2, 3, 4};
  display(c[2]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.c = [3 x i32] [i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%5 = load i32, i32* %4
%6 = call i32 @display(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @display(i32 4)
ret i32 0
}
/* Variables and functions */
int flash_image(void *, unsigned int, char *);
int flash_splashscreen_image4(void *data, unsigned sz) {
  return flash_image(data, sz, "splashscreen4");
}


x86 assembly (clang, -O0):
<flash_splashscreen_image4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <flash_image@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_splashscreen_image4>:
lea    0xee9(%rip),%rdx
jmp    1030 <flash_image@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"splashscreen4\00"
define i32 @flash_splashscreen_image4(i8* %0, i32 %1) {
%3 = tail call i32 @flash_image(i8* %0, i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
int number_of_object_types() { return (112); }


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

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

LLVM IR (-O0):
define i32 @number_of_object_types() {
ret i32 112
}

LLVM IR (-O2):
define i32 @number_of_object_types() {
ret i32 112
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _uptime_usage(void) {
  fputs("Usage: "
        "uptime"
        "\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_uptime_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_uptime_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Usage: uptime\0A\00"
@stderr = global i32 0
define i32 @_uptime_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [15 x i8] c"Usage: uptime\0A\00"
@stderr = global i32 0
define i32 @_uptime_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
float horizontal(mag, arg)
float mag, arg;
{ return ((float)(mag * cos((double)arg))); }


x86 assembly (clang, -O0):
<horizontal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm1,-0x18(%rbp)
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<horizontal>:
push   %rax
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
call   1030 <cos@plt>
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @horizontal(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = fptrunc double %0 to float
%6 = fptrunc double %1 to float
store float %5, float* %3
store float %6, float* %4
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = call double @cos(double %10)
%12 = fmul double %8, %11
%13 = fptrunc double %12 to float
ret float %13
}

LLVM IR (-O2):
define float @horizontal(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fpext float %3 to double
%6 = fpext float %4 to double
%7 = tail call double @cos(double %6)
%8 = fmul double %7, %5
%9 = fptrunc double %8 to float
ret float %9
}
void histogram_init(unsigned long long h[129][65]) {
  int i, j;
  for (i = 0; i < 129; ++i)
    for (j = 0; j < 65; ++j)
      h[i][j] = 0;
}


x86 assembly (clang, -O0):
<histogram_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x81,-0xc(%rbp)
jge    116c <histogram_init+0x6c>
movl   $0x0,-0x10(%rbp)
cmpl   $0x41,-0x10(%rbp)
jge    1159 <histogram_init+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x208,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <histogram_init+0x23>
jmp    115e <histogram_init+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <histogram_init+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<histogram_init>:
push   %rax
mov    $0x10608,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @histogram_init([65 x i64]* nocapture writeonly %0) {
%2 = bitcast [65 x i64]* %0 to i8*
ret void
}
int geteuid() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 0
}
void set_fpu_trap_exceptions(int trap, int notrap) {}


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

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

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

LLVM IR (-O2):
define void @set_fpu_trap_exceptions(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nRF24L01P_setRegister(int, int /*<<< orphan*/);
void nRF24L01P_disableAutoAcknowledge(void) { nRF24L01P_setRegister(0x01, 0); }


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

x86 assembly (clang, -O2):
<nRF24L01P_disableAutoAcknowledge>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <nRF24L01P_setRegister@plt>

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

LLVM IR (-O2):
define void @nRF24L01P_disableAutoAcknowledge() {
%1 = tail call i32 @nRF24L01P_setRegister(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qiflush();
void wrap_qiflush(void) { qiflush(); }


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

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

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

LLVM IR (-O2):
define void @wrap_qiflush() {
%1 = tail call i32 (...) @qiflush()
ret void
}
unsigned setjmp() {}


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

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

LLVM IR (-O0):
define i32 @setjmp() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @setjmp() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ transp(int **, int, int);
int /*<<< orphan*/ visual(int **, int, int);
int /*<<< orphan*/ zapolnenie(int **, int, int);
main() {
  int A[5][5];
  zapolnenie(A, 5, 5);
  visual(A, 5, 5);
  printf("\n");
  transp(A, 5, 5);
  visual(A, 5, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x5,%edx
mov    %edx,%esi
call   1030 <zapolnenie@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%edx
mov    %edx,%esi
call   1060 <visual@plt>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%edx
mov    %edx,%esi
call   1040 <transp@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%edx
mov    %edx,%esi
call   1060 <visual@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1030 <zapolnenie@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1060 <visual@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1050 <transp@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
call   1060 <visual@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [5 x i32]]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%4 = bitcast [5 x i32]* %3 to i32**
%5 = call i32 @zapolnenie(i32** %4, i32 5, i32 5)
%6 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%7 = bitcast [5 x i32]* %6 to i32**
%8 = call i32 @visual(i32** %7, i32 5, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%11 = bitcast [5 x i32]* %10 to i32**
%12 = call i32 @transp(i32** %11, i32 5, i32 5)
%13 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %2, i64 0, i64 0
%14 = bitcast [5 x i32]* %13 to i32**
%15 = call i32 @visual(i32** %14, i32 5, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = call i32 @zapolnenie(i32** %3, i32 5, i32 5)
%5 = call i32 @visual(i32** %3, i32 5, i32 5)
%6 = call i32 @putchar(i32 10)
%7 = call i32 @transp(i32** %3, i32 5, i32 5)
%8 = call i32 @visual(i32** %3, i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int);
int main() {
  int *var;
  int const **constptr = &var;
  int const fixed = 20;
  *constptr = &fixed;
  *var = 30;
  printf("x=%i y=%i\n", fixed, *var);
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"x=%i y=%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 20, i32 30)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
int main(void) {
  char a = 0;
  for (a = 0; a < 256; a++) {
    printf("int %d, Ox%x, char %c\n", a, a, a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x100,%eax
jge    115f <main+0x4f>
mov    -0x5(%rbp),%cl
mov    -0x5(%rbp),%al
lea    0xebd(%rip),%rdi
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x5(%rbp),%ecx
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
call   1030 <printf@plt>
add    $0x1,%bl
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@.str = [23 x i8] c"int %d, Ox%x, char %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %2, i8 signext %2)
%4 = add i8 %2, 1
br label %1
}
int chroot(const char *path) {
  (void)path;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @chroot(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char pkalgo2char(uint8_t algo) {
  char typech;
  switch (algo) {
  case 17:
    typech = 'D';
    break;
  case 19:
  case 22:
    typech = 'E';
    break;
  case 18:
    typech = 'e';
    break;
  case 20:
    typech = 'G';
    break;
  case 16:
    typech = 'g';
    break;
  case 1:
    typech = 'R';
    break;
  case 2:
    typech = 'r';
    break;
  case 3:
    typech = 's';
    break;
  default:
    typech = '?';
    break;
  }
  return typech;
}


x86 assembly (clang, -O0):
<pkalgo2char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1178 <pkalgo2char+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x44,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x45,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x65,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x47,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x67,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x52,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x72,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x73,-0x5(%rbp)
jmp    117c <pkalgo2char+0x7c>
movb   $0x3f,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkalgo2char>:
add    $0xffffffff,%edi
mov    $0x3f,%al
cmp    $0x15,%edi
ja     1117 <pkalgo2char+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
define signext i8 @pkalgo2char(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %13 [
i32 17, label %5
i32 19, label %6
i32 22, label %6
i32 18, label %7
i32 20, label %8
i32 16, label %9
i32 1, label %10
i32 2, label %11
i32 3, label %12
]
5: ; preds = %1
store i8 68, i8* %3
br label %14
6: ; preds = %1, %1
store i8 69, i8* %3
br label %14
7: ; preds = %1
store i8 101, i8* %3
br label %14
8: ; preds = %1
store i8 71, i8* %3
br label %14
9: ; preds = %1
store i8 103, i8* %3
br label %14
10: ; preds = %1
store i8 82, i8* %3
br label %14
11: ; preds = %1
store i8 114, i8* %3
br label %14
12: ; preds = %1
store i8 115, i8* %3
br label %14
13: ; preds = %1
store i8 63, i8* %3
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i8, i8* %3
ret i8 %15
}

LLVM IR (-O2):
@switch.table.pkalgo2char = [22 x i8] c"Rrs????????????gDeEG?E"
define signext i8 @pkalgo2char(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 22
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [22 x i8], [22 x i8]* @switch.table.pkalgo2char, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %1, %4
%9 = phi i8 [ %7, %4 ], [ 63, %1 ]
ret i8 %9
}
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
pid_t getpgrp(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(65));
  do {
    return (pid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<getpgrp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpgrp>:
mov    $0x41,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @getpgrp() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 65)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @getpgrp() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 65)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ put1(char *);
int put2(char *);
int main(void) {
  put1("If I'd as much money");
  put1(" as I could spend, \n");
  printf("I count %d characters.\n",
         put2("I never would cry old chairs to mend."));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <put1@plt>
lea    0xec3(%rip),%rdi
call   1050 <put1@plt>
lea    0xee4(%rip),%rdi
call   1030 <put2@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <put1@plt>
lea    0xed1(%rip),%rdi
call   1050 <put1@plt>
lea    0xef2(%rip),%rdi
call   1030 <put2@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"If I'd as much money\00"
@.str.1 = [21 x i8] c" as I could spend, \0A\00"
@.str.2 = [24 x i8] c"I count %d characters.\0A\00"
@.str.3 = [38 x i8] c"I never would cry old chairs to mend.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @put1(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @put1(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @put2(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"If I'd as much money\00"
@.str.1 = [21 x i8] c" as I could spend, \0A\00"
@.str.2 = [24 x i8] c"I count %d characters.\0A\00"
@.str.3 = [38 x i8] c"I never would cry old chairs to mend.\00"
define i32 @main() {
%1 = tail call i32 @put1(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @put1(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @put2(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a = __VERIFIER_nondet_int();
  ;
  int b = 5;
  while (1) {
    a = a + __VERIFIER_nondet_int();
    if (a > 0) {
      b = 10;
    }
    if (b == 20) {
    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 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1158 <main+0x48>
movl   $0xa,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jne    1172 <main+0x62>
jmp    1167 <main+0x57>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1130 <main+0x20>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
}
int test_imm_B1int32_mem(int *val) {
  return ((*val) & (0xB1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B1int32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B1int32_mem>:
testb  $0xb1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B1int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 177
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void printtime(time_t ptime) {
  struct tm *ts;
  char buf[80];
  ts = localtime(&ptime);
  strftime(buf, sizeof(buf), "%b %d %H:%M ", ts);
  printf("%s ", buf);
}


x86 assembly (clang, -O0):
<printtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x50,%esi
lea    0xea4(%rip),%rdx
call   1050 <strftime@plt>
lea    -0x60(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printtime>:
push   %rbx
sub    $0x60,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeb6(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [13 x i8] c"%b %d %H:%M \00"
@.str.1 = [4 x i8] c"%s \00"
define void @printtime(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = alloca [80 x i8]
store i32 %0, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i32 @strftime(i8* %6, i32 80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [13 x i8] c"%b %d %H:%M \00"
@.str.1 = [4 x i8] c"%s \00"
define void @printtime(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %4, i32 80, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
int optimizeVertexIndices(int *indices, int triCount) { return 0; }


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

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

LLVM IR (-O0):
define i32 @optimizeVertexIndices(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 @optimizeVertexIndices(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_SEGV(int /*<<< orphan*/);
int gen_SEGV() { handle_SEGV(0); }


x86 assembly (clang, -O0):
<gen_SEGV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <handle_SEGV@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gen_SEGV() {
%1 = tail call i32 @handle_SEGV(i32 0)
ret i32 undef
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local2;
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        if (state[0UL] != local2 + local1) {
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 454761159UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jae    1185 <RandomFunc+0x85>
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1174 <RandomFunc+0x74>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    -0x28(%rbp),%rcx
cmp    %rcx,%rax
je     1163 <RandomFunc+0x63>
jmp    1163 <RandomFunc+0x63>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113e <RandomFunc+0x3e>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
add    $0x1b1b1ac7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x2e8b115d,%eax
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = add i64 %10, 51238316
%12 = add i64 %11, 274866410
%13 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %12, i64* %13
store i64 0, i64* %7
br label %14
14: ; preds = %32, %2
%15 = load i64, i64* %7
%16 = icmp ult i64 %15, 1
br i1 %16, label %17, label %35
17: ; preds = %14
store i64 0, i64* %6
br label %18
18: ; preds = %29, %17
%19 = load i64, i64* %6
%20 = icmp ult i64 %19, 1
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%23 = load i64, i64* %22
%24 = load i64, i64* %6
%25 = load i64, i64* %7
%26 = add i64 %24, %25
%27 = icmp ne i64 %23, %26
br i1 %27, label %28, label %29
28: ; preds = %21
br label %29
29: ; preds = %28, %21
%30 = load i64, i64* %6
%31 = add i64 %30, 1
store i64 %31, i64* %6
br label %18
32: ; preds = %18
%33 = load i64, i64* %7
%34 = add i64 %33, 2
store i64 %34, i64* %7
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%37 = load i64, i64* %36
%38 = add i64 %37, 454761159
%39 = load i64*, i64** %4
%40 = getelementptr inbounds i64, i64* %39, i64 0
store i64 %38, i64* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 780865885
store i64 %4, i64* %1
ret void
}
unsigned int test_func_03(unsigned int a) {
  return (((a >> 0) & 0xFF) << 24) | (((a >> 8) & 0xFF) << 16) |
         (((a >> 16) & 0xFF) << 8) | (((a >> 24) & 0xFF) << 0);
}


x86 assembly (clang, -O0):
<test_func_03>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x0,%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_func_03(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 0
%5 = and i32 %4, 255
%6 = shl i32 %5, 24
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = and i32 %8, 255
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32, i32* %2
%13 = lshr i32 %12, 16
%14 = and i32 %13, 255
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32, i32* %2
%18 = lshr i32 %17, 24
%19 = and i32 %18, 255
%20 = shl i32 %19, 0
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @test_func_03(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ wctrans(char *);
void uninitvar_wctrans(void) {
  char *property;
  (void)wctrans(property);
}


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

x86 assembly (clang, -O2):
<uninitvar_wctrans>:
jmp    1030 <wctrans@plt>

LLVM IR (-O0):
define void @uninitvar_wctrans() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @wctrans(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wctrans() {
%1 = tail call i32 @wctrans(i8* undef)
ret void
}
/* Variables and functions */
int ebbrt_newlib_kill(int, int);
int kill(int pid, int sig) { return ebbrt_newlib_kill(pid, sig); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ebbrt_newlib_kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
jmp    1030 <ebbrt_newlib_kill@plt>

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @ebbrt_newlib_kill(i32 %0, i32 %1)
ret i32 %3
}