xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_199() {
  Assert_real((isqrt(199) == 14),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1000, ("Integer square root of 199 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_199>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc7,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3e8,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_199>:
push   %rax
mov    $0xc7,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3e8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 199 should be 14\00"
define void @t_sqrt_199() {
%1 = call i32 @isqrt(i32 199)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 199 should be 14\00"
define void @t_sqrt_199() {
%1 = tail call i32 @isqrt(i32 199)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1000, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ xlnkGetBufPhyAddr(void *);
uint32_t cma_get_phy_addr(void *buf) { return xlnkGetBufPhyAddr(buf); }


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

x86 assembly (clang, -O2):
<cma_get_phy_addr>:
jmp    1030 <xlnkGetBufPhyAddr@plt>

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

LLVM IR (-O2):
define i32 @cma_get_phy_addr(i8* %0) {
%2 = tail call i32 @xlnkGetBufPhyAddr(i8* %0)
ret i32 %2
}
void lrs_getdigits(long *a, long *b) {
  *a = 0L;
  *b = 0L;
  return;
}


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

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

LLVM IR (-O0):
define void @lrs_getdigits(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
store i64 0, i64* %5
%6 = load i64*, i64** %4
store i64 0, i64* %6
ret void
}

LLVM IR (-O2):
define void @lrs_getdigits(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
store i64 0, i64* %0
store i64 0, i64* %1
ret void
}
int test_imm_2Bint8_reg(signed char val) {
  return ((val) & (0x2B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x2b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Bint8_reg>:
test   $0x2b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Bint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 43
%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_2Bint8_reg(i8 signext %0) {
%2 = and i8 %0, 43
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char reverse(int d) {
  char t;
  if ((d == 10) || (d == 11) || (d == 12) || (d == 13) || (d == 14)) {
    switch (d) {
    case 10:
      t = 'T';
      break;
    case 11:
      t = 'J';
      break;
    case 12:
      t = 'Q';
      break;
    case 13:
      t = 'K';
      break;
    case 14:
      t = 'A';
      break;
    }
  } else {
    t = d + 48;
  }
  return t;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1139 <reverse+0x39>
cmpl   $0xb,-0x4(%rbp)
je     1139 <reverse+0x39>
cmpl   $0xc,-0x4(%rbp)
je     1139 <reverse+0x39>
cmpl   $0xd,-0x4(%rbp)
je     1139 <reverse+0x39>
cmpl   $0xe,-0x4(%rbp)
jne    118f <reverse+0x8f>
mov    -0x4(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     118a <reverse+0x8a>
mov    -0x10(%rbp),%rax
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x5(%rbp)
jmp    118a <reverse+0x8a>
movb   $0x4a,-0x5(%rbp)
jmp    118a <reverse+0x8a>
movb   $0x51,-0x5(%rbp)
jmp    118a <reverse+0x8a>
movb   $0x4b,-0x5(%rbp)
jmp    118a <reverse+0x8a>
movb   $0x41,-0x5(%rbp)
jmp    1198 <reverse+0x98>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
lea    -0xa(%rdi),%eax
lea    0x30(%rdi),%edx
lea    -0x50(,%rdi,8),%ecx
movabs $0x414b514a54,%rsi
shr    %cl,%rsi
cmp    $0x5,%eax
movzbl %dl,%eax
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define signext i8 @reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 10
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 11
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 12
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 13
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 14
br i1 %17, label %18, label %26
18: ; preds = %15, %12, %9, %6, %1
%19 = load i32, i32* %2
switch i32 %19, label %25 [
i32 10, label %20
i32 11, label %21
i32 12, label %22
i32 13, label %23
i32 14, label %24
]
20: ; preds = %18
store i8 84, i8* %3
br label %25
21: ; preds = %18
store i8 74, i8* %3
br label %25
22: ; preds = %18
store i8 81, i8* %3
br label %25
23: ; preds = %18
store i8 75, i8* %3
br label %25
24: ; preds = %18
store i8 65, i8* %3
br label %25
25: ; preds = %18, %24, %23, %22, %21, %20
br label %30
26: ; preds = %15
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 48
%29 = trunc i32 %28 to i8
store i8 %29, i8* %3
br label %30
30: ; preds = %26, %25
%31 = load i8, i8* %3
ret i8 %31
}

LLVM IR (-O2):
define signext i8 @reverse(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 5
%4 = trunc i32 %0 to i8
%5 = add i8 %4, 48
%6 = zext i32 %2 to i40
%7 = shl nuw nsw i40 %6, 3
%8 = lshr i40 280436492884, %7
%9 = trunc i40 %8 to i8
%10 = select i1 %3, i8 %9, i8 %5
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ pclose(int /*<<< orphan*/);
int /*<<< orphan*/ popen(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
void recursiveDeletePath(char *path) {
  char buf[256 + strlen(path)];
  sprintf(buf, "/bin/bash -c 'rm -rf %s'", path);
  pclose(popen(buf, "r"));
}


x86 assembly (clang, -O0):
<recursiveDeletePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x100,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xe78(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1050 <popen@plt>
mov    %eax,%edi
call   1040 <pclose@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursiveDeletePath>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x100,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xe94(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <popen@plt>
mov    %eax,%edi
call   1040 <pclose@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/bin/bash -c 'rm -rf %s'\00"
@.str.1 = [2 x i8] c"r\00"
define void @recursiveDeletePath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 256, %6
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i8, i64 %8
store i64 %8, i64* %4
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @popen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @pclose(i32 %13)
%15 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/bin/bash -c 'rm -rf %s'\00"
@.str.1 = [2 x i8] c"r\00"
define void @recursiveDeletePath(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 256
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @popen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @pclose(i32 %7)
ret void
}
void gtk_scrolled_window_get_hadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scrolled_window_get_hadjustment() {
ret void
}
int sigaction(int signum, const struct sigaction *act,
              struct sigaction *oldact) {
  ;
  return 0;
}


x86 assembly (clang, -O0):
<sigaction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sigaction = type opaque
define i32 @sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction*
%6 = alloca %struct.sigaction*
store i32 %0, i32* %4
store %struct.sigaction* %1, %struct.sigaction** %5
store %struct.sigaction* %2, %struct.sigaction** %6
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type opaque
define i32 @sigaction(i32 %0, %struct.sigaction* nocapture readnone %1, %struct.sigaction* nocapture readnone %2) {
ret i32 0
}
void memvol_async_test() { debugI("%s (UNIMPLEMENTED m-dummy.c)\n", __func__); }


x86 assembly (clang, -O0):
<memvol_async_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefc(%rip),%rsi
mov    $0x0,%al
call   1030 <debugI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memvol_async_test>:
lea    0xee9(%rip),%rdi
lea    0xf00(%rip),%rsi
xor    %eax,%eax
jmp    1030 <debugI@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%s (UNIMPLEMENTED m-dummy.c)\0A\00"
@__func__.memvol_async_test = [18 x i8] c"memvol_async_test\00"
define void @memvol_async_test() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @debugI to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.memvol_async_test, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s (UNIMPLEMENTED m-dummy.c)\0A\00"
@__func__.memvol_async_test = [18 x i8] c"memvol_async_test\00"
define void @memvol_async_test() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @debugI to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.memvol_async_test, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int socklen_t;

/* Variables and functions */
int SOL_SOCKET;
int setsockopt(int, int, int, void *, int);
int test(void) {
  int sockfd = 4;
  int level = SOL_SOCKET;
  int optname = 67;
  int value;
  void *optval = &value;
  socklen_t optlen = sizeof(value);
  return setsockopt(sockfd, level, optname, optval, optlen);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x4,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
movl   $0x43,-0xc(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rcx
mov    $0x4,%edi
mov    $0x43,%edx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 4, i32* %1
%7 = load i32, i32* @SOL_SOCKET
store i32 %7, i32* %2
store i32 67, i32* %3
%8 = bitcast i32* %4 to i8*
store i8* %8, i8** %5
store i32 4, i32* %6
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @setsockopt(i32 %9, i32 %10, i32 %11, i8* %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
define i32 @test() {
%1 = alloca i32
%2 = load i32, i32* @SOL_SOCKET
%3 = bitcast i32* %1 to i8*
%4 = call i32 @setsockopt(i32 4, i32 %2, i32 67, i8* %3, i32 4)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IniAf_OFILM();
int /*<<< orphan*/ IniClk_OFILM();
int /*<<< orphan*/ IniCmd_OFILM();
void IniSetAf_OFILM(void) {
  ;
  IniCmd_OFILM();
  ;
  IniClk_OFILM();
  ;
  IniAf_OFILM();
}


x86 assembly (clang, -O0):
<IniSetAf_OFILM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <IniCmd_OFILM@plt>
mov    $0x0,%al
call   1030 <IniClk_OFILM@plt>
mov    $0x0,%al
call   1050 <IniAf_OFILM@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IniSetAf_OFILM>:
push   %rax
xor    %eax,%eax
call   1040 <IniCmd_OFILM@plt>
xor    %eax,%eax
call   1030 <IniClk_OFILM@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <IniAf_OFILM@plt>

LLVM IR (-O0):
define void @IniSetAf_OFILM() {
%1 = call i32 (...) @IniCmd_OFILM()
%2 = call i32 (...) @IniClk_OFILM()
%3 = call i32 (...) @IniAf_OFILM()
ret void
}

LLVM IR (-O2):
define void @IniSetAf_OFILM() {
%1 = tail call i32 (...) @IniCmd_OFILM()
%2 = tail call i32 (...) @IniClk_OFILM()
%3 = tail call i32 (...) @IniAf_OFILM()
ret void
}
int __attribute__((visibility("default"))) get_answer(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @get_answer() {
ret i32 42
}

LLVM IR (-O2):
define i32 @get_answer() {
ret i32 42
}
/* Type definitions */
struct libavl_allocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t);
void *rtavl_malloc(struct libavl_allocator *allocator, size_t size) {
  assert(allocator != NULL && size > 0);
  return malloc(size);
}


x86 assembly (clang, -O0):
<rtavl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114b <rtavl_malloc+0x2b>
cmpq   $0x0,-0x10(%rbp)
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtavl_malloc>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

LLVM IR (-O0):
%struct.libavl_allocator = type { i32 }
define i8* @rtavl_malloc(%struct.libavl_allocator* %0, i64 %1) {
%3 = alloca %struct.libavl_allocator*
%4 = alloca i64
store %struct.libavl_allocator* %0, %struct.libavl_allocator** %3
store i64 %1, i64* %4
%5 = load %struct.libavl_allocator*, %struct.libavl_allocator** %3
%6 = icmp ne %struct.libavl_allocator* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ugt i64 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %4
%15 = call i8* @malloc(i64 %14)
ret i8* %15
}

LLVM IR (-O2):
%struct.libavl_allocator = type { i32 }
define noalias i8* @rtavl_malloc(%struct.libavl_allocator* readnone %0, i64 %1) {
%3 = icmp ne %struct.libavl_allocator* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i8* @malloc(i64 %1)
ret i8* %8
}
int do_413() { return 413; }


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

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

LLVM IR (-O0):
define i32 @do_413() {
ret i32 413
}

LLVM IR (-O2):
define i32 @do_413() {
ret i32 413
}
/* Variables and functions */
int /*<<< orphan*/ log_debug(char *);
int /*<<< orphan*/ nyx_proc_terminate();
void handle_sigusr1(__attribute__((unused)) int signum) {
  log_debug("proc: caught SIGUSR1");
  nyx_proc_terminate();
}


x86 assembly (clang, -O0):
<handle_sigusr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <log_debug@plt>
mov    $0x0,%al
call   1040 <nyx_proc_terminate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sigusr1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <log_debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <nyx_proc_terminate@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"proc: caught SIGUSR1\00"
define void @handle_sigusr1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @log_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @nyx_proc_terminate()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"proc: caught SIGUSR1\00"
define void @handle_sigusr1(i32 %0) {
%2 = tail call i32 @log_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @nyx_proc_terminate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ sa_log(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void sigpipe_handler(int sig) {
  sa_log("ERROR: SIGPIPE received");
  signal(SIGPIPE, sigpipe_handler);
}


x86 assembly (clang, -O0):
<sigpipe_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <sa_log@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigpipe_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <sa_log@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    0x2eab(%rip),%rsi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"ERROR: SIGPIPE received\00"
@SIGPIPE = global i32 0
define void @sigpipe_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sa_log(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @SIGPIPE
%5 = call i32 @signal(i32 %4, void (i32)* @sigpipe_handler)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"ERROR: SIGPIPE received\00"
@SIGPIPE = global i32 0
define void @sigpipe_handler(i32 %0) {
%2 = tail call i32 @sa_log(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SIGPIPE
%4 = tail call i32 @signal(i32 %3, void (i32)* @sigpipe_handler)
ret void
}
int test_imm_FCint32_reg(int val) { return ((val) & (0xFC << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_FCint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xfc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FCint32_reg>:
test   $0xfc,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FCint32_reg(i32 %0) {
%2 = and i32 %0, 252
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test_26_1(short *mem) { __atomic_fetch_sub(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_26_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%ax
neg    %ax
lock xadd %ax,(%rcx)
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_26_1>:
lock subw $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_26_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw sub i16* %5, i16 %6 acq_rel
store i16 %7, i16* %4
%8 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test_26_1(i16* nocapture %0) {
%2 = atomicrmw sub i16* %0, i16 1 acq_rel
ret void
}
int heap_max(int array[]) { return array[0]; }


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

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

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

LLVM IR (-O2):
define i32 @heap_max(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
unsigned setbitss(unsigned x, int p, int n, unsigned y) {
  return (x & ((~0 << (p + 1)) | (~(~0 << (p + 1 - n))))) |
         ((y & ~(~0 << n)) << (p + 1 - n));
}


x86 assembly (clang, -O0):
<setbitss>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%edx
or     %edx,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%esi
shl    %cl,%esi
mov    %esi,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbitss>:
mov    %ecx,%r8d
mov    %edx,%r9d
add    $0x1,%esi
mov    $0xffffffff,%eax
mov    $0xffffffff,%r10d
mov    %esi,%ecx
shl    %cl,%r10d
sub    %edx,%esi
mov    $0xffffffff,%edx
mov    %esi,%ecx
shl    %cl,%edx
not    %edx
mov    %r9d,%ecx
shl    %cl,%eax
or     %r10d,%edx
and    %edi,%edx
not    %eax
and    %r8d,%eax
mov    %esi,%ecx
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbitss(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
%12 = shl i32 -1, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
%17 = shl i32 -1, %16
%18 = xor i32 %17, -1
%19 = or i32 %12, %18
%20 = and i32 %9, %19
%21 = load i32, i32* %8
%22 = load i32, i32* %7
%23 = shl i32 -1, %22
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
%28 = load i32, i32* %7
%29 = sub nsw i32 %27, %28
%30 = shl i32 %25, %29
%31 = or i32 %20, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @setbitss(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, 1
%6 = shl nsw i32 -1, %5
%7 = sub nsw i32 %5, %2
%8 = shl nsw i32 -1, %7
%9 = xor i32 %8, -1
%10 = or i32 %6, %9
%11 = and i32 %10, %0
%12 = shl nsw i32 -1, %2
%13 = xor i32 %12, -1
%14 = and i32 %13, %3
%15 = shl i32 %14, %7
%16 = or i32 %11, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void imprimir_prompt() { printf("$ "); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"$ \00"
define void @imprimir_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int getsockname(int, struct sockaddr *, int /*<<< orphan*/ *);
int getsockname_ex(int socket, struct sockaddr *addr, socklen_t *addrlen) {
  return getsockname(socket, addr, addrlen);
}


x86 assembly (clang, -O0):
<getsockname_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <getsockname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsockname_ex>:
jmp    1030 <getsockname@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @getsockname_ex(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @getsockname(i32 %7, %struct.sockaddr* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @getsockname_ex(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
unsigned short dxl_read_word(unsigned char, int);
unsigned short getTorqueLimit(unsigned char id) {
  return dxl_read_word(id, (34));
}


x86 assembly (clang, -O0):
<getTorqueLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x22,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTorqueLimit>:
mov    $0x22,%esi
jmp    1030 <dxl_read_word@plt>

LLVM IR (-O0):
define zeroext i16 @getTorqueLimit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i16 @dxl_read_word(i8 zeroext %3, i32 34)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @getTorqueLimit(i8 zeroext %0) {
%2 = tail call zeroext i16 @dxl_read_word(i8 zeroext %0, i32 34)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void setrunflags(void) { nocall("setrunflags"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"setrunflags\00"
define void @setrunflags() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ Rand_div(int);
char *make_word();
int /*<<< orphan*/ sprintf(char *, char *, char *);
void get_random_name(char *return_name) {
  char *word = make_word();
  if ((Rand_div(3)) == 0)
    sprintf(return_name, "'%s'", word);
  else
    sprintf(return_name, "of %s", word);
}


x86 assembly (clang, -O0):
<get_random_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <make_word@plt>
mov    %rax,-0x10(%rbp)
mov    $0x3,%edi
call   1040 <Rand_div@plt>
cmp    $0x0,%rax
jne    1174 <get_random_name+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe96(%rip),%rsi
call   1050 <sprintf@plt>
jmp    1188 <get_random_name+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe82(%rip),%rsi
call   1050 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <make_word@plt>
mov    %rax,%rbx
mov    $0x3,%edi
call   1040 <Rand_div@plt>
test   %rax,%rax
lea    0xeab(%rip),%rax
lea    0xea9(%rip),%rsi
cmove  %rax,%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"'%s'\00"
@.str.1 = [6 x i8] c"of %s\00"
define void @get_random_name(i8* nocapture writeonly %0) {
%2 = tail call i8* (...) @make_word()
%3 = tail call i64 @Rand_div(i32 3)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) %5, i8* %2)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
time_t getNextHourForTs(time_t ts) {
  int modValue = (int)ts % 3600;
  return (time_t)(ts + 3600 - modValue);
}


x86 assembly (clang, -O0):
<getNextHourForTs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0xe10,%rax
movslq -0xc(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNextHourForTs>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
add    %rdi,%rax
add    $0xe10,%rax
ret

LLVM IR (-O0):
define i64 @getNextHourForTs(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = srem i32 %5, 3600
store i32 %6, i32* %3
%7 = load i64, i64* %2
%8 = add nsw i64 %7, 3600
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = sub nsw i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @getNextHourForTs(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = srem i32 %2, 3600
%4 = add nsw i64 %0, 3600
%5 = sub nsw i32 0, %3
%6 = sext i32 %5 to i64
%7 = add i64 %4, %6
ret i64 %7
}
float f(float x) { return x * x * x - 0.165 * x * x + 0.0003993; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xedb(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xee5(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
addsd  0xed9(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fmul double 1.650000e-01, %10
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = fneg double %11
%15 = call double @llvm.fmuladd.f64(double %14, double %13, double %8)
%16 = fadd double %15, 3.993000e-04
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fpext float %3 to double
%5 = fpext float %0 to double
%6 = fmul double %5, -1.650000e-01
%7 = tail call double @llvm.fmuladd.f64(double %6, double %5, double %4)
%8 = fadd double %7, 3.993000e-04
%9 = fptrunc double %8 to float
ret float %9
}
foo() {
  static int table[] = {20, 69, 4, 12};
  static int idx;
  return table[idx++];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f3a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f2f(%rip)
movslq %eax,%rcx
lea    0x2f11(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq 0x2f1d(%rip),%rax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f14(%rip)
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@foo.table = internal global [4 x i32] [i32 20, i32 69, i32 4, i32 12]
@foo.idx = internal global i32 0
define i32 @foo() {
%1 = load i32, i32* @foo.idx
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.idx
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x i32], [4 x i32]* @foo.table, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
@foo.table = internal unnamed_addr constant [4 x i32] [i32 20, i32 69, i32 4, i32 12]
@foo.idx = internal unnamed_addr global i32 0
define i32 @foo() {
%1 = load i32, i32* @foo.idx
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.idx
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x i32], [4 x i32]* @foo.table, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int x();
int y();
int main(int argc, char **argv) {
  printf("hello world %d %d\n", x(), y());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <x@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <y@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"hello world %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @x()
%4 = tail call i32 (...) @y()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
float hgetfontheight();
float hgetfontheight_() { return (hgetfontheight()); }


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

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

LLVM IR (-O0):
define float @hgetfontheight_() {
%1 = call float (...) @hgetfontheight()
ret float %1
}

LLVM IR (-O2):
define float @hgetfontheight_() {
%1 = tail call float (...) @hgetfontheight()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ hqr(int, int, int, double *, double *, int *);
int /*<<< orphan*/ orthes(int, int, int, double *, double *);
void eigen(int n, double *a, double *ev, double *work, int *ierr) {
  orthes(n, 1, n, a, work);
  hqr(n, 1, n, a, ev, ierr);
}


x86 assembly (clang, -O0):
<eigen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%esi
call   1040 <orthes@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x1,%esi
call   1030 <hqr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eigen>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r8
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%esi
mov    %edi,%edx
mov    %rbx,%rcx
call   1040 <orthes@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <hqr@plt>

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

LLVM IR (-O2):
define void @eigen(i32 %0, double* %1, double* %2, double* %3, i32* %4) {
%6 = tail call i32 @orthes(i32 %0, i32 1, i32 %0, double* %1, double* %3)
%7 = tail call i32 @hqr(i32 %0, i32 1, i32 %0, double* %1, double* %2, i32* %4)
ret void
}
/* Variables and functions */
char const *dirname(char *);
const char *Sys_Dirname(char *path) { return dirname(path); }


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

x86 assembly (clang, -O2):
<Sys_Dirname>:
jmp    1030 <dirname@plt>

LLVM IR (-O0):
define i8* @Sys_Dirname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @dirname(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Sys_Dirname(i8* %0) {
%2 = tail call i8* @dirname(i8* %0)
ret i8* %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ init();
int /*<<< orphan*/ mainLoop();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Have fun using My Shell! \n");
  init();
  mainLoop();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <mainLoop@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <mainLoop@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Have fun using My Shell! \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @init()
%8 = call i32 (...) @mainLoop()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [26 x i8] c"Have fun using My Shell! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @init()
%5 = tail call i32 (...) @mainLoop()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort_report(char *, ...);
size_t read(int, void *, size_t);
void fifo_read(int fd, void *buf, size_t len) {
  size_t z;
  if ((z = read(fd, buf, len)) == -1)
    (1 == 1) ? abort_report("daemon: Could not read from fifo", "")
             : abort_report("daemon: Could not read from fifo");
  ((char *)buf)[z] = '\0';
}


x86 assembly (clang, -O0):
<fifo_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <read@plt>
mov    %rax,-0x20(%rbp)
cmp    $0xffffffffffffffff,%rax
jne    1166 <fifo_read+0x46>
lea    0xea8(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <abort_report@plt>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_read>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <read@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    114a <fifo_read+0x2a>
lea    0xec4(%rip),%rdi
lea    0xedd(%rip),%rsi
xor    %eax,%eax
call   1030 <abort_report@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"daemon: Could not read from fifo\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @read(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = icmp eq i64 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i8*, i8** %5
%17 = load i64, i64* %7
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 0, i8* %18
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"daemon: Could not read from fifo\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 0, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void close_out_err(void) {
  fclose(stdout);
  fclose(stderr);
}


x86 assembly (clang, -O0):
<close_out_err>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_out_err>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
define void @close_out_err() {
%1 = load i32, i32* @stdout
%2 = call i32 @fclose(i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fclose(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
define void @close_out_err() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fclose(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fclose(i32 %3)
ret void
}
int adis16080_configure_ring(struct iio_dev *indio_dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @adis16080_configure_ring(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @adis16080_configure_ring(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
int test_imm_1Fuint8_reg(unsigned char val) {
  return ((val) & (-0x1F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Fuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffe1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Fuint8_reg>:
test   $0xe1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Fuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -31
%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_1Fuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -31
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void f5(void) { struct A7 *x; }


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

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

LLVM IR (-O0):
%struct.A7 = type opaque
define void @f5() {
%1 = alloca %struct.A7*
ret void
}

LLVM IR (-O2):
%struct.A7 = type opaque
define void @f5() {
ret void
}