xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void check_warning(char *msg, int c) {
  if (c < 0) {
    perror(msg);
  }
}


x86 assembly (clang, -O0):
<check_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1132 <check_warning+0x22>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_warning>:
test   %esi,%esi
js     1115 <check_warning+0x5>
ret
jmp    1030 <perror@plt>

LLVM IR (-O0):
define void @check_warning(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 slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @check_warning(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blackLine();
int /*<<< orphan*/ create_drive_straight(int);
int /*<<< orphan*/ create_stop();
int /*<<< orphan*/ goAlongLine(double);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ turnLeftDegrees(int);
int /*<<< orphan*/ turnRightDegrees(int);
void goToHangerRack() {
  create_drive_straight(200);
  while (!blackLine()) {
  }
  turnLeftDegrees(84);
  goAlongLine(2.9);
  turnRightDegrees(81);
  create_drive_straight(-100);
  msleep(800);
  create_stop();
}


x86 assembly (clang, -O0):
<goToHangerRack>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
call   1060 <create_drive_straight@plt>
mov    $0x0,%al
call   1080 <blackLine@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    119a <goToHangerRack+0x2a>
jmp    119f <goToHangerRack+0x2f>
jmp    117e <goToHangerRack+0xe>
mov    $0x54,%edi
call   1090 <turnLeftDegrees@plt>
movsd  0xe4f(%rip),%xmm0
call   1070 <goAlongLine@plt>
mov    $0x51,%edi
call   1030 <turnRightDegrees@plt>
mov    $0xffffff9c,%edi
call   1060 <create_drive_straight@plt>
mov    $0x320,%edi
call   1050 <msleep@plt>
mov    $0x0,%al
call   1040 <create_stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<goToHangerRack>:
push   %rax
mov    $0xc8,%edi
call   1060 <create_drive_straight@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <blackLine@plt>
test   %eax,%eax
je     1180 <goToHangerRack+0x10>
mov    $0x54,%edi
call   1090 <turnLeftDegrees@plt>
movsd  0xe63(%rip),%xmm0
call   1070 <goAlongLine@plt>
mov    $0x51,%edi
call   1030 <turnRightDegrees@plt>
mov    $0xffffff9c,%edi
call   1060 <create_drive_straight@plt>
mov    $0x320,%edi
call   1050 <msleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <create_stop@plt>

LLVM IR (-O0):
define void @goToHangerRack() {
%1 = call i32 @create_drive_straight(i32 200)
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @blackLine()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call i32 @turnLeftDegrees(i32 84)
%9 = call i32 @goAlongLine(double 2.900000e+00)
%10 = call i32 @turnRightDegrees(i32 81)
%11 = call i32 @create_drive_straight(i32 -100)
%12 = call i32 @msleep(i32 800)
%13 = call i32 (...) @create_stop()
ret void
}

LLVM IR (-O2):
define void @goToHangerRack() {
%1 = tail call i32 @create_drive_straight(i32 200)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @blackLine()
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @turnLeftDegrees(i32 84)
%7 = tail call i32 @goAlongLine(double 2.900000e+00)
%8 = tail call i32 @turnRightDegrees(i32 81)
%9 = tail call i32 @create_drive_straight(i32 -100)
%10 = tail call i32 @msleep(i32 800)
%11 = tail call i32 (...) @create_stop()
ret void
}
void hex2HEX(char c) {}


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

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

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

LLVM IR (-O2):
define void @hex2HEX(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execle(char *, char *, char *, char *, char *);
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int main() {
  setuid(geteuid());
  execle("/usr/bin/ruby", "ruby", "/opt/labflags/labflags.rb", (char *)NULL,
         (char *)NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
lea    0xeb7(%rip),%rdi
lea    0xeb9(%rip),%rsi
lea    0xeb7(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1040 <execle@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
lea    0xeba(%rip),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <execle@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/usr/bin/ruby\00"
@.str.1 = [5 x i8] c"ruby\00"
@.str.2 = [26 x i8] c"/opt/labflags/labflags.rb\00"
define i32 @main() {
%1 = call i32 (...) @geteuid()
%2 = call i32 @setuid(i32 %1)
%3 = call i32 @execle(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* null, i8* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"/usr/bin/ruby\00"
@.str.1 = [5 x i8] c"ruby\00"
@.str.2 = [26 x i8] c"/opt/labflags/labflags.rb\00"
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 @setuid(i32 %1)
%3 = tail call i32 @execle(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* null, i8* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *leak_pointer();
int free_after_stack_free() {
  int *x = leak_pointer();
  free(x);
  return 1;
}


x86 assembly (clang, -O0):
<free_after_stack_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <leak_pointer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_after_stack_free>:
push   %rax
xor    %eax,%eax
call   1040 <leak_pointer@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @free_after_stack_free() {
%1 = alloca i32*
%2 = call i32* (...) @leak_pointer()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @free(i32* %3)
ret i32 1
}

LLVM IR (-O2):
define i32 @free_after_stack_free() {
%1 = tail call i32* (...) @leak_pointer()
%2 = tail call i32 @free(i32* %1)
ret i32 1
}
__attribute__((cmse_nonsecure_entry)) float f22() { return 1.0f; }


x86 assembly (clang, -O0):
<f22>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f22>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f22() {
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @f22() {
ret float 1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlcpy(char *, char *, unsigned long);
unsigned long ft_strlen(char *);
scalar_t__ malloc(unsigned long);
char *ft_strdup(char *src) {
  char *clone;
  unsigned long src_len;
  src_len = ft_strlen(src);
  clone = (char *)malloc(src_len + 1);
  ft_strlcpy(clone, src, src_len + 1);
  if (ft_strlen(clone) != src_len)
    return (0);
  return (clone);
}


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1050 <ft_strlcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <ft_strlen@plt>
cmp    -0x20(%rbp),%rax
je     118f <ft_strdup+0x5f>
movq   $0x0,-0x8(%rbp)
jmp    1197 <ft_strdup+0x67>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <ft_strlen@plt>
mov    %rax,%r14
lea    0x1(%rax),%r12
mov    %r12,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <ft_strlcpy@plt>
mov    %rbx,%rdi
call   1030 <ft_strlen@plt>
xor    %ecx,%ecx
cmp    %r14,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @ft_strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = add i64 %8, 1
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = load i64, i64* %5
%15 = add i64 %14, 1
%16 = call i32 @ft_strlcpy(i8* %12, i8* %13, i64 %15)
%17 = load i8*, i8** %4
%18 = call i64 @ft_strlen(i8* %17)
%19 = load i64, i64* %5
%20 = icmp ne i64 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %1
store i8* null, i8** %2
br label %24
22: ; preds = %1
%23 = load i8*, i8** %4
store i8* %23, i8** %2
br label %24
24: ; preds = %22, %21
%25 = load i8*, i8** %2
ret i8* %25
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i64 @ft_strlen(i8* %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @ft_strlcpy(i8* %5, i8* %0, i64 %3)
%7 = tail call i64 @ft_strlen(i8* %5)
%8 = icmp eq i64 %7, %2
%9 = select i1 %8, i8* %5, i8* null
ret i8* %9
}
/* Variables and functions */
int txtarray_write2(char const *, char const *, int, double *, int, double *,
                    int);
int txtarray_write_disp(const char *filename, const char *header, int nstations,
                        double *stations, double *displacements) {
  return txtarray_write2(filename, header, nstations, stations, 3,
                         displacements, 3);
}


x86 assembly (clang, -O0):
<txtarray_write_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
mov    $0x3,%r8d
movl   $0x3,(%rsp)
call   1030 <txtarray_write2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txtarray_write_disp>:
push   %rax
mov    %r8,%r9
movl   $0x3,(%rsp)
mov    $0x3,%r8d
call   1030 <txtarray_write2@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @txtarray_write_disp(i8* %0, i8* %1, i32 %2, double* %3, double* %4) {
%6 = tail call i32 @txtarray_write2(i8* %0, i8* %1, i32 %2, double* %3, i32 3, double* %4, i32 3)
ret i32 %6
}
int f_blt_rc1(float a1) { return (__builtin_isless(a1, 100)); }


x86 assembly (clang, -O0):
<f_blt_rc1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blt_rc1>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @f_blt_rc1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 1.000000e+02
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_blt_rc1(float %0) {
%2 = fcmp olt float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
void gtk_container_resize_children() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_resize_children() {
ret void
}
unsigned f(unsigned char c) {
  _Static_assert(__builtin_types_compatible_p(__typeof(c << 24), signed int),
                 "unsigned shifted by signed should be signed");
  _Static_assert(__builtin_types_compatible_p(__typeof(c << 24U), int),
                 "signed shifted by unsigned should be signed");
  _Static_assert(
      __builtin_types_compatible_p(__typeof((unsigned)c << 24U), unsigned),
      "unsigned shifted by unsigned should be unsigned");
  return c << 24;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
shl    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @f(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 24
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw i32 %2, 24
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void spaces(int numSpaces) {
  char space[1];
  space[0] = ' ';
  for (int i = 0; i < numSpaces; i++) {
    printf("%c", space[0]);
  }
}


x86 assembly (clang, -O0):
<spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x20,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <spaces+0x40>
lea    0xec7(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <spaces+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaces>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1142 <spaces+0x32>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <spaces+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @spaces(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 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 32)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void testconst() {
  const char str1[5] = "abcd";
  printf(str1);
  printf("abcd");
}


x86 assembly (clang, -O0):
<testconst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testconst>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0xed7(%rip),%rbx
lea    0x8(%rsp),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.testconst.str1 = [5 x i8] c"abcd\00"
@.str = [5 x i8] c"abcd\00"
define void @testconst() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
define void @testconst() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* %2)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
void Jump(char *label) {
  Inst_Printf("b",
              "_"
              "%s",
              label);
}


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

x86 assembly (clang, -O2):
<Jump>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee1(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"b\00"
@.str.1 = [4 x i8] c"_%s\00"
define void @Jump(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"b\00"
@.str.1 = [4 x i8] c"_%s\00"
define void @Jump(i8* %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *test_result_text(bool passed) {
  return (passed ? "\x1b[32mPASS" : "\x1b[31mFAIL");
}


x86 assembly (clang, -O0):
<test_result_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef9(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_result_text>:
test   %edi,%edi
lea    0xf01(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\1B[32mPASS\00"
@.str.1 = [10 x i8] c"\1B[31mFAIL\00"
define i8* @test_result_text(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B[32mPASS\00"
@.str.1 = [10 x i8] c"\1B[31mFAIL\00"
define i8* @test_result_text(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
void test_c_function_in_subfolder(void) {}


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

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

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

LLVM IR (-O2):
define void @test_c_function_in_subfolder() {
ret void
}
__attribute__((no, noclone)) signed __int128 t150_4sub(unsigned __int128 x) {
  signed __int128 y = (0);
  signed __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t150_4sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x38(%rbp),%rdi
mov    %rdi,%rax
sar    $0x3f,%rax
xor    %esi,%esi
sub    %r8,%rdx
sbb    %rdi,%rcx
mov    %esi,%r9d
mov    %r9,%r8
sbb    %rax,%r8
sbb    %rax,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
mov    %rcx,%rdi
shr    $0x3f,%rdi
xor    %rdi,%rsi
or     %rsi,%rax
setne  %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    11aa <t150_4sub+0x9a>
jmp    11b1 <t150_4sub+0xa1>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t150_4sub>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rax
sar    $0x3f,%rax
je     112a <t150_4sub+0x1a>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t150_4sub(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = zext i128 %12 to i129
%15 = sext i128 %13 to i129
%16 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %14, i129 %15)
%17 = extractvalue { i129, i1 } %16, 1
%18 = extractvalue { i129, i1 } %16, 0
%19 = trunc i129 %18 to i128
%20 = sext i128 %19 to i129
%21 = icmp ne i129 %18, %20
%22 = or i1 %17, %21
store i128 %19, i128* %7
br i1 %22, label %23, label %25
23: ; preds = %2
%24 = call i32 (...) @bar()
br label %25
25: ; preds = %23, %2
%26 = load i128, i128* %7
store i128 %26, i128* %3
%27 = bitcast i128* %3 to { i64, i64 }*
%28 = load { i64, i64 }, { i64, i64 }* %27
ret { i64, i64 } %28
}

LLVM IR (-O2):
define { i64, i64 } @t150_4sub(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = sext i128 %6 to i129
%9 = icmp eq i129 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = insertvalue { i64, i64 } poison, i64 %0, 0
%14 = insertvalue { i64, i64 } %13, i64 %1, 1
ret { i64, i64 } %14
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t lte_int8_t(int8_t a, int8_t b) { return a <= b; }


x86 assembly (clang, -O0):
<lte_int8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lte_int8_t>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @lte_int8_t(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lte_int8_t(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
double pathconN_nm10_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<pathconN_nm10_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm10_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm10_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathconN_nm10_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
double fact(int n) { return n < 2 ? 1 : n * fact(n - 1); }


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1137 <fact+0x27>
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115d <fact+0x4d>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fact@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
push   %rax
cmp    $0x1,%edi
jg     1120 <fact+0x10>
movsd  0xee2(%rip),%xmm0
pop    %rax
ret
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
add    $0xffffffff,%edi
call   1030 <fact@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fact(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = call double @fact(i32 %10)
%12 = fmul double %8, %11
br label %13
13: ; preds = %6, %5
%14 = phi double [ 1.000000e+00, %5 ], [ %12, %6 ]
ret double %14
}

LLVM IR (-O2):
define double @fact(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %9, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = sitofp i32 %0 to double
%7 = add nsw i32 %0, -1
%8 = tail call double @fact(i32 %7)
%9 = fmul double %8, %6
br label %3
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int64_t min_int(uint32_t k) {
  assert(1 <= k && k <= 64);
  return -(int64_t)(((uint64_t)1) << (k - 1));
}


x86 assembly (clang, -O0):
<min_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x1,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1138 <min_int+0x28>
cmpl   $0x40,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_int>:
push   %rbx
lea    -0x1(%rdi),%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
setb   %dil
call   1030 <assert@plt>
mov    $0xffffffff,%eax
mov    %ebx,%ecx
shl    %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @min_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 1, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 64
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = shl i32 1, %13
%15 = sub nsw i32 0, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @min_int(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 64
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = shl nsw i32 -1, %2
ret i32 %6
}
unsigned long get_dvstctr_reg(int port) { return port == 0 ? 0x08 : 0x0A; }


x86 assembly (clang, -O0):
<get_dvstctr_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xa,%eax
mov    $0x8,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dvstctr_reg>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %rax,%rax
add    $0x8,%rax
ret

LLVM IR (-O0):
define i64 @get_dvstctr_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 8, i32 10
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_dvstctr_reg(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i64 8, i64 10
ret i64 %3
}
int is_gt(long a, long b) { return a > b; }


x86 assembly (clang, -O0):
<is_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_gt>:
xor    %eax,%eax
cmp    %rsi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i32 @is_gt(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_gt(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
f(int x[], int y[2]) {
  int a[2];
  return sizeof x + sizeof y + sizeof(int) + sizeof a;
}


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

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

LLVM IR (-O0):
define i32 @f(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [2 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
ret i32 28
}

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 28
}
/* Variables and functions */
int ttyname_r(int, char *, int);
int sysapi_get_ttyname(int fd, char *name, int len) {
  return ttyname_r(fd, name, len);
}


x86 assembly (clang, -O0):
<sysapi_get_ttyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ttyname_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysapi_get_ttyname>:
jmp    1030 <ttyname_r@plt>

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

LLVM IR (-O2):
define i32 @sysapi_get_ttyname(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @ttyname_r(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  x = __VERIFIER_nondet_int();
  while (x != 0) {
    if (x > 0) {
      x = x - 1;
    } else {
      x = x + 1;
    }
  }
  return 0;
}


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)
cmpl   $0x0,-0x8(%rbp)
je     1159 <main+0x49>
cmpl   $0x0,-0x8(%rbp)
jle    114b <main+0x3b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x44>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void vdmaFinal() {}


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

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

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

LLVM IR (-O2):
define void @vdmaFinal() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ palind(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char *str = malloc(sizeof(char) * 255);
  scanf("%s", str);
  palind(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xff,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <palind@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xff,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <palind@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(255) i8* @malloc(i32 255)
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @palind(i8* %1)
ret i32 0
}
void pvalue(char *str, float x) {
  union {
    float f;
    unsigned int i;
  } u;
  printf("%s ", str);
  u.f = x;
  printf("%08x\n", u.i);
}


x86 assembly (clang, -O0):
<pvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvalue>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    %rdi,%rsi
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movd   0x4(%rsp),%xmm0
movd   %xmm0,%esi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%union.anon = type { float }
@.str = [4 x i8] c"%s \00"
@.str.1 = [6 x i8] c"%08x\0A\00"
define void @pvalue(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
%5 = alloca %union.anon
store i8* %0, i8** %3
store float %1, float* %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load float, float* %4
%9 = bitcast %union.anon* %5 to float*
store float %8, float* %9
%10 = bitcast %union.anon* %5 to i32*
%11 = load i32, i32* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [6 x i8] c"%08x\0A\00"
define void @pvalue(i8* %0, float %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = bitcast float %1 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int getppid();
int /*<<< orphan*/ printf(char *, int);
main() { printf("PPID=%d\n", getppid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getppid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"PPID=%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @getppid()
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"PPID=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getppid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void call2h(double d2, char c, float f1, short s, double d1, int i, float f2,
            long l) {
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2h>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%sil
movsd  %xmm0,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
movss  %xmm3,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movb   $0x61,-0x9(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movw   $0x5,-0x12(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x6,-0x24(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movq   $0x7,-0x30(%rbp)
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call2h(double %0, i8 signext %1, float %2, i16 signext %3, double %4, i32 %5, float %6, i64 %7) {
%9 = alloca double
%10 = alloca i8
%11 = alloca float
%12 = alloca i16
%13 = alloca double
%14 = alloca i32
%15 = alloca float
%16 = alloca i64
store double %0, double* %9
store i8 %1, i8* %10
store float %2, float* %11
store i16 %3, i16* %12
store double %4, double* %13
store i32 %5, i32* %14
store float %6, float* %15
store i64 %7, i64* %16
store i8 97, i8* %10
store float 0.000000e+00, float* %11
store i16 5, i16* %12
store double 0.000000e+00, double* %13
store i32 6, i32* %14
store float 0x3FB99999A0000000, float* %15
store i64 7, i64* %16
store double 2.000000e-01, double* %9
ret void
}

LLVM IR (-O2):
define void @call2h(double %0, i8 signext %1, float %2, i16 signext %3, double %4, i32 %5, float %6, i64 %7) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-f|-i] [-dPRrvWx] file ...\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"usage: %s [-f|-i] [-dPRrvWx] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: %s [-f|-i] [-dPRrvWx] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int GetJoystickAnalog(int, int);
int getJSAnalog(int joystick, int channel) {
  int tmp = GetJoystickAnalog(joystick, channel);
  return (tmp > 10 || tmp < -10) ? tmp : 0;
}


x86 assembly (clang, -O0):
<getJSAnalog>:
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 <GetJoystickAnalog@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jg     1140 <getJSAnalog+0x30>
cmpl   $0xfffffff6,-0xc(%rbp)
jge    114b <getJSAnalog+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <getJSAnalog+0x45>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <getJSAnalog+0x45>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getJSAnalog>:
push   %rax
call   1030 <GetJoystickAnalog@plt>
lea    -0xb(%rax),%ecx
xor    %edx,%edx
cmp    $0xffffffeb,%ecx
cmovae %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getJSAnalog(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* %4
%8 = call i32 @GetJoystickAnalog(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 10
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, -10
br i1 %13, label %14, label %16
14: ; preds = %11, %2
%15 = load i32, i32* %5
br label %17
16: ; preds = %11
br label %17
17: ; preds = %16, %14
%18 = phi i32 [ %15, %14 ], [ 0, %16 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @getJSAnalog(i32 %0, i32 %1) {
%3 = tail call i32 @GetJoystickAnalog(i32 %0, i32 %1)
%4 = add i32 %3, -11
%5 = icmp ult i32 %4, -21
%6 = select i1 %5, i32 %3, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int PAPI_query_named_event(char *);
void papif_query_named_event_(char *EventName, int *check, int Event_len) {
  char tmp[128];
  Fortran2cstring(tmp, EventName, 128, Event_len);
  *check = PAPI_query_named_event(tmp);
}


x86 assembly (clang, -O0):
<papif_query_named_event_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <PAPI_query_named_event@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_query_named_event_>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    %r14,%rdi
call   1030 <PAPI_query_named_event@plt>
mov    %eax,(%rbx)
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @papif_query_named_event_(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @Fortran2cstring(i8* %5, i8* %0, i32 128, i32 %2)
%7 = call i32 @PAPI_query_named_event(i8* %5)
store i32 %7, i32* %1
ret void
}
int Test_Start_Transaction(int session_ID, int session_old_ID,
                           int session_transaction_ID,
                           int session_old_transaction_ID) {
  int FlagNewTransaction;
  if ((session_old_transaction_ID < 0) || (session_ID != session_old_ID)) {
    FlagNewTransaction = 1;
  } else {
    FlagNewTransaction = 0;
  }
  return FlagNewTransaction;
}


x86 assembly (clang, -O0):
<Test_Start_Transaction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1126 <Test_Start_Transaction+0x26>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1132 <Test_Start_Transaction+0x32>
movl   $0x1,-0x14(%rbp)
jmp    1139 <Test_Start_Transaction+0x39>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test_Start_Transaction>:
test   %ecx,%ecx
sets   %al
cmp    %esi,%edi
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @Test_Start_Transaction(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, 0
%6 = icmp ne i32 %0, %1
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
void led_write_bit(int bit) {}


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

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

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

LLVM IR (-O2):
define void @led_write_bit(i32 %0) {
ret void
}
void g_source_get_priority() {}


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

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

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

LLVM IR (-O2):
define void @g_source_get_priority() {
ret void
}
int _dl_getgid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_dl_getgid() {
ret i32 0
}
int Int__MUL_(int x, int y) { return x * y; }


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

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

LLVM IR (-O0):
define i32 @Int__MUL_(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Int__MUL_(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}