xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ act8600_i2c_en_RestoreConfig();
void act8600_i2c_en_Wakeup(void) { act8600_i2c_en_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @act8600_i2c_en_Wakeup() {
%1 = tail call i32 (...) @act8600_i2c_en_RestoreConfig()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char *argv[]) {
  int a = 1, b = 1, c = 1;
  c = ++a || ++b && ++c;
  printf("%d, %d, %d\n", a, b, c);
  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)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
jne    1181 <main+0x71>
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1e(%rbp)
je     117b <main+0x6b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"%d, %d, %d\0A\00"
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 1, i32* %7
store i32 1, i32* %8
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
store i32 %10, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %2
%13 = load i32, i32* %7
%14 = add nsw i32 %13, 1
store i32 %14, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i32, i32* %8
%18 = add nsw i32 %17, 1
store i32 %18, i32* %8
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %16, %12
%21 = phi i1 [ false, %12 ], [ %19, %16 ]
br label %22
22: ; preds = %20, %2
%23 = phi i1 [ true, %2 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
store i32 %24, i32* %8
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d, %d, %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2, i32 1, i32 1)
ret i32 0
}
void gtk_text_view_get_accepts_tab() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_accepts_tab() {
ret void
}
int ddsGetMipmap(unsigned const char *buffer) {
  return (buffer[28] & 0xFF) | (buffer[29] & 0xFF) << 8 |
         (buffer[30] & 0xFF) << 16 | (buffer[31] & 0xFF) << 24;
}


