xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xcd() {
  Assert_real((isbdigit(205) == 0),
              "/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/ctype/test_isbdigit.c",
              1030, ("isbdigit should be 0 for 0xcd"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xcd>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcd,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x406,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xcd>:
push   %rax
mov    $0xcd,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x406,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xcd\00"
define void @t_isbdigit_0xcd() {
%1 = call i64 @isbdigit(i32 205)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1030, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xcd\00"
define void @t_isbdigit_0xcd() {
%1 = tail call i64 @isbdigit(i32 205)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1030, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_C9int64_midword_reg(long long val) {
  return ((val >> 16) & (0xC9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C9int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xc9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C9int64_midword_reg>:
test   $0xc90000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C9int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 201
%6 = icmp ne i64 %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_C9int64_midword_reg(i64 %0) {
%2 = and i64 %0, 13172736
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printk(char *);
halt() {
  printk("\n...Halt!\n");
  abort();
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <abort@plt>

x86 assembly (clang, -O2):
<halt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0A...Halt!\0A\00"
define i32 @halt() {
%1 = call i32 @printk(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0A...Halt!\0A\00"
define i32 @halt() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ *eeprom_fp();
unsigned char fgetc(int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, unsigned int, int /*<<< orphan*/);
unsigned char eeprom_get_char(unsigned int addr) {
  FILE *fp = eeprom_fp();
  if (fseek(fp, addr, SEEK_SET)) {
    return 0;
  }
  return fgetc(fp);
}


x86 assembly (clang, -O0):
<eeprom_get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <eeprom_fp@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
cmp    $0x0,%rax
je     116e <eeprom_get_char+0x3e>
movb   $0x0,-0x1(%rbp)
jmp    117a <eeprom_get_char+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_get_char>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <eeprom_fp@plt>
mov    %rax,%rbx
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <fseek@plt>
test   %rax,%rax
je     1160 <eeprom_get_char+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fgetc@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define zeroext i8 @eeprom_get_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = call i32* (...) @eeprom_fp()
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %3
%8 = load i32, i32* @SEEK_SET
%9 = call i64 @fseek(i32* %6, i32 %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i8 0, i8* %2
br label %15
12: ; preds = %1
%13 = load i32*, i32** %4
%14 = call zeroext i8 @fgetc(i32* %13)
store i8 %14, i8* %2
br label %15
15: ; preds = %12, %11
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define zeroext i8 @eeprom_get_char(i32 %0) {
%2 = tail call i32* (...) @eeprom_fp()
%3 = load i32, i32* @SEEK_SET
%4 = tail call i64 @fseek(i32* %2, i32 %0, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call zeroext i8 @fgetc(i32* %2)
br label %8
8: ; preds = %1, %6
%9 = phi i8 [ %7, %6 ], [ 0, %1 ]
ret i8 %9
}
void printl(unsigned char line, char *str) {}


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

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

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

LLVM IR (-O2):
define void @printl(i8 zeroext %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char UART_read();
int /*<<< orphan*/ UART_write(char);
int main() {
  char c;
  c = UART_read();
  UART_write(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <UART_read@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <UART_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <UART_read@plt>
movsbl %al,%edi
call   1030 <UART_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @UART_read()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @UART_write(i8 signext %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @UART_read()
%2 = tail call i32 @UART_write(i8 signext %1)
ret i32 0
}
char *ho_strcat(char *s1, const char *s2) {
  char *p = s1;
  for (; *p; p++)
    ;
  while ((*p++ = *s2++) != '\0')
    ;
  return s1;
}


x86 assembly (clang, -O0):
<ho_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <ho_strcat+0x37>
jmp    1126 <ho_strcat+0x26>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <ho_strcat+0x14>
jmp    113c <ho_strcat+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <ho_strcat+0x6f>
jmp    113c <ho_strcat+0x3c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <ho_strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <ho_strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @ho_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rk4Solve(int, int, double *);
int main() {
  int neqn = 4, numstep = 1000;
  double x[neqn];
  printf("beginning solver...\n");
  rk4Solve(neqn, numstep, x);
  printf("ending program.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x3e8,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdx
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <rk4Solve@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdx
mov    $0x4,%edi
mov    $0x3e8,%esi
call   1030 <rk4Solve@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"beginning solver...\0A\00"
@.str.1 = [17 x i8] c"ending program.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 0, i32* %1
store i32 4, i32* %2
store i32 1000, i32* %3
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %4
%9 = alloca double, i64 %7
store i64 %7, i64* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @rk4Solve(i32 %11, i32 %12, double* %9)
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
%15 = load i8*, i8** %4
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [20 x i8] c"beginning solver...\00"
@str.2 = [16 x i8] c"ending program.\00"
define i32 @main() {
%1 = alloca [4 x double]
%2 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = call i32 @rk4Solve(i32 4, i32 1000, double* %2)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void testOffsetPassedToStrlenThenFree() {
  char *string = malloc(sizeof(char) * 10);
  string += 1;
  int length = strlen(string);
  free(string);
}


x86 assembly (clang, -O0):
<testOffsetPassedToStrlenThenFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testOffsetPassedToStrlenThenFree() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @malloc(i64 10)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %2
%9 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
define void @testOffsetPassedToStrlenThenFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main() {
  printf("Hello, world!\n");
  fprintf(stderr, "%s", "Hello, error!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xec3(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
@stderr = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, error!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"Hello, error!\0A\00"
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rmmod(char *);
int rmmod_usage();
int ourRmmodCommand(int argc, char **argv) {
  if (argc < 2) {
    return rmmod_usage();
  }
  return rmmod(argv[1]);
}


x86 assembly (clang, -O0):
<ourRmmodCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1148 <ourRmmodCommand+0x28>
mov    $0x0,%al
call   1030 <rmmod_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1158 <ourRmmodCommand+0x38>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <rmmod@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ourRmmodCommand>:
cmp    $0x1,%edi
jg     112c <ourRmmodCommand+0xc>
xor    %eax,%eax
jmp    1030 <rmmod_usage@plt>
mov    0x8(%rsi),%rdi
jmp    1040 <rmmod@plt>

LLVM IR (-O0):
define i32 @ourRmmodCommand(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @rmmod_usage()
store i32 %9, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @rmmod(i8* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @ourRmmodCommand(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @rmmod_usage()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @rmmod(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(int argc, char **argv) {
  int x = 0, y = 123;
  int *a, *b, *c, *d;
  a = (int *)malloc(sizeof(int));
  a = c;
  a = NULL;
  b = (int *)malloc(sizeof(int));
  *b = 456;
  x = 321 + *b;
  b = &y;
  d = c;
  d = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x7b,-0x18(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x1c8,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
add    $0x141,%eax
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x38(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 123, i32* %7
%12 = call i64 @malloc(i32 4)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %8
%14 = load i32*, i32** %10
store i32* %14, i32** %8
store i32* null, i32** %8
%15 = call i64 @malloc(i32 4)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %9
%17 = load i32*, i32** %9
store i32 456, i32* %17
%18 = load i32*, i32** %9
%19 = load i32, i32* %18
%20 = add nsw i32 321, %19
store i32 %20, i32* %6
store i32* %7, i32** %9
%21 = load i32*, i32** %10
store i32* %21, i32** %11
store i32* null, i32** %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = tail call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32 456, i32* %5
ret i32 0
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
void *memzero8(void *dest, size_t n) {
  uint8_t z8 = 0U;
  do {
    uint8_t *p = (uint8_t *)dest;
    for (; n >= sizeof(uint8_t); n -= sizeof(uint8_t))
      *p++ = z8;
  } while (0);
  return (dest);
}


x86 assembly (clang, -O0):
<memzero8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x4,-0x10(%rbp)
jb     114b <memzero8+0x4b>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
sub    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <memzero8+0x1b>
jmp    1150 <memzero8+0x50>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzero8>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x4,%rsi
jb     112b <memzero8+0x1b>
mov    %rsi,%rdx
and    $0xfffffffffffffffc,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memzero8(i8* returned writeonly %0, i64 %1) {
%3 = icmp ugt i64 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = and i64 %1, -4
br label %6
6: ; preds = %4, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void badeof() {
  fputs("\nUnexpected EOF\n\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<badeof>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badeof>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0AUnexpected EOF\0A\0A\00"
@stderr = global i32 0
define void @badeof() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0AUnexpected EOF\0A\0A\00"
@stderr = global i32 0
define void @badeof() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void free_inet6wp(struct in6_addr *net, int *val) {}


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

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

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

LLVM IR (-O2):
%struct.in6_addr = type opaque
define void @free_inet6wp(%struct.in6_addr* nocapture %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
struct fh_p_expr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fh_free_expr_children(struct fh_p_expr *);
int /*<<< orphan*/ free(struct fh_p_expr *);
void fh_free_expr(struct fh_p_expr *expr) {
  if (expr) {
    fh_free_expr_children(expr);
    free(expr);
  }
}


x86 assembly (clang, -O0):
<fh_free_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <fh_free_expr+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <fh_free_expr_children@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fh_free_expr>:
test   %rdi,%rdi
je     1137 <fh_free_expr+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <fh_free_expr_children@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.fh_p_expr = type { i32 }
define void @fh_free_expr(%struct.fh_p_expr* %0) {
%2 = alloca %struct.fh_p_expr*
store %struct.fh_p_expr* %0, %struct.fh_p_expr** %2
%3 = load %struct.fh_p_expr*, %struct.fh_p_expr** %2
%4 = icmp ne %struct.fh_p_expr* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.fh_p_expr*, %struct.fh_p_expr** %2
%7 = call i32 @fh_free_expr_children(%struct.fh_p_expr* %6)
%8 = load %struct.fh_p_expr*, %struct.fh_p_expr** %2
%9 = call i32 @free(%struct.fh_p_expr* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.fh_p_expr = type { i32 }
define void @fh_free_expr(%struct.fh_p_expr* %0) {
%2 = icmp eq %struct.fh_p_expr* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @fh_free_expr_children(%struct.fh_p_expr* %0)
%5 = tail call i32 @free(%struct.fh_p_expr* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
struct bitmask {
  int *maskp;
};

/* Variables and functions */
unsigned int rt_numa_bitmask_isbitset(const struct bitmask *mask,
                                      unsigned long i) {
  long bit =
      mask->maskp[i / (8 * sizeof(long))] & (1 << (i % (8 * sizeof(long))));
  return (bit != 0);
}


x86 assembly (clang, -O0):
<rt_numa_bitmask_isbitset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_numa_bitmask_isbitset>:
mov    %rsi,%rcx
mov    (%rdi),%rax
mov    %rsi,%rdx
shr    $0x6,%rdx
mov    (%rax,%rdx,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
%struct.bitmask = type { i32* }
define i32 @rt_numa_bitmask_isbitset(%struct.bitmask* %0, i64 %1) {
%3 = alloca %struct.bitmask*
%4 = alloca i64
%5 = alloca i64
store %struct.bitmask* %0, %struct.bitmask** %3
store i64 %1, i64* %4
%6 = load %struct.bitmask*, %struct.bitmask** %3
%7 = getelementptr inbounds %struct.bitmask, %struct.bitmask* %6, i32 0, i32 0
%8 = load i32*, i32** %7
%9 = load i64, i64* %4
%10 = udiv i64 %9, 64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = load i64, i64* %4
%14 = urem i64 %13, 64
%15 = trunc i64 %14 to i32
%16 = shl i32 1, %15
%17 = and i32 %12, %16
%18 = sext i32 %17 to i64
store i64 %18, i64* %5
%19 = load i64, i64* %5
%20 = icmp ne i64 %19, 0
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.bitmask = type { i32* }
define i32 @rt_numa_bitmask_isbitset(%struct.bitmask* nocapture %0, i64 %1) {
%3 = getelementptr inbounds %struct.bitmask, %struct.bitmask* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = lshr i64 %1, 6
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = load i32, i32* %6
%8 = trunc i64 %1 to i32
%9 = and i32 %8, 63
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
ret i32 %11
}
unsigned long lockdep_count_backward_deps(struct lock_class *class) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.lock_class = type opaque
define i64 @lockdep_count_backward_deps(%struct.lock_class* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ h();
int /*<<< orphan*/ q(int);
int main() {
  int x;
  f(2);
  if (2 == 2) {
    x = 7;
  }
  g(2);
  q(x);
  h();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <f@plt>
movl   $0x7,-0x4(%rbp)
mov    $0x2,%edi
call   1050 <g@plt>
mov    -0x4(%rbp),%edi
call   1060 <q@plt>
mov    $0x0,%al
call   1030 <h@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <f@plt>
mov    $0x2,%edi
call   1050 <g@plt>
mov    $0x7,%edi
call   1060 <q@plt>
xor    %eax,%eax
call   1030 <h@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 @f(i32 2)
store i32 7, i32* %1
%3 = call i32 @g(i32 2)
%4 = load i32, i32* %1
%5 = call i32 @q(i32 %4)
%6 = call i32 (...) @h()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 2)
%2 = tail call i32 @g(i32 2)
%3 = tail call i32 @q(i32 7)
%4 = tail call i32 (...) @h()
ret i32 0
}
unsigned long C_Utils_max_ulong(const unsigned long item1,
                                const unsigned long item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <C_Utils_max_ulong+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <C_Utils_max_ulong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_ulong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @C_Utils_max_ulong(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 ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @C_Utils_max_ulong(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int _mkpath(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
            int /*<<< orphan*/ *);
int mkpath_np(const char *path, mode_t omode) {
  return _mkpath(AT_FDCWD, path, omode, NULL);
}


x86 assembly (clang, -O0):
<mkpath_np>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <_mkpath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkpath_np>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
jmp    1030 <_mkpath@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @mkpath_np(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @AT_FDCWD
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @_mkpath(i32 %5, i8* %6, i32 %7, i32* null)
ret i32 %8
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @mkpath_np(i8* %0, i32 %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @_mkpath(i32 %3, i8* %0, i32 %1, i32* null)
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_standard_clear(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(697, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syspool_standard_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2b9,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syspool_standard_clear>:
mov    $0x2b9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syspool_standard_clear() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 697, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @syspool_standard_clear() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 697, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
const char *_Locale_true(struct _Locale_numeric *__DUMMY_PAR) { return 0; }


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

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

LLVM IR (-O0):
%struct._Locale_numeric = type opaque
define i8* @_Locale_true(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_numeric = type opaque
define noalias i8* @_Locale_true(%struct._Locale_numeric* nocapture readnone %0) {
ret i8* null
}
__attribute__((always_)) int sched_info_on(void) {
  extern int delayacct_on;
  return delayacct_on;
}


x86 assembly (clang, -O0):
<sched_info_on>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_info_on>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@delayacct_on = external global i32
define i32 @sched_info_on() {
%1 = load i32, i32* @delayacct_on
ret i32 %1
}

LLVM IR (-O2):
@delayacct_on = external global i32
define i32 @sched_info_on() {
%1 = load i32, i32* @delayacct_on
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, counter;
#pragma omp parallel
  for (i = 0; i < 100000; i++)
    counter++;
  printf("counter=%d\n", counter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    114a <main+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"counter=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
double atof(char *);
double string_to_digit(char buffer[]) { return atof(buffer); }


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

x86 assembly (clang, -O2):
<string_to_digit>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @string_to_digit(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
double linearfunc(double n_sub, double ind, double nu) {
  double bin_size, func;
  if (n_sub == 0.0)
    n_sub = 1.0;
  bin_size = 1.0 / n_sub;
  ind *= bin_size;
  func = ind;
  return func;
}


x86 assembly (clang, -O0):
<linearfunc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1138 <linearfunc+0x38>
jp     1138 <linearfunc+0x38>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec0(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearfunc>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jne    111d <linearfunc+0x1d>
jp     111d <linearfunc+0x1d>
movsd  0xee8(%rip),%xmm0
mulsd  %xmm1,%xmm0
ret
movsd  0xedb(%rip),%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @linearfunc(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %3
store double 1.000000e+00, double* %4
br label %12
12: ; preds = %11, %3
%13 = load double, double* %4
%14 = fdiv double 1.000000e+00, %13
store double %14, double* %7
%15 = load double, double* %7
%16 = load double, double* %5
%17 = fmul double %16, %15
store double %17, double* %5
%18 = load double, double* %5
store double %18, double* %8
%19 = load double, double* %8
ret double %19
}

LLVM IR (-O2):
define double @linearfunc(double %0, double %1, double %2) {
%4 = fcmp oeq double %0, 0.000000e+00
%5 = fdiv double 1.000000e+00, %0
%6 = select i1 %4, double 1.000000e+00, double %5
%7 = fmul double %6, %1
ret double %7
}
int *u_alloc(int size, int **_ptr) {
  int *ptr = *_ptr;
  *_ptr = ptr + size;
  return ptr;
}


x86 assembly (clang, -O0):
<u_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_alloc>:
mov    (%rsi),%rax
movslq %edi,%rcx
lea    (%rax,%rcx,4),%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define i32* @u_alloc(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*** %4
%7 = load i32*, i32** %6
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32**, i32*** %4
store i32* %11, i32** %12
%13 = load i32*, i32** %5
ret i32* %13
}

LLVM IR (-O2):
define i32* @u_alloc(i32 %0, i32** nocapture %1) {
%3 = load i32*, i32** %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
store i32* %5, i32** %1
ret i32* %3
}
/* Variables and functions */
scalar_t__ getpgrp();
long GETPGRP() { return ((long)getpgrp()); }


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

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

LLVM IR (-O0):
define i64 @GETPGRP() {
%1 = call i64 (...) @getpgrp()
ret i64 %1
}

LLVM IR (-O2):
define i64 @GETPGRP() {
%1 = tail call i64 (...) @getpgrp()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ print_target_indices(char *, int const *);
void print_thermal_sensor_target_indices(const int *pData) {
  print_target_indices("THERMAL-SENSOR", pData);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"THERMAL-SENSOR\00"
define void @print_thermal_sensor_target_indices(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @print_target_indices(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"THERMAL-SENSOR\00"
define void @print_thermal_sensor_target_indices(i32* %0) {
%2 = tail call i32 @print_target_indices(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR7C_set(void) { return U_WMRCORENONE_set("U_WMR7C"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR7C\00"
define i8* @U_WMR7C_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
scalar_t__ pthread_self();
void *thfn(void *arg) {
  pid_t pid;
  pthread_t tid;
  pid = getpid();
  tid = pthread_self();
  printf("the new thread: pid is: %u, tid is: %u\n", (unsigned int)pid,
         (unsigned int)tid);
  return NULL;
}


x86 assembly (clang, -O0):
<thfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thfn>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"the new thread: pid is: %u, tid is: %u\0A\00"
define i8* @thfn(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %3
%6 = call i64 (...) @pthread_self()
store i64 %6, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
ret i8* null
}

LLVM IR (-O2):
@.str = [40 x i8] c"the new thread: pid is: %u, tid is: %u\0A\00"
define noalias i8* @thfn(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %2 to i32
%5 = trunc i64 %3 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i8* null
}
int aa_pro_ctr_a10(int chan, unsigned char *buf, int len) {
  if (len != 2)
    hu_log(6, "hu_aap", __func__, "Byebye Response");
  else
    hu_log(3, "hu_aap", __func__, "Byebye Response");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
je     1152 <aa_pro_ctr_a10+0x42>
mov    $0x6,%edi
lea    0xec8(%rip),%rsi
lea    0xec8(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
jmp    1173 <aa_pro_ctr_a10+0x63>
mov    $0x3,%edi
lea    0xea2(%rip),%rsi
lea    0xea2(%rip),%rdx
lea    0xeaa(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a10>:
push   %rax
xor    %eax,%eax
cmp    $0x2,%edx
setne  %al
lea    (%rax,%rax,2),%edi
add    $0x3,%edi
lea    0xeda(%rip),%rsi
lea    0xeda(%rip),%rdx
lea    0xee2(%rip),%rcx
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a10 = [15 x i8] c"aa_pro_ctr_a10\00"
@.str.1 = [16 x i8] c"Byebye Response\00"
define i32 @aa_pro_ctr_a10(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* %6
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a10, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %3
%12 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a10, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a10 = [15 x i8] c"aa_pro_ctr_a10\00"
@.str.1 = [16 x i8] c"Byebye Response\00"
define i32 @aa_pro_ctr_a10(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %2, 2
%5 = select i1 %4, i32 3, i32 6
%6 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a10, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ U_PMF_SERIAL_get(char const **, int *, int, int, int);
int U_PMF_LEN_BYTEDATA(const char *contents) {
  int Size;
  U_PMF_SERIAL_get(&contents, &Size, 4, 1, 1);
  Size += 4;
  return (Size);
}


x86 assembly (clang, -O0):
<U_PMF_LEN_BYTEDATA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <U_PMF_SERIAL_get@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_PMF_LEN_BYTEDATA>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <U_PMF_SERIAL_get@plt>
mov    0xc(%rsp),%eax
add    $0x4,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @U_PMF_LEN_BYTEDATA(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @U_PMF_SERIAL_get(i8** %2, i32* %3, i32 4, i32 1, i32 1)
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 4
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_PMF_LEN_BYTEDATA(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = bitcast i32* %3 to i8*
%5 = call i32 @U_PMF_SERIAL_get(i8** %2, i32* %3, i32 4, i32 1, i32 1)
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 4
ret i32 %7
}