xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void *uart_out(void *arg) {
  char *s = arg;
  puts(s);
  return arg;
}


x86 assembly (clang, -O0):
<uart_out>:
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 <puts@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_out>:
push   %rbx
mov    %rdi,%rbx
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @uart_out(i8* returned %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
void _mm256_storeu_epi32(void *, int /*<<< orphan*/);
void test_mm256_storeu_epi32(void *__P, __m256i __A) {
  return _mm256_storeu_epi32(__P, __A);
}


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

x86 assembly (clang, -O2):
<test_mm256_storeu_epi32>:
jmp    1030 <_mm256_storeu_epi32@plt>

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

LLVM IR (-O2):
define void @test_mm256_storeu_epi32(i8* %0, i32 %1) {
tail call void @_mm256_storeu_epi32(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: ethos <tap> <serial> [baudrate]\n");
  fprintf(stderr, "       ethos <tap> tcp:<host> [port]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xeef(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef9(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: ethos <tap> <serial> [baudrate]\0A\00"
@.str.1 = [38 x i8] c" ethos <tap> tcp:<host> [port]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: ethos <tap> <serial> [baudrate]\0A\00"
@.str.1 = [38 x i8] c" ethos <tap> tcp:<host> [port]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t int_square(int64_t val) { return val * val; }


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

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

LLVM IR (-O0):
define i32 @int_square(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @int_square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_cont(int sig) { printf("CONT\n"); }


x86 assembly (clang, -O0):
<catch_cont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"CONT\0A\00"
define void @catch_cont(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"CONT\00"
define void @catch_cont(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((always_)) int fih_delay_init(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @fih_delay_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @fih_delay_init() {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_IntRegister(int, void (*)());
void stub1(uint32_t);
void AESIntRegister(void (*handlerFxn)(void)) {
  NOROM_IntRegister(39, handlerFxn);
  ((void (*)(uint32_t ui32Interrupt))(
      (uint32_t *)(((uint32_t *)0x10000180)[12]))[4])(39);
}


x86 assembly (clang, -O0):
<AESIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x27,%edi
call   1030 <NOROM_IntRegister@plt>
mov    $0x10000180,%eax
mov    0x60(%rax),%rax
mov    $0x27,%edi
call   *0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESIntRegister>:
push   %rax
mov    %rdi,%rsi
mov    $0x27,%edi
call   1030 <NOROM_IntRegister@plt>
mov    0x100001e0,%rax
10
mov    $0x27,%edi
pop    %rcx
jmp    *0x20(%rax)

LLVM IR (-O0):
define void @AESIntRegister(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i32 @NOROM_IntRegister(i32 39, void (...)* %4)
%6 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 268435840 to i64*), i64 12)
%7 = inttoptr i64 %6 to i64*
%8 = getelementptr inbounds i64, i64* %7, i64 4
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to void (i64)*
ret void
}

LLVM IR (-O2):
define void @AESIntRegister(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i32 @NOROM_IntRegister(i32 39, void (...)* %2)
%4 = load i64, i64* inttoptr (i64 268435936 to i64*)
%5 = inttoptr i64 %4 to i64*
%6 = getelementptr inbounds i64, i64* %5, i64 4
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to void (i64)*
tail call void %8(i64 39)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_start();
int /*<<< orphan*/ I2C_stop();
int /*<<< orphan*/ I2C_write(unsigned char);
void DS1307_Write(unsigned char addr, unsigned char dat) {
  unsigned int temp;
  temp = dat;
  dat = (((dat / 10) * 16) | (temp % 10));
  I2C_start();
  I2C_write(0XD0);
  I2C_write(addr);
  I2C_write(dat);
  I2C_stop();
}


x86 assembly (clang, -O0):
<DS1307_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    -0xc(%rbp),%eax
or     %edx,%eax
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1040 <I2C_start@plt>
mov    $0xd0,%edi
call   1050 <I2C_write@plt>
movzbl -0x1(%rbp),%edi
call   1050 <I2C_write@plt>
movzbl -0x2(%rbp),%edi
call   1050 <I2C_write@plt>
mov    $0x0,%al
call   1030 <I2C_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS1307_Write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
imul   $0xcd,%esi,%eax
shr    $0xb,%eax
mov    %eax,%ecx
shl    $0x4,%cl
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bl
or     %cl,%bl
xor    %eax,%eax
call   1040 <I2C_start@plt>
mov    $0xd0,%edi
call   1050 <I2C_write@plt>
mov    %ebp,%edi
call   1050 <I2C_write@plt>
movzbl %bl,%edi
call   1050 <I2C_write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <I2C_stop@plt>

LLVM IR (-O0):
define void @DS1307_Write(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = sdiv i32 %9, 10
%11 = mul nsw i32 %10, 16
%12 = load i32, i32* %5
%13 = urem i32 %12, 10
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = call i32 (...) @I2C_start()
%17 = call i32 @I2C_write(i8 zeroext -48)
%18 = load i8, i8* %3
%19 = call i32 @I2C_write(i8 zeroext %18)
%20 = load i8, i8* %4
%21 = call i32 @I2C_write(i8 zeroext %20)
%22 = call i32 (...) @I2C_stop()
ret void
}

LLVM IR (-O2):
define void @DS1307_Write(i8 zeroext %0, i8 zeroext %1) {
%3 = udiv i8 %1, 10
%4 = shl i8 %3, 4
%5 = urem i8 %1, 10
%6 = or i8 %4, %5
%7 = tail call i32 (...) @I2C_start()
%8 = tail call i32 @I2C_write(i8 zeroext -48)
%9 = tail call i32 @I2C_write(i8 zeroext %0)
%10 = tail call i32 @I2C_write(i8 zeroext %6)
%11 = tail call i32 (...) @I2C_stop()
ret void
}
long long potenca(long long p, long long k) {
  long long rezultat = 1;
  while (k > 0) {
    if ((k >> 0) & 1) {
      k--;
      rezultat *= p;
    }
    p *= p;
    k /= 2;
  }
  return rezultat;
}


x86 assembly (clang, -O0):
<potenca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1172 <potenca+0x72>
mov    -0x10(%rbp),%rax
sar    $0x0,%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     114e <potenca+0x4e>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
jmp    1114 <potenca+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<potenca>:
test   %rsi,%rsi
jle    1137 <potenca+0x37>
mov    $0x1,%ecx
mov    $0x1,%eax
nop
mov    %rsi,%rdx
and    $0xfffffffffffffffe,%rdx
test   $0x1,%sil
mov    %rdi,%rsi
cmove  %rcx,%rsi
imul   %rsi,%rax
imul   %rdi,%rdi
mov    %rdx,%rsi
shr    %rsi
cmp    $0x1,%rdx
ja     1110 <potenca+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @potenca(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 1, i64* %5
br label %6
6: ; preds = %20, %2
%7 = load i64, i64* %4
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load i64, i64* %4
%11 = ashr i64 %10, 0
%12 = and i64 %11, 1
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i64, i64* %4
%16 = add nsw i64 %15, -1
store i64 %16, i64* %4
%17 = load i64, i64* %3
%18 = load i64, i64* %5
%19 = mul nsw i64 %18, %17
store i64 %19, i64* %5
br label %20
20: ; preds = %14, %9
%21 = load i64, i64* %3
%22 = load i64, i64* %3
%23 = mul nsw i64 %22, %21
store i64 %23, i64* %3
%24 = load i64, i64* %4
%25 = sdiv i64 %24, 2
store i64 %25, i64* %4
br label %6
26: ; preds = %6
%27 = load i64, i64* %5
ret i64 %27
}

LLVM IR (-O2):
define i64 @potenca(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %18
4: ; preds = %2, %4
%5 = phi i64 [ %14, %4 ], [ 1, %2 ]
%6 = phi i64 [ %16, %4 ], [ %1, %2 ]
%7 = phi i64 [ %15, %4 ], [ %0, %2 ]
%8 = and i64 %6, 1
%9 = icmp eq i64 %8, 0
%10 = xor i1 %9, true
%11 = sext i1 %10 to i64
%12 = add nsw i64 %6, %11
%13 = select i1 %9, i64 1, i64 %7
%14 = mul nsw i64 %13, %5
%15 = mul nsw i64 %7, %7
%16 = lshr i64 %12, 1
%17 = icmp ult i64 %12, 2
br i1 %17, label %18, label %4
18: ; preds = %4, %2
%19 = phi i64 [ 1, %2 ], [ %14, %4 ]
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void bar() { assert(1); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rtc_checksum(uint8_t *ptr) {
  uint8_t sum;
  int i;
  sum = 0x00;
  for (i = 0x08; i <= 0x0c; i++)
    sum += ptr[i];
  return (sum);
}


x86 assembly (clang, -O0):
<rtc_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
cmpl   $0xc,-0x10(%rbp)
jg     113f <rtc_checksum+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <rtc_checksum+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_checksum>:
movdqu 0x24(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    0x20(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @rtc_checksum(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 9
%5 = bitcast i32* %4 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %6)
%8 = add nsw i32 %7, %3
ret i32 %8
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
struct passwd *getpwnam(char *);
int /*<<< orphan*/ stderr;
void my_alarm(int signo) {
  struct passwd *ptr;
  if ((ptr = getpwnam("root")) == NULL) {
    fprintf(stderr, "getpwnam(root) error\n");
    exit(1);
  }
  alarm(1);
}


x86 assembly (clang, -O0):
<my_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1040 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1184 <my_alarm+0x44>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x1,%edi
call   1030 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_alarm>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <getpwnam@plt>
test   %rax,%rax
je     115d <my_alarm+0x1d>
mov    $0x1,%edi
pop    %rax
jmp    1030 <alarm@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [5 x i8] c"root\00"
@stderr = global i32 0
@.str.1 = [22 x i8] c"getpwnam(root) error\0A\00"
define void @my_alarm(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store %struct.passwd* %4, %struct.passwd** %3
%5 = icmp eq %struct.passwd* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [5 x i8] c"root\00"
@stderr = global i32 0
@.str.1 = [22 x i8] c"getpwnam(root) error\0A\00"
define void @my_alarm(i32 %0) {
%2 = tail call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = tail call i32 @alarm(i32 1)
ret void
}
int foo6() { return 6; }


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

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

LLVM IR (-O0):
define i32 @foo6() {
ret i32 6
}

LLVM IR (-O2):
define i32 @foo6() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int _chgrp_error(char *message, int ret) {
  fputs("chgrp"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_chgrp_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chgrp_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"chgrp: \00"
@stderr = global i32 0
define i32 @_chgrp_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"chgrp: \00"
@stderr = global i32 0
define i32 @_chgrp_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
long double test_frexpl(long double x, int *y) {
  return __builtin_frexpl(x, y);
}


x86 assembly (clang, -O0):
<test_frexpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <frexpl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_frexpl>:
jmp    1030 <frexpl@plt>

LLVM IR (-O0):
define x86_fp80 @test_frexpl(x86_fp80 %0, i32* %1) {
%3 = alloca x86_fp80
%4 = alloca i32*
store x86_fp80 %0, x86_fp80* %3
store i32* %1, i32** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load i32*, i32** %4
%7 = call x86_fp80 @frexpl(x86_fp80 %5, i32* %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @test_frexpl(x86_fp80 %0, i32* nocapture %1) {
%3 = tail call x86_fp80 @frexpl(x86_fp80 %0, i32* %1)
ret x86_fp80 %3
}
int iw_imgtype_num_channels(int t) {
  switch (t) {
  case 0x0110:
    return 4;
  case 0x0010:
    return 3;
  case 0x0101:
    return 2;
  }
  return 1;
}


x86 assembly (clang, -O0):
<iw_imgtype_num_channels>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x10,%eax
je     114d <iw_imgtype_num_channels+0x4d>
jmp    111b <iw_imgtype_num_channels+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x101,%eax
je     1159 <iw_imgtype_num_channels+0x59>
jmp    112e <iw_imgtype_num_channels+0x2e>
mov    -0xc(%rbp),%eax
sub    $0x110,%eax
jne    1165 <iw_imgtype_num_channels+0x65>
jmp    1141 <iw_imgtype_num_channels+0x41>
movl   $0x4,-0x4(%rbp)
jmp    116c <iw_imgtype_num_channels+0x6c>
movl   $0x3,-0x4(%rbp)
jmp    116c <iw_imgtype_num_channels+0x6c>
movl   $0x2,-0x4(%rbp)
jmp    116c <iw_imgtype_num_channels+0x6c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_imgtype_num_channels>:
cmp    $0x110,%edi
je     111b <iw_imgtype_num_channels+0x1b>
cmp    $0x101,%edi
je     1121 <iw_imgtype_num_channels+0x21>
cmp    $0x10,%edi
jne    1127 <iw_imgtype_num_channels+0x27>
mov    $0x3,%eax
ret
mov    $0x4,%eax
ret
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @iw_imgtype_num_channels(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 272, label %5
i32 16, label %6
i32 257, label %7
]
5: ; preds = %1
store i32 4, i32* %2
br label %9
6: ; preds = %1
store i32 3, i32* %2
br label %9
7: ; preds = %1
store i32 2, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @iw_imgtype_num_channels(i32 %0) {
switch i32 %0, label %4 [
i32 272, label %5
i32 16, label %2
i32 257, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 1, %4 ], [ 2, %3 ], [ 3, %2 ], [ 4, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int _mm256_extract_epi32(int /*<<< orphan*/, int);
int __attribute__((target("avx"))) bar(__m256i a) {
  return _mm256_extract_epi32(a, 3);
}


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x3,%esi
jmp    1030 <_mm256_extract_epi32@plt>

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 @_mm256_extract_epi32(i32 %0, i32 3)
ret i32 %2
}
void rb_init_double(double *obj_val) {
  if (obj_val) {
    *obj_val = 0.0;
  }
}


x86 assembly (clang, -O0):
<rb_init_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111e <rb_init_double+0x1e>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_init_double>:
test   %rdi,%rdi
je     110c <rb_init_double+0xc>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @rb_init_double(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double*, double** %2
store double 0.000000e+00, double* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @rb_init_double(double* writeonly %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store double 0.000000e+00, double* %0
br label %4
4: ; preds = %3, %1
ret void
}
int foo() {
  return 0;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_TRIANGLES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2d(int, int);
void triangulo(int x, int y) {
  glBegin(GL_TRIANGLES);
  glVertex2d(x - 2, y - 2);
  glVertex2d(x, y + 2);
  glVertex2d(x + 2, y - 2);
  glEnd();
}


x86 assembly (clang, -O0):
<triangulo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
call   1040 <glVertex2d@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triangulo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
lea    -0x2(%rbx),%edi
lea    -0x2(%r14),%ebp
mov    %ebp,%esi
call   1040 <glVertex2d@plt>
add    $0x2,%r14d
mov    %ebx,%edi
mov    %r14d,%esi
call   1040 <glVertex2d@plt>
add    $0x2,%ebx
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <glVertex2d@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_TRIANGLES = global i32 0
define void @triangulo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_TRIANGLES
%6 = call i32 @glBegin(i32 %5)
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 2
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 2
%11 = call i32 @glVertex2d(i32 %8, i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 2
%15 = call i32 @glVertex2d(i32 %12, i32 %14)
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 2
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 2
%20 = call i32 @glVertex2d(i32 %17, i32 %19)
%21 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_TRIANGLES = global i32 0
define void @triangulo(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_TRIANGLES
%4 = tail call i32 @glBegin(i32 %3)
%5 = add nsw i32 %0, -2
%6 = add nsw i32 %1, -2
%7 = tail call i32 @glVertex2d(i32 %5, i32 %6)
%8 = add nsw i32 %1, 2
%9 = tail call i32 @glVertex2d(i32 %0, i32 %8)
%10 = add nsw i32 %0, 2
%11 = tail call i32 @glVertex2d(i32 %10, i32 %6)
%12 = tail call i32 (...) @glEnd()
ret void
}
void playSound(void) {}


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

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

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

LLVM IR (-O2):
define void @playSound() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_complement(void) {
  output_line("coma");
  output_line("comb");
}


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

x86 assembly (clang, -O2):
<gen_complement>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <output_line@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <output_line@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"coma\00"
@.str.1 = [5 x i8] c"comb\00"
define void @gen_complement() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"coma\00"
@.str.1 = [5 x i8] c"comb\00"
define void @gen_complement() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *_dl_strrchr(const char *str, int c) {
  register char *prev = 0;
  register char *ptr = (char *)str;
  while (*ptr != '\0') {
    if (*ptr == c)
      prev = ptr;
    ptr++;
  }
  if (c == '\0')
    return (ptr);
  return (prev);
}


x86 assembly (clang, -O0):
<_dl_strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1154 <_dl_strrchr+0x54>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1143 <_dl_strrchr+0x43>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111b <_dl_strrchr+0x1b>
cmpl   $0x0,-0x14(%rbp)
jne    116b <_dl_strrchr+0x6b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <_dl_strrchr+0x73>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_strrchr>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1125 <_dl_strrchr+0x25>
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_dl_strrchr+0x10>
test   %esi,%esi
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @_dl_strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i8* [ %11, %5 ], [ null, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %7, i8* %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %11, %5 ]
%17 = phi i8* [ %0, %2 ], [ %12, %5 ]
%18 = icmp eq i32 %1, 0
%19 = select i1 %18, i8* %17, i8* %16
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ I2C_HAL_delay_10th_usec(int);
int /*<<< orphan*/ I2C_SCL_HIGH();
int /*<<< orphan*/ I2C_SDA_HIGH();
int /*<<< orphan*/ I2C_SDA_LOW();
void I2C_STOP(void) {
  I2C_SDA_LOW();
  I2C_HAL_delay_10th_usec(47);
  ;
  I2C_SCL_HIGH();
  I2C_HAL_delay_10th_usec(40);
  ;
  I2C_SDA_HIGH();
  I2C_HAL_delay_10th_usec(47);
  ;
}


x86 assembly (clang, -O0):
<I2C_STOP>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <I2C_SDA_LOW@plt>
mov    $0x2f,%edi
call   1030 <I2C_HAL_delay_10th_usec@plt>
mov    $0x0,%al
call   1040 <I2C_SCL_HIGH@plt>
mov    $0x28,%edi
call   1030 <I2C_HAL_delay_10th_usec@plt>
mov    $0x0,%al
call   1060 <I2C_SDA_HIGH@plt>
mov    $0x2f,%edi
call   1030 <I2C_HAL_delay_10th_usec@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2C_STOP>:
push   %rax
xor    %eax,%eax
call   1050 <I2C_SDA_LOW@plt>
mov    $0x2f,%edi
call   1030 <I2C_HAL_delay_10th_usec@plt>
xor    %eax,%eax
call   1040 <I2C_SCL_HIGH@plt>
mov    $0x28,%edi
call   1030 <I2C_HAL_delay_10th_usec@plt>
xor    %eax,%eax
call   1060 <I2C_SDA_HIGH@plt>
mov    $0x2f,%edi
pop    %rax
jmp    1030 <I2C_HAL_delay_10th_usec@plt>

LLVM IR (-O0):
define void @I2C_STOP() {
%1 = call i32 (...) @I2C_SDA_LOW()
%2 = call i32 @I2C_HAL_delay_10th_usec(i32 47)
%3 = call i32 (...) @I2C_SCL_HIGH()
%4 = call i32 @I2C_HAL_delay_10th_usec(i32 40)
%5 = call i32 (...) @I2C_SDA_HIGH()
%6 = call i32 @I2C_HAL_delay_10th_usec(i32 47)
ret void
}

LLVM IR (-O2):
define void @I2C_STOP() {
%1 = tail call i32 (...) @I2C_SDA_LOW()
%2 = tail call i32 @I2C_HAL_delay_10th_usec(i32 47)
%3 = tail call i32 (...) @I2C_SCL_HIGH()
%4 = tail call i32 @I2C_HAL_delay_10th_usec(i32 40)
%5 = tail call i32 (...) @I2C_SDA_HIGH()
%6 = tail call i32 @I2C_HAL_delay_10th_usec(i32 47)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_str(char str[]) {
  int i;
  for (i = 0; 0 != str[i]; i++) {
    putchar(str[i]);
  }
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1158 <print_str+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_str+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *_talloc_named_const(void const *, size_t, char const *);
void *talloc_named_const(const void *context, size_t size, const char *name) {
  return _talloc_named_const(context, size, name);
}


x86 assembly (clang, -O0):
<talloc_named_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <_talloc_named_const@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_named_const>:
jmp    1030 <_talloc_named_const@plt>

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

LLVM IR (-O2):
define i8* @talloc_named_const(i8* %0, i64 %1, i8* %2) {
%4 = tail call i8* @_talloc_named_const(i8* %0, i64 %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ rlu_init(int, int);
int /*<<< orphan*/ urcu_init(int);
void global_init(int n_threads, int rlu_max_ws) {
  rlu_init((1), rlu_max_ws);
  ;
  urcu_init(n_threads);
}


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

x86 assembly (clang, -O2):
<global_init>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <rlu_init@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <urcu_init@plt>

LLVM IR (-O0):
define void @global_init(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 = call i32 @rlu_init(i32 1, i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @urcu_init(i32 %7)
ret void
}

LLVM IR (-O2):
define void @global_init(i32 %0, i32 %1) {
%3 = tail call i32 @rlu_init(i32 1, i32 %1)
%4 = tail call i32 @urcu_init(i32 %0)
ret void
}
/* Variables and functions */
double wtime_impl();
double wtime(void) { return wtime_impl(); }


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

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

LLVM IR (-O0):
define double @wtime() {
%1 = call double (...) @wtime_impl()
ret double %1
}

LLVM IR (-O2):
define double @wtime() {
%1 = tail call double (...) @wtime_impl()
ret double %1
}
void check_host_result_freshness(void) {}


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

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

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

LLVM IR (-O2):
define void @check_host_result_freshness() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_water() {
  char *s = "Free Water!\n";
  printf("%s", s);
}


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

x86 assembly (clang, -O2):
<print_water>:
lea    0xef6(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Free Water!\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_water() {
%1 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Free Water!\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_water() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setEmailFrom(int, int);
int /*<<< orphan*/ setEmailTo(int, int);
int createEmail(int from, int to) {
  int retValue_acc;
  int msg;
  {
    {
      msg = 1;
      setEmailFrom(msg, from);
      setEmailTo(msg, to);
      retValue_acc = msg;
    }
    return (retValue_acc);
    return (retValue_acc);
  }
}


x86 assembly (clang, -O0):
<createEmail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <setEmailFrom@plt>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <setEmailTo@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createEmail>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <setEmailFrom@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <setEmailTo@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @createEmail(i32 %0, i32 %1) {
%3 = tail call i32 @setEmailFrom(i32 1, i32 %0)
%4 = tail call i32 @setEmailTo(i32 1, i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void system2(char *debug) {
  printf(debug);
  printf("\n");
  system(debug);
}


x86 assembly (clang, -O0):
<system2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<system2>:
push   %rbx
mov    %rdi,%rbx
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @system2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @system(i8* %6)
ret void
}

LLVM IR (-O2):
define void @system2(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @system(i8* %0)
ret void
}
char enigma_M4_encode(char c, __attribute__((unused)) struct enigma_M4 *e) {
  return c;
}


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

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

LLVM IR (-O0):
%struct.enigma_M4 = type opaque
define signext i8 @enigma_M4_encode(i8 signext %0, %struct.enigma_M4* %1) {
%3 = alloca i8
%4 = alloca %struct.enigma_M4*
store i8 %0, i8* %3
store %struct.enigma_M4* %1, %struct.enigma_M4** %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
%struct.enigma_M4 = type opaque
define signext i8 @enigma_M4_encode(i8 returned signext %0, %struct.enigma_M4* nocapture readnone %1) {
ret i8 %0
}
/* Variables and functions */
char *tparm(char *, int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
char *gtm_tparm(char *c, int p1, int p2) {
  return tparm(c, p1, p2, 0, 0, 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<gtm_tparm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1030 <tparm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtm_tparm>:
push   %rax
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
push   $0x0
call   1030 <tparm@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @gtm_tparm(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @tparm(i8* %0, i32 %1, i32 %2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i8* %4
}
int test_imm_29int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x29 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_29int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2686976
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ chmset();
int /*<<< orphan*/ chnset();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void chtset() {
  int ch;
  printf(
      "\n\t\t\t\tCHANGE TEMPERATURE SETTINGS\n\t\t\t1)Normal "
      "Settings\n\t\t\t2)Monthly Settings\n\t\t\t3)Exit\n\n\t\tEnter Choice :");
  scanf("%d", &ch);
  switch (ch) {
  case 1:
    chnset();
    break;
  case 2:
    chmset();
    break;
  }
}


x86 assembly (clang, -O0):
<chtset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1189 <chtset+0x49>
jmp    1178 <chtset+0x38>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1195 <chtset+0x55>
jmp    119c <chtset+0x5c>
mov    $0x0,%al
call   1060 <chnset@plt>
jmp    119c <chtset+0x5c>
mov    $0x0,%al
call   1050 <chmset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chtset>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1175 <chtset+0x35>
cmp    $0x1,%eax
jne    117c <chtset+0x3c>
xor    %eax,%eax
call   1060 <chnset@plt>
pop    %rax
ret
xor    %eax,%eax
call   1050 <chmset@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [104 x i8] c"\0A\09\09\09\09CHANGE TEMPERATURE SETTINGS\0A\09\09\091)Normal Settings\0A\09\09\092)Monthly Settings\0A\09\09\093)Exit\0A\0A\09\09Enter Choice :\00"
@.str.1 = [3 x i8] c"%d\00"
define void @chtset() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %7
]
5: ; preds = %0
%6 = call i32 (...) @chnset()
br label %9
7: ; preds = %0
%8 = call i32 (...) @chmset()
br label %9
9: ; preds = %0, %7, %5
ret void
}

LLVM IR (-O2):
@.str = [104 x i8] c"\0A\09\09\09\09CHANGE TEMPERATURE SETTINGS\0A\09\09\091)Normal Settings\0A\09\09\092)Monthly Settings\0A\09\09\093)Exit\0A\0A\09\09Enter Choice :\00"
@.str.1 = [3 x i8] c"%d\00"
define void @chtset() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %0
%7 = call i32 (...) @chnset()
br label %10
8: ; preds = %0
%9 = call i32 (...) @chmset()
br label %10
10: ; preds = %0, %8, %6
ret void
}