x86 assembly (clang, -O0):
<ddsGetMipmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1c(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1d(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1e(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1f(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ddsGetMipmap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 28
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 29
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 30
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 31
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, 255
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ddsGetMipmap(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 28
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 29
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 30
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 31
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}
/* Variables and functions */
int func(char *cp1, char *cp2, char *cp3, char *cp4) {
  if (cp1)
    return 1;
  if (cp2 == NULL)
    return 2;
  if (NULL != cp3)
    return 3;
  return (cp4 != 0) ? 0 : 1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112b <func+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    116f <func+0x6f>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <func+0x42>
movl   $0x2,-0x4(%rbp)
jmp    116f <func+0x6f>
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
je     115a <func+0x5a>
movl   $0x3,-0x4(%rbp)
jmp    116f <func+0x6f>
mov    -0x28(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    $0x1,%eax
test   %rdi,%rdi
je     110b <func+0xb>
ret
test   %rsi,%rsi
je     1123 <func+0x23>
mov    $0x3,%eax
test   %rdx,%rdx
jne    110a <func+0xa>
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
ret
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @func(i8* readnone %0, i8* readnone %1, i8* readnone %2, i8* readnone %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %13
6: ; preds = %4
%7 = icmp eq i8* %1, null
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp eq i8* %2, null
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = icmp eq i8* %3, null
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %6, %4, %10
%14 = phi i32 [ %12, %10 ], [ 1, %4 ], [ 2, %6 ], [ 3, %8 ]
ret i32 %14
}
int is_dock_device(struct acpi_device *adev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.acpi_device = type opaque
define i32 @is_dock_device(%struct.acpi_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x10() {
  Assert_real((islower(16) == 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_islower.c",
              85, ("islower should be 0 for 0x10"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x10>:
push   %rax
mov    $0x10,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x55,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x10\00"
define void @t_islower_0x10() {
%1 = call i64 @islower(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x10\00"
define void @t_islower_0x10() {
%1 = tail call i64 @islower(i32 16)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void RasterIdleModeConfig(unsigned int baseAddr, unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x54)))) &= 0xfffffff3;
  (*((volatile unsigned int *)(baseAddr + (0x54)))) |= flag;
}


x86 assembly (clang, -O0):
<RasterIdleModeConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff3,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterIdleModeConfig>:
add    $0x54,%edi
andl   $0xfffffff3,(%rdi)
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @RasterIdleModeConfig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 84
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -13
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add i32 %12, 84
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, %11
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @RasterIdleModeConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 84
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -13
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = or i32 %8, %1
store volatile i32 %9, i32* %5
ret void
}
/* Variables and functions */
double alngam(double *);
double alng(double x) {
  double xx = x;
  return alngam(&xx);
}


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

x86 assembly (clang, -O2):
<alng>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <alngam@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @alng(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double %0, double* %2
%4 = call double @alngam(double* %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rob(int *, int);
int main() {
  int arr[] = {1, 2, 3, 1};
  printf("%d", rob(arr, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <rob@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <rob@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [4 x i32] [i32 1, i32 2, i32 3, i32 1]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @rob(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t decodeIntsixteen(char *input) {
  unsigned int f = 0;
  for (int i = 1; i >= 0; i--) {
    f |= ((*(unsigned char *)input) << 8 * i) & (255 << 8 * i);
    input++;
  }
  return *((int16_t *)&f);
}


x86 assembly (clang, -O0):
<decodeIntsixteen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1160 <decodeIntsixteen+0x60>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xff,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <decodeIntsixteen+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeIntsixteen>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @decodeIntsixteen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
double clock();
double cpu_time() { return clock() / ((double)CLOCKS_PER_SEC); }


x86 assembly (clang, -O0):
<cpu_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @cpu_time() {
%1 = call double (...) @clock()
%2 = load i64, i64* @CLOCKS_PER_SEC
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @cpu_time() {
%1 = tail call double (...) @clock()
%2 = load i64, i64* @CLOCKS_PER_SEC
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
/* Variables and functions */
unsigned char I2C_read(int /*<<< orphan*/);
int /*<<< orphan*/ I2C_start();
int /*<<< orphan*/ I2C_stop();
int /*<<< orphan*/ I2C_write(int);
unsigned char DS3231_Read(unsigned char address) {
  unsigned char value = 0;
  I2C_start();
  I2C_write(((0x68 << 1) & 0xFE));
  I2C_write(address);
  I2C_start();
  I2C_write(((0x68 << 1) | 0x01));
  value = I2C_read(0);
  I2C_stop();
  return value;
}


x86 assembly (clang, -O0):
<DS3231_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
mov    $0x0,%al
call   1050 <I2C_start@plt>
mov    $0xd0,%edi
call   1060 <I2C_write@plt>
movzbl -0x1(%rbp),%edi
call   1060 <I2C_write@plt>
mov    $0x0,%al
call   1050 <I2C_start@plt>
mov    $0xd1,%edi
call   1060 <I2C_write@plt>
xor    %edi,%edi
call   1040 <I2C_read@plt>
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <I2C_stop@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS3231_Read>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <I2C_start@plt>
mov    $0xd0,%edi
call   1060 <I2C_write@plt>
mov    %ebx,%edi
call   1060 <I2C_write@plt>
xor    %eax,%eax
call   1050 <I2C_start@plt>
mov    $0xd1,%edi
call   1060 <I2C_write@plt>
xor    %edi,%edi
call   1040 <I2C_read@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <I2C_stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @DS3231_Read(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = call i32 (...) @I2C_start()
%5 = call i32 @I2C_write(i32 208)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = call i32 @I2C_write(i32 %7)
%9 = call i32 (...) @I2C_start()
%10 = call i32 @I2C_write(i32 209)
%11 = call zeroext i8 @I2C_read(i32 0)
store i8 %11, i8* %3
%12 = call i32 (...) @I2C_stop()
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @DS3231_Read(i8 zeroext %0) {
%2 = tail call i32 (...) @I2C_start()
%3 = tail call i32 @I2C_write(i32 208)
%4 = zext i8 %0 to i32
%5 = tail call i32 @I2C_write(i32 %4)
%6 = tail call i32 (...) @I2C_start()
%7 = tail call i32 @I2C_write(i32 209)
%8 = tail call zeroext i8 @I2C_read(i32 0)
%9 = tail call i32 (...) @I2C_stop()
ret i8 %8
}
/* Type definitions */
typedef int v;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, char);
char *vtx_name(int v, int width) {
  static char name[100];
  sprintf(name, "%*d%c", width, (((v) + 1) >> 1), (v % 2) ? 'b' : 'e');
  return name;
}


x86 assembly (clang, -O0):
<vtx_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
sar    $0x1,%ecx
mov    -0x4(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %edx,%edi
mov    -0xc(%rbp),%edx
mov    $0x65,%eax
mov    $0x62,%esi
cmp    $0x0,%edi
cmovne %esi,%eax
lea    0x2eec(%rip),%rdi
lea    0xea5(%rip),%rsi
movsbl %al,%r8d
call   1030 <sprintf@plt>
lea    0x2ed5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtx_name>:
push   %rbx
mov    %esi,%edx
lea    0x1(%rdi),%ecx
sar    %ecx
xor    %eax,%eax
test   $0x1,%dil
sete   %al
lea    (%rax,%rax,2),%r8d
add    $0x62,%r8d
lea    0x2f10(%rip),%rbx
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@vtx_name.name = internal global [100 x i8] zeroinitializer
@.str = [6 x i8] c"%*d%c\00"
define i8* @vtx_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = ashr i32 %7, 1
%9 = load i32, i32* %3
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 98, i32 101
%14 = trunc i32 %13 to i8
%15 = call i32 @sprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @vtx_name.name, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i8 signext %14)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @vtx_name.name, i64 0, i64 0)
}

LLVM IR (-O2):
@vtx_name.name = internal global [100 x i8] zeroinitializer
@.str = [6 x i8] c"%*d%c\00"
define i8* @vtx_name(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = ashr i32 %3, 1
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8 101, i8 98
%8 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @vtx_name.name, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4, i8 signext %7)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @vtx_name.name, i64 0, i64 0)
}
/* Type definitions */
struct task_s {
  int dummy;
};

/* Variables and functions */
int task_do_sleep(struct task_s *);
int task_thread_func(void *context) {
  struct task_s *task = (struct task_s *)context;
  return task_do_sleep(task);
}


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

x86 assembly (clang, -O2):
<task_thread_func>:
jmp    1030 <task_do_sleep@plt>

LLVM IR (-O0):
%struct.task_s = type { i32 }
define i32 @task_thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.task_s*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.task_s*
store %struct.task_s* %5, %struct.task_s** %3
%6 = load %struct.task_s*, %struct.task_s** %3
%7 = call i32 @task_do_sleep(%struct.task_s* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.task_s = type { i32 }
define i32 @task_thread_func(i8* %0) {
%2 = bitcast i8* %0 to %struct.task_s*
%3 = tail call i32 @task_do_sleep(%struct.task_s* %2)
ret i32 %3
}
void P_collide(struct Station *station) { ; }


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

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

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

LLVM IR (-O2):
%struct.Station = type opaque
define void @P_collide(%struct.Station* nocapture %0) {
ret void
}
void border_nwse_double_diagonal_special_sand_only(unsigned char *pic,
                                                   unsigned char *mirr) {
  *pic = 0x2A;
  ;
}


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

x86 assembly (clang, -O2):
<border_nwse_double_diagonal_special_sand_only>:
movb   $0x2a,(%rdi)
ret

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

LLVM IR (-O2):
define void @border_nwse_double_diagonal_special_sand_only(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 42, i8* %0
ret void
}
int test() {
  volatile int foo = 0x88, bar = 0x04, baz = 0x40;
  volatile int qux = (bar ^ baz);
  qux |= foo;
  qux &= 0xEE;
  qux |= 0x33;
  qux <<= 4;
  return qux;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x88,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x40,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xee,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     $0x33,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movl   $0x88,-0x4(%rsp)
movl   $0x4,-0x8(%rsp)
movl   $0x40,-0xc(%rsp)
mov    -0x8(%rsp),%eax
xor    -0xc(%rsp),%eax
mov    %eax,-0x10(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,-0x10(%rsp)
andl   $0xee,-0x10(%rsp)
orl    $0x33,-0x10(%rsp)
shll   $0x4,-0x10(%rsp)
mov    -0x10(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store volatile i32 136, i32* %1
store volatile i32 4, i32* %2
store volatile i32 64, i32* %3
%5 = load volatile i32, i32* %2
%6 = load volatile i32, i32* %3
%7 = xor i32 %5, %6
store volatile i32 %7, i32* %4
%8 = load volatile i32, i32* %1
%9 = load volatile i32, i32* %4
%10 = or i32 %9, %8
store volatile i32 %10, i32* %4
%11 = load volatile i32, i32* %4
%12 = and i32 %11, 238
store volatile i32 %12, i32* %4
%13 = load volatile i32, i32* %4
%14 = or i32 %13, 51
store volatile i32 %14, i32* %4
%15 = load volatile i32, i32* %4
%16 = shl i32 %15, 4
store volatile i32 %16, i32* %4
%17 = load volatile i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store volatile i32 136, i32* %1
%6 = bitcast i32* %2 to i8*
store volatile i32 4, i32* %2
%7 = bitcast i32* %3 to i8*
store volatile i32 64, i32* %3
%8 = bitcast i32* %4 to i8*
%9 = load volatile i32, i32* %2
%10 = load volatile i32, i32* %3
%11 = xor i32 %10, %9
store volatile i32 %11, i32* %4
%12 = load volatile i32, i32* %1
%13 = load volatile i32, i32* %4
%14 = or i32 %13, %12
store volatile i32 %14, i32* %4
%15 = load volatile i32, i32* %4
%16 = and i32 %15, 238
store volatile i32 %16, i32* %4
%17 = load volatile i32, i32* %4
%18 = or i32 %17, 51
store volatile i32 %18, i32* %4
%19 = load volatile i32, i32* %4
%20 = shl i32 %19, 4
store volatile i32 %20, i32* %4
%21 = load volatile i32, i32* %4
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strcasecmp(char *, char *);
void strcasecmp_diff_length_3() {
  char *x = "aBc";
  char *y = "abcde";
  clang_analyzer_eval(strcasecmp(x, y) < 0);
}


x86 assembly (clang, -O0):
<strcasecmp_diff_length_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcasecmp_diff_length_3>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
shr    $0x3f,%rax
mov    %eax,%edi
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"aBc\00"
@.str.1 = [6 x i8] c"abcde\00"
define void @strcasecmp_diff_length_3() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strcasecmp(i8* %3, i8* %4)
%6 = icmp slt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"aBc\00"
@.str.1 = [6 x i8] c"abcde\00"
define void @strcasecmp_diff_length_3() {
%1 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
void free_toktable_db(struct toktable_db *x) {}


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

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

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

LLVM IR (-O2):
%struct.toktable_db = type opaque
define void @free_toktable_db(%struct.toktable_db* nocapture %0) {
ret void
}
/* Type definitions */
struct yyproto_packer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct yyproto_packer *);
void yyproto_packer_free(struct yyproto_packer *packer) { free(packer); }


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

x86 assembly (clang, -O2):
<yyproto_packer_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.yyproto_packer = type { i32 }
define void @yyproto_packer_free(%struct.yyproto_packer* %0) {
%2 = alloca %struct.yyproto_packer*
store %struct.yyproto_packer* %0, %struct.yyproto_packer** %2
%3 = load %struct.yyproto_packer*, %struct.yyproto_packer** %2
%4 = call i32 @free(%struct.yyproto_packer* %3)
ret void
}

LLVM IR (-O2):
%struct.yyproto_packer = type { i32 }
define void @yyproto_packer_free(%struct.yyproto_packer* nocapture %0) {
%2 = tail call i32 @free(%struct.yyproto_packer* %0)
ret void
}
void addToDelete(int u, int *list, int *nb, char *marked) {
  if (marked[u] < 3) {
    list[(*nb)++] = u;
    marked[u] = 3;
  }
}


x86 assembly (clang, -O0):
<addToDelete>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3,%eax
jge    114e <addToDelete+0x4e>
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x3,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addToDelete>:
movslq %edi,%rax
cmpb   $0x2,(%rcx,%rax,1)
jg     111a <addToDelete+0x1a>
movslq (%rdx),%r8
lea    0x1(%r8),%edi
mov    %edi,(%rdx)
mov    %eax,(%rsi,%r8,4)
movb   $0x3,(%rcx,%rax,1)
ret

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

LLVM IR (-O2):
define void @addToDelete(i32 %0, i32* nocapture writeonly %1, i32* nocapture %2, i8* nocapture %3) {
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
%8 = icmp slt i8 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i32, i32* %1, i64 %12
store i32 %0, i32* %13
store i8 3, i8* %6
br label %14
14: ; preds = %9, %4
ret void
}
int imax(int x, int y) { return (x > y) ? x : y; }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imax(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
char *_strchr(char *src, int c) {
  char *s = src;
  if (!s)
    return (void *)0;
  while (*s && *s != c)
    s++;
  return s;
}


x86 assembly (clang, -O0):
<_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    112b <_strchr+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    117e <_strchr+0x7e>
jmp    1130 <_strchr+0x30>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
je     1155 <_strchr+0x55>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1165 <_strchr+0x65>
jmp    1176 <_strchr+0x76>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <_strchr+0x30>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strchr>:
test   %rdi,%rdi
je     1121 <_strchr+0x21>
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <_strchr+0x20>
cmp    %esi,%ecx
jne    1110 <_strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @_strchr(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %11, %4 ], [ %0, %2 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
%10 = or i1 %7, %9
%11 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %10, label %12, label %4
12: ; preds = %4, %2
%13 = phi i8* [ null, %2 ], [ %5, %4 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  int i = -5 % 2;
  if (i != -1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1137 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello, SmallC World!\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello, SmallC World!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Hello, SmallC World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct gsm_modul {
  int dummy;
};
struct at_call {
  int dummy;
};

/* Variables and functions */
int gsm_call_proceeding(struct gsm_modul *, struct at_call *, int, int);
int gsm_proceeding(struct gsm_modul *gsm, struct at_call *call, int channel,
                   int info) {
  if (!gsm || !call) {
    return -1;
  }
  return gsm_call_proceeding(gsm, call, channel, info);
}


x86 assembly (clang, -O0):
<gsm_proceeding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <gsm_proceeding+0x2c>
cmpq   $0x0,-0x18(%rbp)
jne    1148 <gsm_proceeding+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <gsm_proceeding+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1030 <gsm_call_proceeding@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_proceeding>:
test   %rdi,%rdi
je     111f <gsm_proceeding+0xf>
test   %rsi,%rsi
je     111f <gsm_proceeding+0xf>
jmp    1030 <gsm_call_proceeding@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.gsm_modul = type { i32 }
%struct.at_call = type { i32 }
define i32 @gsm_proceeding(%struct.gsm_modul* %0, %struct.at_call* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.gsm_modul*
%7 = alloca %struct.at_call*
%8 = alloca i32
%9 = alloca i32
store %struct.gsm_modul* %0, %struct.gsm_modul** %6
store %struct.at_call* %1, %struct.at_call** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load %struct.gsm_modul*, %struct.gsm_modul** %6
%11 = icmp ne %struct.gsm_modul* %10, null
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load %struct.at_call*, %struct.at_call** %7
%14 = icmp ne %struct.at_call* %13, null
br i1 %14, label %16, label %15
15: ; preds = %12, %4
store i32 -1, i32* %5
br label %22
16: ; preds = %12
%17 = load %struct.gsm_modul*, %struct.gsm_modul** %6
%18 = load %struct.at_call*, %struct.at_call** %7
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = call i32 @gsm_call_proceeding(%struct.gsm_modul* %17, %struct.at_call* %18, i32 %19, i32 %20)
store i32 %21, i32* %5
br label %22
22: ; preds = %16, %15
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
%struct.gsm_modul = type { i32 }
%struct.at_call = type { i32 }
define i32 @gsm_proceeding(%struct.gsm_modul* %0, %struct.at_call* %1, i32 %2, i32 %3) {
%5 = icmp ne %struct.gsm_modul* %0, null
%6 = icmp ne %struct.at_call* %1, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @gsm_call_proceeding(%struct.gsm_modul* %0, %struct.at_call* %1, i32 %2, i32 %3)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", (int)sizeof(float *)); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
int hibyte(int i) { return ((i >> 8) & 0xFF); }


x86 assembly (clang, -O0):
<hibyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hibyte>:
mov    %edi,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @hibyte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @hibyte(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
unsigned int npu_is_pcimaster(void) {
  return ((*(volatile unsigned long *)((0xfaff8000 + 0x0a00) | 0x18)) &
          ((1 << 2)));
}


x86 assembly (clang, -O0):
<npu_is_pcimaster>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfaff8a18,%eax
mov    (%rax),%rax
and    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<npu_is_pcimaster>:
mov    $0xfaff8a18,%eax
mov    (%rax),%rax
and    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @npu_is_pcimaster() {
%1 = load volatile i64, i64* inttoptr (i64 4211051032 to i64*)
%2 = and i64 %1, 4
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @npu_is_pcimaster() {
%1 = load volatile i64, i64* inttoptr (i64 4211051032 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 4
ret i32 %3
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int streq(char *a, char *b) { return (strcmp(a, b) == 0); }


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int dq_count_impl(unsigned int tail, unsigned int head, unsigned int size) {
  return ((tail - head) & (size - 1));
}


x86 assembly (clang, -O0):
<dq_count_impl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dq_count_impl>:
sub    %esi,%edi
lea    -0x1(%rdx),%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @dq_count_impl(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %0, %1
%5 = add i32 %2, -1
%6 = and i32 %5, %4
ret i32 %6
}
/* Variables and functions */
char doSomething(int);
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  char result = doSomething(1);
  printf("%d\n", result);
  result = doSomething(-1);
  printf("%d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <doSomething@plt>
mov    %al,-0x11(%rbp)
lea    0xebd(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <doSomething@plt>
mov    %al,-0x11(%rbp)
lea    0xea0(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <doSomething@plt>
movsbl %al,%esi
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <doSomething@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 @doSomething(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = tail call signext i8 @doSomething(i32 -1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}